workouttest_util/lib/model/property.dart
2023-02-19 23:22:36 +01:00

30 lines
730 B
Dart

class Property {
late int propertyId;
late String propertyName;
String? propertyUnit;
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();
}
}