Line data Source code
1 : import 'package:json_annotation/json_annotation.dart'; 2 : part 'assetmodel.g.dart'; 3 : 4 : /// AssetModel refers to the generic class for asset result 5 : @JsonSerializable(createFactory: true) 6 : class AssetModel { 7 : String uid; 8 : @JsonKey(name: 'created_at') 9 : String createdAt; 10 : @JsonKey(name: 'updated_at') 11 : String updatedAt; 12 : @JsonKey(name: 'created_by') 13 : String createdBy; 14 : @JsonKey(name: 'updated_by') 15 : String updatedBy; 16 : @JsonKey(name: 'content_type') 17 : String contentType; 18 : @JsonKey(name: 'file_size') 19 : String fileSize; 20 : List tags; 21 : String filename; 22 : String url; 23 : @JsonKey(name: '_version') 24 : int version; 25 : String title; 26 : Map<dynamic, dynamic> dimension; 27 : @JsonKey(name: 'publish_details') 28 : Map publishDetails; 29 1 : AssetModel( 30 : this.uid, 31 : this.createdAt, 32 : this.updatedAt, 33 : this.createdBy, 34 : this.updatedBy, 35 : this.contentType, 36 : this.fileSize, 37 : this.tags, 38 : this.filename, 39 : this.url, 40 : this.version, 41 : this.title, 42 : this.dimension, 43 : this.publishDetails); 44 1 : factory AssetModel.fromJson(Map<String, dynamic> json) => 45 1 : _$AssetModelFromJson(json); 46 0 : Map<String, dynamic> toJson() => _$AssetModelToJson(this); 47 : }