45 lines
930 B
Dart
45 lines
930 B
Dart
|
|
||
|
class Citizenship {
|
||
|
Citizenship({
|
||
|
required this.country,
|
||
|
required this.naturalBorn,
|
||
|
});
|
||
|
|
||
|
final Country? country;
|
||
|
final bool? naturalBorn;
|
||
|
|
||
|
factory Citizenship.fromJson(Map<String, dynamic> json) => Citizenship(
|
||
|
country: Country.fromJson(json["country"]),
|
||
|
naturalBorn: json["natural_born"],
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> toJson() => {
|
||
|
"country": country!.toJson(),
|
||
|
"natural_born": naturalBorn,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
class Country {
|
||
|
Country({
|
||
|
required this.id,
|
||
|
required this.code,
|
||
|
required this.name,
|
||
|
});
|
||
|
|
||
|
final int? id;
|
||
|
final String? code;
|
||
|
final String? name;
|
||
|
|
||
|
factory Country.fromJson(Map<String, dynamic> json) => Country(
|
||
|
id: json["id"],
|
||
|
code: json["code"],
|
||
|
name: json["name"],
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> toJson() => {
|
||
|
"id": id,
|
||
|
"code": code,
|
||
|
"name": name,
|
||
|
};
|
||
|
}
|