Document.fromJson constructor

Document.fromJson(
  1. Object? j
)

Implementation

factory Document.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Document(
    type: switch (json['type']) {
      null => Document_Type.$default,
      Object $1 => Document_Type.fromJson($1),
    },
    content: switch (json['content']) {
      null => null,
      Object $1 => decodeString($1),
    },
    gcsContentUri: switch (json['gcsContentUri']) {
      null => null,
      Object $1 => decodeString($1),
    },
    languageCode: switch (json['languageCode']) {
      null => '',
      Object $1 => decodeString($1),
    },
  );
}