Skip to content
pubscout

fast_immutable_collections

12.0.1, released 3 days ago by glasberg.dev

Fast immutable lists, sets, maps, and multimaps for Dart

WASM-ready
$ flutter pub add fast_immutable_collections
Source repository

What it does

Provides immutable collections like IList, ISet, IMap, and IMapOfSets that act like native mutable counterparts with high performance. Includes extension methods for native collections and sorting helpers.

AI-written summary of version 12.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want immutable data structures in your app without the high performance penalty of copying entire collections.
  • You need convenient extension methods on native Dart lists, sets, maps, and iterables.

Skip it when

  • You prefer standard mutable collections everywhere without enforcing immutability.
  • You require deep identity behaviors that conflict with the package's equality configurations.

Strengths

  • Significantly faster than many traditional immutable collection packages by saving structural differences.
  • No manual mutable/immutable cycles required; easy locking via `.lock` extensions.
  • Supports const instances for IList, ISet, and IMap.

Weaknesses

  • Introduces custom collection types (IList, ISet, IMap) that require learning specific APIs.
  • Changes in internal structure flushing can affect identity comparisons if not configured carefully.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
IList<String> ilist = [1, 2].lock;

Alternatives

Packages that do the same job and could replace fast_immutable_collections.

  • built_collection

    Immutable collections based on SDK collections with builder pattern.

  • ordered_set

    Ordered Set that keeps elements sorted and allows duplicates by priority.

  • more

    A collection of utility extensions and specialized data structures for Dart.

  • sortedmap

    A map of objects which can be sorted and filtered on both their key and value.

Works with

Packages commonly used together with fast_immutable_collections: ones it builds on, ones built on it, and its own family.