2

I am getting this error when i will try to get data from firebase without adding any date. Only Want to Show Data Likes "Books" and "Author". Has anyone idea how to resolve that?

I am using this this dependencies: cloud_firestore: ^0.9.0

I try to experience Firebase Live database with flutter. I just would like to get a value in the datasnapshot of the firebase response.

W/Firestore(23489): FirebaseFirestore firestore = 
FirebaseFirestore.getInstance();
W/Firestore(23489): FirebaseFirestoreSettings settings = new 
FirebaseFirestoreSettings.Builder()
W/Firestore(23489):     .setTimestampsInSnapshotsEnabled(true)
W/Firestore(23489):     .build();
W/Firestore(23489): firestore.setFirestoreSettings(settings);
W/Firestore(23489):
W/Firestore(23489): 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(23489):
W/Firestore(23489): // Old:
W/Firestore(23489): java.util.Date date = snapshot.getDate("created_at");
W/Firestore(23489): // New:
W/Firestore(23489): Timestamp timestamp = 
          snapshot.getTimestamp("created_at");
W/Firestore(23489): java.util.Date date = timestamp.toDate();
W/Firestore(23489):
W/Firestore(23489): 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. (edited) 
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

0 Answers0