2023-07-28 02:35:36 +00:00
|
|
|
// 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;
|
2024-03-21 05:47:57 +00:00
|
|
|
final String genCode;
|
2023-07-28 02:35:36 +00:00
|
|
|
|
|
|
|
UnitConstruct({
|
|
|
|
required this.id,
|
|
|
|
required this.bldgType,
|
|
|
|
required this.building,
|
|
|
|
required this.unitValue,
|
2024-03-21 05:47:57 +00:00
|
|
|
required this.genCode,
|
2023-07-28 02:35:36 +00:00
|
|
|
});
|
|
|
|
|
2023-11-10 08:38:47 +00:00
|
|
|
UnitConstruct copy({
|
|
|
|
int? id,
|
|
|
|
String? bldgType,
|
|
|
|
String? building,
|
|
|
|
String? unitValue,
|
2024-03-21 05:47:57 +00:00
|
|
|
String? genCode,
|
2023-11-10 08:38:47 +00:00
|
|
|
}) {
|
|
|
|
return UnitConstruct(
|
2024-03-21 05:47:57 +00:00
|
|
|
id: id ?? this.id,
|
|
|
|
bldgType: bldgType ?? this.bldgType,
|
|
|
|
building: building ?? this.building,
|
|
|
|
unitValue: unitValue ?? this.unitValue,
|
|
|
|
genCode: genCode ?? this.genCode,
|
|
|
|
);
|
2023-11-10 08:38:47 +00:00
|
|
|
}
|
|
|
|
|
2024-07-11 01:27:35 +00:00
|
|
|
UnitConstruct.defaultConstruct()
|
|
|
|
: id = 0,
|
|
|
|
bldgType = 'defaultType',
|
|
|
|
building = 'defaultBuilding',
|
|
|
|
unitValue = '0',
|
|
|
|
genCode = 'defaultGenCode';
|
|
|
|
|
2023-11-10 08:38:47 +00:00
|
|
|
factory UnitConstruct.fromJson2(Map<String, dynamic> json) => UnitConstruct(
|
|
|
|
id: json["id"],
|
|
|
|
bldgType: json["bldgType"],
|
|
|
|
building: json["building"],
|
|
|
|
unitValue: json["unitValue"],
|
2024-03-21 05:47:57 +00:00
|
|
|
genCode: json["gen_code"],
|
2023-11-10 08:38:47 +00:00
|
|
|
);
|
|
|
|
|
2023-07-28 02:35:36 +00:00
|
|
|
factory UnitConstruct.fromJson(Map<String, dynamic> json) => UnitConstruct(
|
|
|
|
id: json["id"],
|
|
|
|
bldgType: json["bldg_type"],
|
|
|
|
building: json["building"],
|
|
|
|
unitValue: json["unit_value"],
|
2024-03-21 05:47:57 +00:00
|
|
|
genCode: json["gen_code"],
|
2023-07-28 02:35:36 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
"id": id,
|
|
|
|
"bldg_type": bldgType,
|
|
|
|
"building": building,
|
|
|
|
"unit_value": unitValue,
|
2024-03-21 05:47:57 +00:00
|
|
|
"gen_code": genCode,
|
2023-07-28 02:35:36 +00:00
|
|
|
};
|
|
|
|
}
|