import 'package:inventory_app/utils.dart'; class Depot { int? id; String? name; MetaFile? picture; Depot({this.id, this.name, this.picture}); Depot.fromJson(Map json) { id = json['id']; name = json['name']; picture = json['picture'] != null ? MetaFile.fromJson(json['picture']) : null; } Map toJson() { final Map data = {}; data['id'] = this.id; data['name'] = this.name; if (picture != null) { data['picture'] = picture!.toJson(); } return data; } /// 👇 Get full image URL (you can customize baseUrl to be from `AxelorClient.baseUrl`) String? get imageUrl { if (picture?.id != null) { return '${Utils.url}/ws/rest/com.axelor.meta.db.MetaFile/${picture!.id}/content/download'; } return null; } @override bool operator ==(Object other) => identical(this, other) || other is Depot && runtimeType == other.runtimeType && id == other.id; @override int get hashCode => id.hashCode; } class Company { String? code; String? name; int? id; int? version; Company({this.code, this.name, this.id, this.version}); Company.fromJson(Map json) { code = json['code']; name = json['name']; id = json['id']; version = json['$version']; } Map toJson() { final Map data = new Map(); data['code'] = this.code; data['name'] = this.name; data['id'] = this.id; data['$version'] = this.version; return data; } } class UpdatedBy { String? code; String? fullName; int? id; int? version; UpdatedBy({this.code, this.fullName, this.id, this.version}); UpdatedBy.fromJson(Map json) { code = json['code']; fullName = json['fullName']; id = json['id']; version = json['$version']; } Map toJson() { final Map data = new Map(); data['code'] = this.code; data['fullName'] = this.fullName; data['id'] = this.id; data['$version'] = this.version; return data; } } class MetaFile { String? fileName; int? id; int? version; MetaFile({this.fileName, this.id, this.version}); MetaFile.fromJson(Map json) { fileName = json['fileName']; id = json['id']; version = json['$version']; } Map toJson() { return {'fileName': fileName, 'id': id, '\$version': version}; } }