DART
map in dart
void main() {
var details = {'Usrname':'tom','Password':'pass@123'};
details['Uid'] = 'U1oo1';
print(details);
}
Map in dart
void main() {
var details = new Map();
details['Usrname'] = 'admin';
details['Password'] = 'admin@123';
print(details);
}
// Output
// {Usrname: admin, Password: admin@123}
flutter map
import 'package:map_launcher/map_launcher.dart';
if (await MapLauncher.isMapAvailable(MapType.google)) {
await MapLauncher.showMarker(
mapType: MapType.google,
coords: coords,
title: title,
description: description,
);
}
map in dart
void main() {
Map person={'name':'Bijay Poudel',"age":20};
//name and age are key and Bijay and 20 are value
print(person);
}
dart map
void main() {
var details = {'Usrname':'tom','Password':'pass@123'};
details['Uid'] = 'U1oo1';
print(details);
}
dart map
{Usrname: tom, Password: pass@123, Uid: U1oo1}
dart map where
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]
map of a map in flutter
Map someThing = {
"someThing2":{
'key1': 'val1',
'key2': 'val2',
'key3': {},
}
};
// {someThing2: {key1: val1, key2: val2, key3: {}}}
someThing['someThing2']['key3'] = {
'someThing3': {
'key4': 'val4',
},
};
// {someThing2: {key1: val1, key2: val2, key3: {someThing3: {key4: val4}}}}
dart map
void main() {
var details = new Map();
details['Usrname'] = 'admin';
details['Password'] = 'admin@123';
print(details);
}
flutter map
Widget build(BuildContext context) {
return FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
zoom: 13.0,
),
layers: [
TileLayerOptions(
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
subdomains: ['a', 'b', 'c']
),
MarkerLayerOptions(
markers: [
Marker(
width: 80.0,
height: 80.0,
point: LatLng(51.5, -0.09),
builder: (ctx) =>
Container(
child: FlutterLogo(),
),
),
],
),
],
);
}
dart map what is
Dart Map is an object that stores data in the form of a key-value pair.
what is map in dart
void main() {
var details = new Map();
details['Username'] = 'admin';
details['Password'] = 'admin@123';
print(details);
}
dart map values
void main() {
var details = {'Usrname':'tom','Password':'pass@123'};
print(details.values);
}