I´m trying to create value and name array. The problem that i don´t know what is the right way for do this.
var send=[];
send=[
'latitud': widget.lat;
];
Somebody know how can i create array with index and values?
Dart uses Maps for this
to declare a map and you dont know what you will your map contain you can use
Map<String, dynamic> myObject = {'latitude': widget.lat} ;
In your Case you will need a list of objects so you can do it like that :
List<Map<String, dynamic>> send=[] ;
send.add(myObject) ;
Or :
List<Map<String, dynamic>> send=[] ;
send = [{'latitude': widget.lat}]; \\ if you want to assign it directly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With