-
Notifications
You must be signed in to change notification settings - Fork 0
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
Kendi J
authored and
Kendi J
committed
Oct 10, 2023
1 parent
baa8e57
commit a666b6f
Showing
34 changed files
with
1,202 additions
and
253 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,28 @@ | ||
PODS: | ||
- Flutter (1.0.0) | ||
- geolocator_apple (1.2.0): | ||
- Flutter | ||
- location (0.0.1): | ||
- Flutter | ||
|
||
DEPENDENCIES: | ||
- Flutter (from `Flutter`) | ||
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`) | ||
- location (from `.symlinks/plugins/location/ios`) | ||
|
||
EXTERNAL SOURCES: | ||
Flutter: | ||
:path: Flutter | ||
geolocator_apple: | ||
:path: ".symlinks/plugins/geolocator_apple/ios" | ||
location: | ||
:path: ".symlinks/plugins/location/ios" | ||
|
||
SPEC CHECKSUMS: | ||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 | ||
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 | ||
location: d5cf8598915965547c3f36761ae9cc4f4e87d22e | ||
|
||
PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189 | ||
|
||
COCOAPODS: 1.12.1 |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
|
||
import 'dart:convert'; | ||
import 'package:http/http.dart' as http; | ||
import 'package:weather_app/domain/model/forecast_responce.dart'; | ||
import 'package:weather_app/domain/model/weather_responce.dart'; | ||
|
||
class WeatherApi { | ||
final String apiKey = '395f5a02af3a3d158ca9d6649c9f2795'; | ||
|
||
Future<WeatherResponse> fetchCurrentWeather(String city) async { | ||
final response = await http.get( | ||
Uri.parse( | ||
'https://api.openweathermap.org/data/2.5/weather?q=$city&appid=$apiKey'), | ||
); | ||
|
||
if (response.statusCode == 200) { | ||
return WeatherResponse.fromJson(json.decode(response.body)); | ||
} else { | ||
throw Exception('Failed to load current weather data'); | ||
} | ||
} | ||
|
||
Future<ForecastResponse> fetchWeatherForecast(String city) async { | ||
final response = await http.get( | ||
Uri.parse( | ||
'https://api.openweathermap.org/data/2.5/forecast?q=$city&appid=$apiKey'), | ||
); | ||
|
||
if (response.statusCode == 200) { | ||
return ForecastResponse.fromJson(json.decode(response.body)); | ||
} else { | ||
throw Exception('Failed to load weather forecast data'); | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.