immutables 0.1.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 49

Imutable data structures #

List, Map #

Examples #

var c = IList<int>([1, 2, 3]);

print((c + 4).value); // [1, 2, 3, 4]
print(c.value); // [1, 2, 3]

print((c - 3).value); // [1, 2]
print(c.value); // [1, 2, 3]

print(c.take(2).value); // [1, 2]
print(c.value); // [1, 2]

print(c.filter((_) => 1 == _ || 2 == _).value); // [1, 2]
print(c.value); // [1, 2, 3]

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

example/immutables_example.dart

import 'package:immutables/immutables.dart';

main() {
  var c = IList<int>([1, 2, 3]);

  print((c + 4).value); // [1, 2, 3, 4]
  print(c.value); // [1, 2, 3]

  print((c - 3).value); // [1, 2]
  print(c.value); // [1, 2, 3]

  print(c.take(2).value); // [1, 2]
  print(c.value); // [1, 2]

  print(c.filter((_) => 1 == _ || 2 == _).value); // [1, 2]
  print(c.value); // [1, 2, 3]
}

Use this package as a library

1. Depend on it

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


dependencies:
  immutables: ^0.1.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:immutables/immutables.dart';
  
Version Uploaded Documentation Archive
0.1.0 Nov 17, 2018 Go to the documentation of immutables 0.1.0 Download immutables 0.1.0 archive
0.0.1 Nov 16, 2018 Go to the documentation of immutables 0.0.1 Download immutables 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13+1

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Fix lib/src/list.dart. (-3.93 points)

Analysis of lib/src/list.dart reported 8 hints, including:

line 27 col 16: Avoid types as parameter names.

line 29 col 22: Avoid types as parameter names.

line 29 col 25: Avoid types as parameter names.

line 37 col 20: Avoid types as parameter names.

line 64 col 36: Avoid types as parameter names.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
json_matcher ^0.2.2
test ^1.0.0