This is a follow-up to this Dart question.
Since Flutter doesn't support reflection and we can't use mirrors, how would you go about debugging, let's say an instance of firebase_database DatabaseReference
?
I'm trying to write tests, and knowing what key/values my reference contains will make it easier for me to write a proper test.
since Dart 3.12 you can use inspect(object)
to achieve this
If you expect to have a built-in easy solution, then sorry : You can't.
BUT you can use plugins to serialize your own code, such as built_value. And print the serialized object.
On the other hand, if you want to print external code (DatabaseReference for instance), you'll have to manually transform that object in a combination of Map, List, and int/String/double.
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