Home > Enterprise >  How can i Add to list In Dart
How can i Add to list In Dart

Time:10-16

Help me to add to list
my code:

List<Map> = [{'a':1}];

I tried List.add(); but it didnt worked for me

CodePudding user response:

First give a name to list
you can use the below code:

final List<Map> mylist = [{'a':1}];
mylist.add({'b':2});
print(mylist);

try this

  •  Tags:  
  • dart
  • Related