Closed usman092 closed 5 months ago
I have a model with a Timestamp field.
@firestoreSerializable class Model { final Timestamp time; Model({required this.time}); factory Model.fromJson(Map<String, Object?> json) => _$ModelFromJson(json); Map<String, Object?> toJson() => _$ModelToJson(this); Future<Model> put() async { return await modelsRef.doc('someId').set(this); }
I am setting the field value using Timestamp.fromDate(DateTime.parse('2016-02-11')) However, when I call the put method I get the following exception
Timestamp.fromDate(DateTime.parse('2016-02-11'))
FormatException: Invalid date format 2016-2-11
Exception should not occur.
Model should be successfully saved to firestore.
I have a model with a Timestamp field.
I am setting the field value using
Timestamp.fromDate(DateTime.parse('2016-02-11'))
However, when I call the put method I get the following exceptionExpected Behavior
Exception should not occur.
Actual Behavior
Model should be successfully saved to firestore.
Steps to Reproduce the Problem
Specifications