“Dart init map” Code-Antworten

Dart init map

var m2 = <String, Map<int, List<String>>>{}; // empty map
m2['otherKey'] = <int, List<String>>{}; // add an empty map at the top level
m2['otherKey'][2] = <String>[]; // and an empty list to that map
m2['otherKey'][2].add('baz'); // and a value to that list
print(m2);
MrNtlu

Karte in Dart

void main() { 
   var details = new Map(); 
   details['Usrname'] = 'admin'; 
   details['Password'] = 'admin@123'; 
   print(details); 
} 

// Output
// {Usrname: admin, Password: admin@123}
Impossible Iguana

Ähnliche Antworten wie “Dart init map”

Fragen ähnlich wie “Dart init map”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen