39 lines
931 B
Dart
39 lines
931 B
Dart
// To parse this JSON data, do
|
|
//
|
|
// final unitConstruct = unitConstructFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
UnitConstruct unitConstructFromJson(String str) =>
|
|
UnitConstruct.fromJson(json.decode(str));
|
|
|
|
String unitConstructToJson(UnitConstruct data) => json.encode(data.toJson());
|
|
|
|
class UnitConstruct {
|
|
final int id;
|
|
final String bldgType;
|
|
final String building;
|
|
final String unitValue;
|
|
|
|
UnitConstruct({
|
|
required this.id,
|
|
required this.bldgType,
|
|
required this.building,
|
|
required this.unitValue,
|
|
});
|
|
|
|
factory UnitConstruct.fromJson(Map<String, dynamic> json) => UnitConstruct(
|
|
id: json["id"],
|
|
bldgType: json["bldg_type"],
|
|
building: json["building"],
|
|
unitValue: json["unit_value"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id": id,
|
|
"bldg_type": bldgType,
|
|
"building": building,
|
|
"unit_value": unitValue,
|
|
};
|
|
}
|