FormMediaValue.fromJson constructor

FormMediaValue.fromJson(
  1. Map<String, Object?> map
)

FormMediaValue from the Json map map.

JsonマップmapからFormMediaValueを作成します。

Implementation

factory FormMediaValue.fromJson(Map<String, Object?> map) {
  final type = map.get(_kTypeKey, "");
  return FormMediaValue(
    type: FormMediaType.values.firstWhereOrNull((e) => e.name == type) ??
        FormMediaType.image,
    uri: Uri.tryParse(map.get(_kPathKey, "")),
  );
}