weak_map 1.0.1 copy "weak_map: ^1.0.1" to clipboard
weak_map: ^1.0.1 copied to clipboard

outdated

WeakMap is a map of key/value pairs in which the keys are weakly referenced. WeakContainer is a weak-reference that only lets you check if some object it the same you had before.

example/main.dart

import 'package:weak_map/weak_map.dart';

void main() {
  var map = WeakMap();
  map["A"] = 1;
  print('A = ${map["A"]}'); // A = 1
  print('B = ${map["B"]}'); // B = null

  var value = WeakContainer("X");
  print('Contains X = ${value.contains("X")}'); // Contains X = true
  print('Contains Y = ${value.contains("Y")}'); // Contains Y = false
}
16
likes
0
pub points
82%
popularity

Publisher

verified publisherglasberg.dev

WeakMap is a map of key/value pairs in which the keys are weakly referenced. WeakContainer is a weak-reference that only lets you check if some object it the same you had before.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on weak_map