FileAsset.fromJson constructor

FileAsset.fromJson(
  1. Map<String, dynamic> json
)

Creates a new FileAsset from a JSON representation.

The json parameter must contain 'id', 'shortUri', and 'uri' keys.

Returns a new FileAsset instance.

Implementation

factory FileAsset.fromJson(Map<String, dynamic> json) {
  return FileAsset(
    file: File.fromUri(Uri.parse(json['uri'] as String)),
    shortUri: Uri.parse(json['shortUri'] as String),
    id: json['id'] as String,
  );
}