toModelImageUri method
Convert to ModelImageUri.
If path
is empty, null is returned.
Returns an error if the original FormMediaType is not FormMediaType.image.
ModelImageUriに変換します。
path
が空の場合はnullを返します。
元のFormMediaTypeがFormMediaType.imageでない場合はエラーを返します。
Implementation
ModelImageUri? toModelImageUri() {
if (uri.isEmpty) {
return null;
}
if (type != FormMediaType.image) {
throw Exception("The original FormMediaType is not FormMediaType.image");
}
return ModelImageUri(uri);
}