Added mime field to asset model

This commit is contained in:
Andrew 2023-04-30 18:42:32 +07:00
parent 72e0682c38
commit eedd7a336d
2 changed files with 5 additions and 0 deletions

View file

@ -9,6 +9,7 @@ part 'asset.g.dart';
/// * [name] /// * [name]
/// * [description] /// * [description]
/// * [fid] /// * [fid]
/// * [mime]
/// * [tags] /// * [tags]
@JsonSerializable() @JsonSerializable()
class Asset { class Asset {
@ -16,6 +17,7 @@ class Asset {
final String name; final String name;
final String description; final String description;
final String fid; final String fid;
final String mime;
final String tags; final String tags;
const Asset( const Asset(
@ -23,6 +25,7 @@ class Asset {
required this.name, required this.name,
required this.description, required this.description,
required this.fid, required this.fid,
required this.mime,
required this.tags}); required this.tags});
factory Asset.fromJson(Map<String, dynamic> json) => _$AssetFromJson(json); factory Asset.fromJson(Map<String, dynamic> json) => _$AssetFromJson(json);

View file

@ -11,6 +11,7 @@ Asset _$AssetFromJson(Map<String, dynamic> json) => Asset(
name: json['name'] as String, name: json['name'] as String,
description: json['description'] as String, description: json['description'] as String,
fid: json['fid'] as String, fid: json['fid'] as String,
mime: json['mime'] as String,
tags: json['tags'] as String, tags: json['tags'] as String,
); );
@ -19,5 +20,6 @@ Map<String, dynamic> _$AssetToJson(Asset instance) => <String, dynamic>{
'name': instance.name, 'name': instance.name,
'description': instance.description, 'description': instance.description,
'fid': instance.fid, 'fid': instance.fid,
'mime': instance.mime,
'tags': instance.tags, 'tags': instance.tags,
}; };