{"id":28799664,"url":"https://github.com/simphotonics/identical_items_list","last_synced_at":"2025-06-28T02:03:54.790Z","repository":{"id":288614701,"uuid":"968678940","full_name":"simphotonics/identical_items_list","owner":"simphotonics","description":"A non-empty non-modifiable Dart list containing identical items. ","archived":false,"fork":false,"pushed_at":"2025-04-23T10:52:10.000Z","size":242,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T06:45:56.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simphotonics.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-18T14:25:42.000Z","updated_at":"2025-04-23T10:52:14.000Z","dependencies_parsed_at":"2025-04-19T04:11:35.060Z","dependency_job_id":"b7a12b33-70cd-4b8c-bf92-bcf997cf82c8","html_url":"https://github.com/simphotonics/identical_items_list","commit_stats":null,"previous_names":["simphotonics/identical_items_list"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simphotonics/identical_items_list","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simphotonics%2Fidentical_items_list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simphotonics%2Fidentical_items_list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simphotonics%2Fidentical_items_list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simphotonics%2Fidentical_items_list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simphotonics","download_url":"https://codeload.github.com/simphotonics/identical_items_list/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simphotonics%2Fidentical_items_list/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260705988,"owners_count":23049504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-18T06:40:33.461Z","updated_at":"2025-06-28T02:03:54.782Z","avatar_url":"https://github.com/simphotonics.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Identical Items List\n[![Dart](https://github.com/simphotonics/identical_items_list/actions/workflows/dart.yml/badge.svg)](https://github.com/simphotonics/identical_items_list/actions/workflows/dart.yml)\n\n\n## Introduction\n\nThe package [`identical_items_list`][identical_items_list] provides\na *non-empty* unmodifiable Dart list containing identical\nitems. The list is unmodifiable in the sense that object-mutating methods\nare not implemented and throw an [`UnsupportedError`][UnsupportedError].\n\n## Use Case\n\nConsider a function that returns a (potentially very long) list which\nfor certain conditions contains identical entries. In such cases,\ninstead of creating and returning a standard `List` object,\nit may be more efficient to return an\n[`IdenticalItemsList`][IdenticalItemsList] since\nit implements the interface\n[`List\u003cE\u003e`][List] without using an underlying collection.\nFor more details see [benchmark][benchmark] scores.\n\n## Usage\n\nTo use this library include [`identical_items_list`][identical_items_list]\nas a dependency in your pubspec.yaml file. The\nexample below shows how to construct an object of type\n[`IdenticalItemsList`][IdenticalItemsList].\n\nNote: It is *not* possible to create an\nempty [`IdenticalItemsList`][IdenticalItemsList]. If a non-positive constructor\nparameter `length` is provided, the value 1 will be used instead.\n\n```Dart\nimport 'package:identical_items_list/identical_items_list.dart';\n\nvoid main(List\u003cString\u003e args) {\n  final list = IdenticalItemsList(value: 42, length: 1000000);\n\n  print('List: $list \\n');\n\n  print('Type: list is List\u003cint\u003e: ${list is List\u003cint\u003e} \\n');\n\n  print('Length:  ${list.length} \\n');\n\n  final sum = list.reduce((previousValue, item) =\u003e previousValue + item);\n  print('Sum: $sum \\n');\n\n  print('Access: list[1024] = ${list[1024]}');\n}\n```\n\n\u003cdetails\u003e \u003csummary\u003e Click to show the console output. \u003c/summary\u003e\n\n```Console\n$ dart example/bin/example.dart\nList: [42, 42, 42, 42, 42, ..., 42, 42]\n\nType: is List\u003cint\u003e: true\n\nLength: 1000000\n\nSum: 42000000\n\nAccess: list[1024] = 42\n```\n\u003c/details\u003e\n\nNote: The class [`IdenticalItemsList`][IdenticalItemsList] provides a `const`\nconstructor making it possible to define const objects:\n```Dart\nfinal list1 = const IdenticalItemsList(value: 42, length: 1000);\nfinal list2 = const IdenticalItemsList(value: 42, length: 1000);\n\nprint(list1 == list2); // true\nprint(identical(list1 == list2)); // true\n```\n\n## Examples\n\nFor further information see [example].\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker].\n\n[issue tracker]: https://github.com/simphotonics/identical_items_list/issues\n\n[benchmark]: https://github.com/simphotonics/identical_items_list/tree/main/benchmark\n\n[collections]: https://api.dart.dev/stable/dart-collection/dart-collection-library.html\n\n[example]: https://github.com/simphotonics/identical_items_list/tree/main/example\n\n[identical_items_list]: https://pub.dev/packages/identical_items_list\n\n[IdenticalItemsList]: https://pub.dev/documentation/identical_items_list/latest/identical_items_list/IdenticalItemsList-class.html\n\n[IdenticalItemsIterable]: https://pub.dev/documentation/identical_items_list/latest/identical_items_list/IdenticalItemsIterable-class.html\n\n[IdenticalItemsIterator]: https://pub.dev/documentation/identical_items_list/latest/identical_items_list/IdenticalItemsIterator-class.html\n\n[List]:https://api.dart.dev/dart-core/List-class.html\n\n[UnsupportedError]: https://api.dart.dev/dart-core/UnsupportedError-class.html","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimphotonics%2Fidentical_items_list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimphotonics%2Fidentical_items_list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimphotonics%2Fidentical_items_list/lists"}