You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error thrown is NoSuchMethodError: The method 'add' was called on null. Receiver: null Tried calling: add(Instance of 'QuerySnapshot'):
I don't know why the error is happening, but I have traced down the reason. I'm assuming that my device never deregisters as an observer before it's hot restarted and it contributes to the issue. The attached video can explain the issue better than I can. Please ask for clarification as I'm unable to duplicate it since I don't understand it fully enough. Video
In cloud_firestore-0.9.7/lib/src/firestore.dart
class Firestore {
Firestore({FirebaseApp app}) : app = app ?? FirebaseApp.instance {
if (_initialized) return;
channel.setMethodCallHandler((MethodCall call) async {
if (call.method == 'QuerySnapshot') {
final QuerySnapshot snapshot = QuerySnapshot._(call.arguments, this);
// THIS IS WHERE THE ERROR OCCURS👇🏾
_queryObservers[call.arguments['handle']].add(snapshot);
} else if (call.method == 'DocumentSnapshot') {
final DocumentSnapshot snapshot = DocumentSnapshot._(
call.arguments['path'],
_asStringKeyedMap(call.arguments['data']),
this,
);
Variables:
call.arguments['handle'] -> 7
_queryObservers (I just realized that this list starts at a higher number after I hot restart). This must be the cause.
The text was updated successfully, but these errors were encountered:
Sorry, this was some time ago, my version has changed since then.
iapicca
changed the title
Flutter throws NoSuchMethod error when hot restarting (Please read description)
[firebase_messaging] Flutter throws NoSuchMethod error when hot restarting (Please read description)
Oct 23, 2019
Hi @ThinkDigitalSoftware
given your last message I feel safe to close this issue,
if you disagree please write in the comments
and I will reopen it.
Thank you #125
Error thrown is
NoSuchMethodError: The method 'add' was called on null. Receiver: null Tried calling: add(Instance of 'QuerySnapshot')
:I don't know why the error is happening, but I have traced down the reason. I'm assuming that my device never deregisters as an observer before it's hot restarted and it contributes to the issue. The attached video can explain the issue better than I can. Please ask for clarification as I'm unable to duplicate it since I don't understand it fully enough.
Video
In cloud_firestore-0.9.7/lib/src/firestore.dart
Variables:
call.arguments['handle'] -> 7
_queryObservers (I just realized that this list starts at a higher number after I hot restart). This must be the cause.

The text was updated successfully, but these errors were encountered: