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)
  .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 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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
51
Overall:
Weighted score of the above. [more]
40
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

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

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 https://github.com/ranquild/recollection was unreachable.

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/README.md.

For more information see the pub package layout conventions.

Dependencies

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

Admin