map_operators 2.0.0 copy "map_operators: ^2.0.0" to clipboard
map_operators: ^2.0.0 copied to clipboard

More comfortable syntax for Map type

example/map_operators_example.dart

import 'package:map_operators/map_operators.dart';

void main() {
  var m = {'myKey': 'myVal'};

  // Alternative for m.kontainsKey('myKey'):
  print(m&'myKey'); // prints true.

  // Alternative for !m.containsKey('myKey'):
  print(m^'notExistsKey'); // prints true

  // Alternative for key access operator []:
  print(m/'myKey'); // prints myVal

  // You can't do this, because `[]=` operator is not overrided:
  // m/'newkey'='newVal'; // Syntax error

}
3
likes
120
pub points
0%
popularity

Publisher

unverified uploader

More comfortable syntax for Map type

Homepage

Documentation

API reference

License

unknown (LICENSE)

More

Packages that depend on map_operators