-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07e4d22
commit e2b69d5
Showing
6 changed files
with
193 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class CityApi { | ||
CityApi({ | ||
required this.results, | ||
}); | ||
|
||
List<Result> results; | ||
|
||
factory CityApi.fromJson(Map<String, dynamic> json) => CityApi( | ||
results: | ||
List<Result>.from(json["results"].map((x) => Result.fromJson(x))), | ||
); | ||
} | ||
|
||
class Result { | ||
Result({ | ||
this.country, | ||
this.state, | ||
this.city, | ||
required this.lon, | ||
required this.lat, | ||
}); | ||
|
||
String? country; | ||
String? state; | ||
String? city; | ||
double lon; | ||
double lat; | ||
|
||
factory Result.fromJson(Map<String, dynamic> json) => Result( | ||
country: json["country"], | ||
state: json["state"], | ||
city: json["city"], | ||
lon: json["lon"], | ||
lat: json["lat"], | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.