Skip to content

Commit

Permalink
fixed a major bug where screen would be fully white
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaroti9 committed Feb 12, 2024
1 parent 432ecfd commit 5bfa5bb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode 24
versionName "2.2.3"
versionCode 26
versionName "2.2.5"
}

buildTypes {
Expand Down
20 changes: 10 additions & 10 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ class _MyAppState extends State<MyApp> {
updateLocation: updateLocation,
icon: const Icon(Icons.gps_off, color: WHITE, size: 30,),
place: backupName,
settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor];
settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor];
}
} on LocationServiceDisabledException {
return [dumbySearch(errorMessage: translation("location services are disabled.", settings[0]),
updateLocation: updateLocation,
icon: const Icon(Icons.gps_off, color: WHITE, size: 30,),
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor];
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor];
}

backupName = '${position.latitude},${position.longitude}';
Expand All @@ -123,7 +123,7 @@ class _MyAppState extends State<MyApp> {
return [dumbySearch(errorMessage: translation(loc_status, settings[0]),
updateLocation: updateLocation,
icon: const Icon(Icons.gps_off, color: WHITE, size: 30,),
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor];
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor];
}
}
if (proposedLoc == 'search') {
Expand All @@ -137,7 +137,7 @@ class _MyAppState extends State<MyApp> {
errorMessage: '${translation('Place not found', settings[0])}: $backupName',
updateLocation: updateLocation,
icon: const Icon(Icons.location_disabled, color: WHITE, size: 30,),
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor];
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor];
}
}

Expand All @@ -155,22 +155,22 @@ class _MyAppState extends State<MyApp> {
return [dumbySearch(errorMessage: translation("Weak or no wifi connection", settings[0]),
updateLocation: updateLocation,
icon: const Icon(Icons.wifi_off, color: WHITE, size: 30,),
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor];
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor];
} on HttpExceptionWithStatus catch (hihi){
print(hihi.toString());
return [dumbySearch(errorMessage: "general error at place 1: ${hihi.toString()}", updateLocation: updateLocation,
icon: const Icon(Icons.bug_report, color: WHITE, size: 30,),
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor];
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor];
} on SocketException {
return [dumbySearch(errorMessage: translation("Not connected to the internet", settings[0]),
updateLocation: updateLocation,
icon: const Icon(Icons.wifi_off, color: WHITE, size: 30,),
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor];
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor];
} on Error catch (e, stacktrace) {
print(stacktrace);
return [dumbySearch(errorMessage: "general error at place 2: $e", updateLocation: updateLocation,
icon: const Icon(Icons.wifi_off, color: WHITE, size: 30,),
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor];
place: backupName, settings: settings, provider: weather_provider, latlng: absoluteProposed,), instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor];
}

await setLastPlace(backupName, absoluteProposed); // if the code didn't fail
Expand All @@ -191,7 +191,7 @@ class _MyAppState extends State<MyApp> {
if (recall) {
return [dumbySearch(errorMessage: "general error at place X: $e", updateLocation: updateLocation,
icon: const Icon(Icons.bug_report, color: WHITE, size: 30,),
place: backupName, settings: settings, provider: weather_provider, latlng: 'search',), instantBackColor];
place: backupName, settings: settings, provider: weather_provider, latlng: 'search',), instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor];
}
else {
return getDays(true);
Expand Down Expand Up @@ -220,7 +220,7 @@ class _MyAppState extends State<MyApp> {
color: instantBackColor,
child: Center(
child: LoadingAnimationWidget.staggeredDotsWave(
color: WHITE,
color: instantBackColor == WHITE ? const Color(0xff7a9dbc) : WHITE,
size: 40,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/search_screens.dart
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class dumbySearch extends StatelessWidget {
required this.updateLocation, required this.icon, required this.place,
required this.settings, required this.provider, required this.latlng});

final Color color = instantBackColor;
final Color color = instantBackColor == WHITE ? const Color(0xff7a9dbc) : instantBackColor;

final FloatingSearchBarController controller = FloatingSearchBarController();

Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ packages:
dependency: transitive
description:
name: image
sha256: "49a0d4b0c12402853d3f227fe7c315601b238d126aa4caa5dbb2dcf99421aa4a"
sha256: "4c68bfd5ae83e700b5204c1e74451e7bf3cf750e6843c6e158289cf56bda018e"
url: "https://pub.dev"
source: hosted
version: "4.1.6"
version: "4.1.7"
intl:
dependency: transitive
description:
Expand Down

0 comments on commit 5bfa5bb

Please sign in to comment.