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