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
I have a complex object and when reading from Firebase, I started getting this error type 'Null' is not a subtype of type 'Map<dynamic, dynamic>' in type cast
Its quite cryptic, no error line in the object_g.dart file, or the actual propert name. How could I debug this? (without printing each item one by one?)
The text was updated successfully, but these errors were encountered:
I've got a similar issue. I guess it's not really Firebase specific, it's an issue whenever you have nested json objects and deserialisation fails because a non-nullable field is null. Ideally there would be an indication of what field was missing and where in the json structure the missing field was expected.
I suppose this can be somewhat improved by manually wrapping each nested objects fromJson in a try/catch but you still won't know which field was missing and in my case the model classes are generated automatically so adding the try/catch statements is not possible without a change to the model generator.
Hello,
I have a complex object and when reading from Firebase, I started getting this error
type 'Null' is not a subtype of type 'Map<dynamic, dynamic>' in type cast
Its quite cryptic, no error line in the object_g.dart file, or the actual propert name. How could I debug this? (without printing each item one by one?)
The text was updated successfully, but these errors were encountered: