map_history 1.0.3 copy "map_history: ^1.0.3" to clipboard
map_history: ^1.0.3 copied to clipboard

A Map implementation with history and rollback support for entries, keys and values.

example/map_history_example.dart

import 'package:map_history/map_history.dart';

void main() {
  var m = MapHistory<int, String>();

  m[1] = 'a';
  m[2] = 'b';
  m[3] = 'c';

  var ver3 = m.version;

  print('Version: $ver3 >> $m');

  m[2] = 'B';
  m.remove(3);

  var ver5 = m.version;
  print('Version: $ver5 >> $m');

  print('Rollback to version: $ver3');
  m.rollback(ver3);

  print('Version: ${m.version} >> $m');
}

/////////////////////////////
// OUTPUT:
/////////////////////////////
// Version: 3 >> {1: a, 2: b, 3: c}
// Version: 5 >> {1: a, 2: B}
// Rollback to version: 3
// Version: 3 >> {1: a, 2: b, 3: c}
4
likes
140
pub points
52%
popularity

Publisher

unverified uploader

A Map implementation with history and rollback support for entries, keys and values.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

collection, dependency_validator

More

Packages that depend on map_history