class FileModel { final String description; final int id; final String name; final int range; final bool share; final int size; final String type; final String url; /// Constructs a [FileModel] instance. FileModel({ required this.description, required this.id, required this.name, required this.range, required this.share, required this.size, required this.type, required this.url, }); /// Creates a new [FileModel] instance from a JSON map. factory FileModel.fromJson(Map json) { return FileModel( description: json['description'] ?? '', id: json['id']??0, name: json['name']??"not_exist", range: json['range'] ?? 0, share: json['share'] ?? false, size: json['size'] ?? 0, type: json['type']??"not_exist", url: json['url']??"not_exist", ); } /// Converts the [FileModel] instance to a JSON map. Map toJson() { return { 'description': description, 'id': id, 'name': name, 'range': range, 'share': share, 'size': size, 'type': type, 'url': url, }; } }