Reputation: 411
Ideally I'm looking for something like :
typedef Json = Map<String, dynamic>;
From what I understand, this language feature is under review typedef for simple type aliases with ETA Q1'19
But for a immediate alternative, what would be the simplest way to "extend" a Map in Dart ? All the solutions I could find are quite old and look overkill. At the end I just want an alias for my Map.
Thanks in advance.
Upvotes: 6
Views: 2149
Reputation: 2729
Dart 2.13
analyzer:
enable-experiment:
- nonfunction-type-aliases
flutter run --enable-experiment=nonfunction-type-aliases
Upvotes: 1