0

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?

user2868835
  • 1,250
  • 3
  • 19
  • 33

1 Answers1

1

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()
maxmitz
  • 258
  • 1
  • 4
  • 17