30 lines
732 B
Dart
30 lines
732 B
Dart
class Property {
|
|
late int propertyId;
|
|
late String propertyName;
|
|
late String propertyUnit;
|
|
late String propertyNameTranslation;
|
|
int? top;
|
|
int? left;
|
|
double? value;
|
|
|
|
Property.fromJson(Map json) {
|
|
propertyId = json['propertyId'];
|
|
propertyName = json['propertyName'];
|
|
propertyUnit = json['propertyUnit'];
|
|
propertyNameTranslation =
|
|
json['translations'] != null && (json['translations']).length > 0
|
|
? json['translations'][0]['propertyName']
|
|
: propertyName;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
Map<String, dynamic> json = {
|
|
"propertyId": propertyId,
|
|
"propertyName": propertyName,
|
|
"propertyUnit": propertyUnit
|
|
};
|
|
return json.toString();
|
|
}
|
|
}
|