I receive the following NoSuchMethodError in my code:
I/flutter ( 6579): The following NoSuchMethodError was thrown building:
I/flutter ( 6579): Class 'List<DocumentSnapshot>' has no instance method 'call'.
I/flutter ( 6579): Receiver: Instance(length:2) of '_GrowableList'
I/flutter ( 6579): Tried calling: call(0)
This is the error line:
return RepTile(RepData.fromDocument(snapshot.data.documents(index)));
The issue here is that your are using parentheses () to access an element in your List, which tries to invoke call on your object, but since your object is not a function, this throws an error.
However, List uses square brackets [] to access objects at a given index.
This means that it is an easy fix, just replace your parentheses by square brackets:
return RepTile(RepData.fromDocument(snapshot.data.documents[index]));
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