Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tailorvj/7640a4f9b0f157ee28845629d12f0aee to your computer and use it in GitHub Desktop.
Save tailorvj/7640a4f9b0f157ee28845629d12f0aee to your computer and use it in GitHub Desktop.
Dart example: combining 2 Map objects with the spread operator
void main(){
Map map1 = {1: 'one', 2: 'two'};
Map map2 = {3: 'three', 4: 'four'};
Map map3 = {...map1, ...map2};
print('map1: $map1');
print('map2: $map2');
print('map3: $map3');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment