That's a catchy title to grab your attention. But you don't need to worry no more. The Firebase SDK already allows you to configure the behavior properly on all officially supported platforms. And with this pull request merged, you can now also configure Flutter properly to avoid problems.
Repository
https://github.com/flutter/plugins
New Features
Pull request: https://github.com/flutter/plugins/pull/765
Adding complete support for all Firestore settings. The need originated from the upcoming change of snapshot timestamps that are announced if timestampsInSnapshotsEnabled isn't set to true.
Firebase has already announced the change of datatype for the Firestore timestamp, which will likely be a source of error if not configured properly for applications that are using Cloud Firestore.
This is fixing the warnings that are announced when using the Cloud Firestore without the proper settings. As displayed below.
W/Firestore( 9705): (0.6.6-dev) [Firestore]: The behavior for java.util.Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK.
W/Firestore( 9705): To hide this warning and ensure your app does not break, you need to add the following code to your app before calling any other Cloud Firestore methods:
W/Firestore( 9705):
W/Firestore( 9705): FirebaseFirestore firestore = FirebaseFirestore.getInstance();
W/Firestore( 9705): FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder()
W/Firestore( 9705): .setTimestampsInSnapshotsEnabled(true)
W/Firestore( 9705): .build();
W/Firestore( 9705): firestore.setFirestoreSettings(settings);
W/Firestore( 9705):
W/Firestore( 9705): With this change, timestamps stored in Cloud Firestore will be read back as com.google.firebase.Timestamp objects instead of as system java.util.Date objects. So you will also need to update code expecting a java.util.Date to instead expect a Timestamp. For example:
W/Firestore( 9705):
W/Firestore( 9705): // Old:
W/Firestore( 9705): java.util.Date date = snapshot.getDate("created_at");
W/Firestore( 9705): // New:
W/Firestore( 9705): Timestamp timestamp = snapshot.getTimestamp("created_at");
W/Firestore( 9705): java.util.Date date = timestamp.toDate();
W/Firestore( 9705):
W/Firestore( 9705): Please audit all existing usages of java.util.Date when you enable the new behavior. In a future release, the behavior will be changed to the new behavior, so if you do not follow these steps, YOUR APP MAY BREAK.
The Firestore timestamps will provide a with a much higher accuracy of time, down to nanoseconds since the regular date objects with millisecond precision causes a truncation that can lead to problems in subsequent queries where the nano-second accuracy differs.