I have created a list of list of String which is a 2D array now I want to upload to firebase database server but do firebase supports 2D array?
List<List<String>> data = [
['5', '2', '2', '7'],
['8', '8', '9', '7'],
['78', '7', '8', '7'],
];
how to upload this array and retrieve back in original form in Flutter?
You can use map property in firebase create a map then inside your map area create a array then put your values to the array
Firestore.instance.collection('your collection').document(some_docID).setData({
'map1': {
'key1': ['value1', 'value3'],
'key2': ['value2', 'value4'],
}});
this medium article shows how to retrieve data.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.