recollection 1.0.0

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)

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:

  recollection: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub 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';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix lib/src/list/list_view.dart. (-0.50 points)

Analysis of lib/src/list/list_view.dart reported 1 hint:

line 323 col 32: Use = to separate a named parameter from its default value.

Fix lib/src/set/set_view.dart. (-0.50 points)

Analysis of lib/src/set/set_view.dart reported 1 hint:

line 196 col 32: Use = to separate a named parameter from its default value.

Format lib/src/list/list_builder.dart.

Run dartfmt to format lib/src/list/list_builder.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.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field was unreachable.

Package is getting outdated. (-37.81 points)

The package was last published 71 weeks ago.

The package description is too short. (-19 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and recollection.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


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