immutables 0.1.0 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]
}