workouttest_app/lib/model/property.dart
Tibor Bossanyi (Freelancer) 3b96d81a85 WT 1.26
2022-04-09 11:22:34 +02:00

29 lines
745 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) {
this.propertyId = json['propertyId'];
this.propertyName = json['propertyName'];
this.propertyUnit = json['propertyUnit'];
this.propertyNameTranslation =
json['translations'] != null && (json['translations']).length > 0
? json['translations'][0]['propertyName']
: this.propertyName;
}
String toString() {
Map<String, dynamic> json = {
"propertyId": propertyId,
"propertyName": propertyName,
"propertyUnit": propertyUnit
};
return json.toString();
}
}