I need some help in flutter and firestore. I have an object inside an array in my collocation Is there any way to update object custom an array?
Asked
Active
Viewed 108 times
0
-
The only way to update an item in array is: 1) to read the document with that array, 2) to update the array in your application code, 3) to write the array field back to the database. See https://stackoverflow.com/questions/59123464/flutter-update-specific-index-in-list-firestore/59123491#59123491 – Frank van Puffelen May 03 '20 at 00:27
1 Answers
0
You can access and update anything inside an array by accessing it like you would any other array:
final List<SomeObject> _someObjects = <SomeObject>[];
...
for SomeObject s in _someObjects)
doSomethingWith(s);

Jesse Lawson
- 715
- 8
- 13
-
thank you I've get the List from document and I make modification list on memory after that send the list to the document this way it's worked with me – Alipop May 03 '20 at 22:41