Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
fix: avoid multiple snackbars
Browse files Browse the repository at this point in the history
  • Loading branch information
CCXXXI committed Oct 2, 2021
1 parent 30e6ce5 commit 8bed1d3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/settings/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ ThemeData get theme => ThemeData.from(

// void updateTheme() => Get.changeTheme(theme);
// todo: wait for https://github.com/jonataslaw/getx/issues/1878
void updateTheme() => Get.snackbar(
void updateTheme() {
if (!(Get.isSnackbarOpen ?? false)) {
Get.snackbar(
'主题切换目前有 bug,请手动重启以使更改生效',
'https://github.com/jonataslaw/getx/issues/1878',
duration: const Duration(seconds: 10),
duration: const Duration(days: 42),
);
}
}

0 comments on commit 8bed1d3

Please sign in to comment.