recollection 1.0.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • new44

Recollection

Effective immutable collections for Dart.

API docs

Examples

Create immutable views around list with ListView. Recreate lists with ListBuilder.

var list = [1, 2, 3];

var view = ListView.of(list);

list = ListBuilder.from(list)
  .add(4)
  .remove(2)
  .build();

Same is possible with sets and maps.

Justification

SDK immutable collection constructors, like List.unmodifiable, copy whole collection using Iterator, which is slow and inefficient.

built_collection package contains immutable wrappers around SDK collections, however there is no way to create immutable wrapper around existing collection without recreating collection from scratch.

recollection package contains immutable collection wrappers that do not copy source collection by themselves. Also there are builders that can be used to create a copy of existing SDK collection with some changes. Those are valuable benefits for performance-sensitive scenarios.

Changelog

1.0.0

  • Initial release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  recollection: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:recollection/recollection.dart';
  
Version Uploaded Documentation Archive
1.0.0 Sep 24, 2018 Go to the documentation of recollection 1.0.0 Download recollection 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:recollection/recollection.dart.

Health suggestions

Format lib/src/list/list_builder.dart.

Run dartfmt to format lib/src/list/list_builder.dart.

Format lib/src/list/list_view.dart.

Run dartfmt to format lib/src/list/list_view.dart.

Format lib/src/map/map_builder.dart.

Run dartfmt to format lib/src/map/map_builder.dart.

Format lib/src/map/map_view.dart.

Run dartfmt to format lib/src/map/map_view.dart.

Format lib/src/set/set_view.dart.

Run dartfmt to format lib/src/set/set_view.dart.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use recollection.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
meta ^1.1.0 1.1.6