platform/packages/merge_map/example/main.dart

21 lines
527 B
Dart
Raw Normal View History

import 'package:angel3_merge_map/angel3_merge_map.dart';
void main() {
2021-05-18 13:27:19 +00:00
// ignore: omit_local_variable_types
Map map1 = {'hello': 'world'};
2021-05-18 13:27:19 +00:00
// ignore: omit_local_variable_types
Map map2 = {
'foo': {'bar': 'baz', 'this': 'will be overwritten'}
};
2021-05-18 13:27:19 +00:00
// ignore: omit_local_variable_types
Map map3 = {
'foo': {'john': 'doe', 'this': 'overrides previous maps'}
};
2021-05-18 13:27:19 +00:00
var merged = mergeMap([map1, map2, map3]);
print(merged);
// {hello: world, foo: {bar: baz, john: doe, this: overrides previous maps}}
}