passo_mobile_app/lib/model/passo/barangay.dart

70 lines
1.9 KiB
Dart

// To parse this JSON data, do
//
// final barangay = barangayFromJson(jsonString);
import 'dart:convert';
Brgy barangayFromJson(String str) => Brgy.fromJson(json.decode(str));
String barangayToJson(Brgy data) => json.encode(data.toJson());
class Brgy {
final int? id;
final int? barangayId;
final String? barangayCode;
final String? cityCode;
final String? barangayDescription;
final String? genCode;
Brgy(
{this.id,
this.barangayId,
this.barangayCode,
this.cityCode,
this.barangayDescription,
this.genCode});
Brgy copy(
{int? id,
int? barangayId,
String? barangayCode,
String? cityCode,
String? barangayDescription,
String? genCode}) {
return Brgy(
id: id ?? this.id,
barangayId: barangayId ?? this.barangayId,
barangayCode: barangayCode ?? this.barangayCode,
cityCode: cityCode ?? this.cityCode,
barangayDescription: barangayDescription ?? this.barangayDescription,
genCode: genCode ?? this.genCode);
}
factory Brgy.fromJson(Map<String, dynamic> json) => Brgy(
id: json["id"],
barangayId: json["barangay_id"],
barangayCode: json["barangay_code"],
cityCode: json["city_code"],
barangayDescription: json["barangay_description"],
genCode: json["gen_code"],
);
factory Brgy.fromJson2(Map<String, dynamic> json) => Brgy(
id: json["id"],
barangayId: json["barangayId"],
barangayCode: json["barangayCode"],
cityCode: json["cityCode"],
barangayDescription: json["barangayDescription"],
genCode: json["gen_code"],
);
Map<String, dynamic> toJson() => {
"id": id,
"barangay_id": barangayId,
"barangay_code": barangayCode,
"city_code": cityCode,
"barangay_description": barangayDescription,
"gen_code": genCode,
};
}