I can't find any data type reference guide that explains how Flutter (Dart) 'DateTime' and 'enum' data types should be represented in the Map structure passed to a FlutterFire FireStore add/update document call.
Any suggestions?
I can't find any data type reference guide that explains how Flutter (Dart) 'DateTime' and 'enum' data types should be represented in the Map structure passed to a FlutterFire FireStore add/update document call.
Any suggestions?
Here is an answer to another question about enums:
Flutter is able to generate JSON serialization code. It references the package json_annotation. It contains also support for enum serialization. So all you need is to use this tool and annotate your enum values with @JsonValue.
From the code docs:
An annotation is used to specify how an enum value is serialized.
For time objects the answer is from here:
Use
FieldValue.serverTimestamp()