FormMediaValue constructor

FormMediaValue({
  1. FormMediaType type = FormMediaType.image,
  2. String? path,
})

Class for values when handling media in forms.

Specify the media type in type with FormMediaType. Specify the actual path in path.

Since mutual conversion to Json is possible with FormMediaValue.fromJson or toJson, the data can be saved as is.

フォームでメディアを取り扱うときの値用のクラス。

typeにメディアのタイプをFormMediaTypeで指定します。pathに実際のパスを指定します。

FormMediaValue.fromJsontoJsonでJsonに相互変換が可能なので、このままデータとして保存することができます。

Implementation

factory FormMediaValue({
  FormMediaType type = FormMediaType.image,
  String? path,
}) {
  return _FormMediaValue(
    type: type,
    path: path,
  );
}