immutables 0.1.0 copy "immutables: ^0.1.0" to clipboard
immutables: ^0.1.0 copied to clipboard

Immutable structures in dart. Laconic code without overhead.

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]
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Immutable structures in dart. Laconic code without overhead.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

More

Packages that depend on immutables