66 lines
1.8 KiB
Dart
66 lines
1.8 KiB
Dart
// To parse this JSON data, do
|
|
//
|
|
// final bldgLoc = bldgLocFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
BldgLoc bldgLocFromJson(String str) => BldgLoc.fromJson(json.decode(str));
|
|
|
|
String bldgLocToJson(BldgLoc data) => json.encode(data.toJson());
|
|
|
|
class BldgLoc {
|
|
final int? id;
|
|
final int? bldgapprDetailsId;
|
|
final String? assessedById;
|
|
final String? assessedByName;
|
|
final DateTime? dateCreated;
|
|
final DateTime? dateModified;
|
|
final dynamic street;
|
|
final dynamic barangay;
|
|
final dynamic municipality;
|
|
final dynamic province;
|
|
|
|
BldgLoc({
|
|
this.id,
|
|
this.bldgapprDetailsId,
|
|
this.assessedById,
|
|
this.assessedByName,
|
|
this.dateCreated,
|
|
this.dateModified,
|
|
this.street,
|
|
this.barangay,
|
|
this.municipality,
|
|
this.province,
|
|
});
|
|
|
|
factory BldgLoc.fromJson(Map<String, dynamic> json) => BldgLoc(
|
|
id: json["id"],
|
|
bldgapprDetailsId: json["bldgappr_details_id"],
|
|
assessedById: json["assessed_by_id"],
|
|
assessedByName: json["assessed_by_name"],
|
|
dateCreated: json["date_created"] == null
|
|
? null
|
|
: DateTime.parse(json["date_created"]),
|
|
dateModified: json["date_modified"] == null
|
|
? null
|
|
: DateTime.parse(json["date_modified"]),
|
|
street: json["street"],
|
|
barangay: json["barangay"],
|
|
municipality: json["municipality"],
|
|
province: json["province"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id": id,
|
|
"bldgappr_details_id": bldgapprDetailsId,
|
|
"assessed_by_id": assessedById,
|
|
"assessed_by_name": assessedByName,
|
|
"date_created": dateCreated?.toIso8601String(),
|
|
"date_modified": dateModified?.toIso8601String(),
|
|
"street": street,
|
|
"barangay": barangay,
|
|
"municipality": municipality,
|
|
"province": province,
|
|
};
|
|
}
|