This repository has been archived by the owner on Aug 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed the get current location's weather button
- Loading branch information
PrestoSole
committed
Dec 27, 2020
1 parent
68c0558
commit bc5ab22
Showing
7 changed files
with
84 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity-2.0.2\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-6.1.13\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.12+4\\\\","dependencies":[]}],"android":[{"name":"connectivity","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity-2.0.2\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-6.1.13\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.12+4\\\\","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity_macos-0.1.0+7\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-0.0.1+11\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-0.0.2+4\\\\","dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.4+3\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-0.0.1+3\\\\","dependencies":["path_provider_windows"]}],"web":[{"name":"connectivity_for_web","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity_for_web-0.3.1+4\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-0.1.2+7\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity","dependencies":["connectivity_macos","connectivity_for_web"]},{"name":"connectivity_for_web","dependencies":[]},{"name":"connectivity_macos","dependencies":[]},{"name":"geolocator","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2020-12-18 12:50:02.429605","version":"1.22.5"} | ||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity-2.0.2\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.12+4\\\\","dependencies":[]}],"android":[{"name":"connectivity","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity-2.0.2\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.12+4\\\\","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity_macos-0.1.0+7\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-0.0.1+11\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-0.0.2+4\\\\","dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.4+3\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-0.0.1+3\\\\","dependencies":["path_provider_windows"]}],"web":[{"name":"connectivity_for_web","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity_for_web-0.3.1+4\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"C:\\\\src\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-0.1.2+7\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity","dependencies":["connectivity_macos","connectivity_for_web"]},{"name":"connectivity_for_web","dependencies":[]},{"name":"connectivity_macos","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2020-12-27 16:09:17.342761","version":"1.22.5"} |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
A simple and fast weather app that uses the OpenWeatherMap API. | ||
|
||
* Simple design | ||
* Gives the current location's weather | ||
* Works with any city in the world |
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 |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import 'package:geolocator/geolocator.dart'; | ||
|
||
class LocationServicesTurnedOff implements Exception {} | ||
|
||
class LocationPermissionDenied implements Exception {} | ||
|
||
class Location { | ||
double latitude; | ||
double longitude; | ||
|
||
/// This function is responsible to get the latitude and longitude using the Geolocator package. | ||
Future<void> getCurrentLocation() async { | ||
final bool isLocationServiceEnabled = | ||
await Geolocator.isLocationServiceEnabled(); | ||
final LocationPermission permission = await Geolocator.checkPermission(); | ||
if (isLocationServiceEnabled) { | ||
if (permission == LocationPermission.whileInUse || | ||
permission == LocationPermission.always) { | ||
final Position position = await Geolocator.getCurrentPosition( | ||
desiredAccuracy: LocationAccuracy.low); | ||
|
||
latitude = position.latitude; | ||
longitude = position.longitude; | ||
} else if (permission == LocationPermission.denied) { | ||
await Geolocator.requestPermission(); | ||
final LocationPermission permissionAgain = | ||
await Geolocator.checkPermission(); | ||
if (permissionAgain == LocationPermission.denied || | ||
permissionAgain == LocationPermission.deniedForever) { | ||
throw LocationPermissionDenied(); | ||
} else { | ||
await getCurrentLocation(); | ||
} | ||
} else { | ||
await Geolocator.openAppSettings(); | ||
throw LocationPermissionDenied(); | ||
} | ||
} else { | ||
throw LocationServicesTurnedOff(); | ||
} | ||
} | ||
} | ||
// import 'package:geolocator/geolocator.dart'; | ||
// | ||
// class LocationServicesTurnedOff implements Exception {} | ||
// | ||
// class LocationPermissionDenied implements Exception {} | ||
// | ||
// class Location { | ||
// double latitude; | ||
// double longitude; | ||
// | ||
// /// This function is responsible to get the latitude and longitude using the Geolocator package. | ||
// Future<void> getCurrentLocation() async { | ||
// final bool isLocationServiceEnabled = | ||
// await Geolocator.isLocationServiceEnabled(); | ||
// final LocationPermission permission = await Geolocator.checkPermission(); | ||
// if (isLocationServiceEnabled) { | ||
// if (permission == LocationPermission.whileInUse || | ||
// permission == LocationPermission.always) { | ||
// final Position position = await Geolocator.getCurrentPosition( | ||
// desiredAccuracy: LocationAccuracy.low); | ||
// | ||
// latitude = position.latitude; | ||
// longitude = position.longitude; | ||
// } else if (permission == LocationPermission.denied) { | ||
// await Geolocator.requestPermission(); | ||
// final LocationPermission permissionAgain = | ||
// await Geolocator.checkPermission(); | ||
// if (permissionAgain == LocationPermission.denied || | ||
// permissionAgain == LocationPermission.deniedForever) { | ||
// throw LocationPermissionDenied(); | ||
// } else { | ||
// await getCurrentLocation(); | ||
// } | ||
// } else { | ||
// await Geolocator.openAppSettings(); | ||
// throw LocationPermissionDenied(); | ||
// } | ||
// } else { | ||
// throw LocationServicesTurnedOff(); | ||
// } | ||
// } | ||
// } |
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
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