void main() {
var details = {'Usrname':'tom','Password':'pass@123'};
details['Uid'] = 'U1oo1';
print(details);
}
void main() {
var details = new Map();
details['Usrname'] = 'admin';
details['Password'] = 'admin@123';
print(details);
}
// Output
// {Usrname: admin, Password: admin@123}
void main() {
Map person={'name':'Bijay Poudel',"age":20};
//name and age are key and Bijay and 20 are value
print(person);
}
void main() {
var details = {'Usrname':'tom','Password':'pass@123'};
details['Uid'] = 'U1oo1';
print(details);
}
{Usrname: tom, Password: pass@123, Uid: U1oo1}
import 'package:collection/collection.dart';
...
Map<int, String> a = {1: "a", 2: "b", 3: "c", 4: "d", 5: "e", 6: "f"};
final b = Map.fromEntries(
a.entries.map((entry) =>
entry.key % 2 == 0 ? MapEntry(entry.key * 10, entry.value) : null)
.whereNotNull()
);
print(b.keys.toList()); // prints [20, 40, 60]
void main() {
var details = new Map();
details['Usrname'] = 'admin';
details['Password'] = 'admin@123';
print(details);
}
Dart Map is an object that stores data in the form of a key-value pair.
void main() {
var details = new Map();
details['Username'] = 'admin';
details['Password'] = 'admin@123';
print(details);
}
void main() {
var details = {'Usrname':'tom','Password':'pass@123'};
print(details.values);
}