cachapa / firedart

A dart-native implementation of the Firebase Auth and Firestore SDKs
https://pub.dev/packages/firedart
Apache License 2.0
174 stars 62 forks source link

Improve type checking #33

Closed cachapa closed 4 years ago

cachapa commented 4 years ago

Turns out we shouldn't be using runtimeType in production: https://stackoverflow.com/questions/7715948/how-to-perform-runtime-type-checking-in-dart#comment59556899_35950312

SaadArdati commented 4 years ago

Heh, I actually fixed this a few hours ago on my end as well. You'll also want to do this: https://github.com/SwissCheese5/Dartbase-Admin-SDK/commit/f25f4159731a0a8ad75602fb1d7339f0515dd2c4

cachapa commented 4 years ago

Uh, this shouldn't even be possible: https://github.com/SwissCheese5/Dartbase-Admin-SDK/blob/f25f4159731a0a8ad75602fb1d7339f0515dd2c4/lib/firestore/firestore_encoding.dart#L48

You're accessing a private field in another class. Weird that it works, but when you tell the type system that in that case value is a DocumentReference suddenly he complains.

Anyway, I made fullpath public because why not. Thanks for the tip!