Describe the bug
When I retrieve a document from Cloud Firestore, the default order of the snapshot keys is different.
To Reproduce
Steps to reproduce the behavior:
- Create a firestore document which contains maps in the root.
- Retrieve a document snapshot in flutter web and mobile (e.g. android)
- Get a list of the keys from the snapshot data (e.g.
snapshot.data.keys.cast<String>().toList()).
- Generate a list of all maps with the order based on the key list you've retreived earlier.
- See that the order is different depending on behavior.
Expected behavior
I'd expect the default order to the be the same on all platforms.
Additional context
I have created a manual order system which sorts the list of keys based on specific criteria, instead of using the default order directly from Firebase. Just wanted to report this as I discovered it recently and because I would call different behavior for the same commands on different platforms a bug.
Flutter doctor
[√] Flutter (Channel beta, 1.20.2, on Microsoft Windows [Version 10.0.18363.1016], locale en-DE)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] IntelliJ IDEA Ultimate Edition (version 2019.2)
[√] VS Code (version 1.47.3)
[√] Connected device (3 available)
• No issues found!
EDIT : An example for this behavior - https://drive.google.com/file/d/1c2H3chI4uGYAI7QISd9yQvkCZmM1dOMX/view?usp=sharing
Describe the bug
When I retrieve a document from Cloud Firestore, the default order of the snapshot keys is different.
To Reproduce
Steps to reproduce the behavior:
snapshot.data.keys.cast<String>().toList()).Expected behavior
I'd expect the default order to the be the same on all platforms.
Additional context
I have created a manual order system which sorts the list of keys based on specific criteria, instead of using the default order directly from Firebase. Just wanted to report this as I discovered it recently and because I would call different behavior for the same commands on different platforms a bug.
Flutter doctor
EDIT : An example for this behavior - https://drive.google.com/file/d/1c2H3chI4uGYAI7QISd9yQvkCZmM1dOMX/view?usp=sharing