0

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?

xilpex
  • 3,097
  • 2
  • 14
  • 45
Alipop
  • 33
  • 8
  • 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 Answers1

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