An open-source cross-platform alternative to AirDrop
feat: enable edge-to-edge
Tien Do Namddd1728178a1
diff --git a/assets/CHANGELOG.md b/assets/CHANGELOG.mdindex 433e121a..429789c0 100644--- a/assets/CHANGELOG.md+++ b/assets/CHANGELOG.md@@ -2,6 +2,7 @@- feat: allow deleting history entry when file could not be opened (@TheGB0077)- feat: close message request when copied / opened link+- feat(android): enable edge-to-edge mode- fix: clear selection after finished message transfer## 1.8.0 (2023-03-05)diff --git a/lib/init.dart b/lib/init.dartindex 08288e68..093ce767 100644--- a/lib/init.dart+++ b/lib/init.dart@@ -104,7 +104,7 @@ StreamSubscription? _sharedMediaSubscription;/// Will be called when home page has been initializedFuture<void> postInit(BuildContext context, WidgetRef ref, bool appStart, void Function(int) goToPage) async {- updateSystemOverlayStyle(context);+ await updateSystemOverlayStyle(context);final settings = ref.read(settingsProvider);try {@@ -114,7 +114,9 @@ Future<void> postInit(BuildContext context, WidgetRef ref, bool appStart, void Fhttps: settings.https,);} catch (e) {- context.showSnackBar(e.toString());+ if (context.mounted) {+ context.showSnackBar(e.toString());+ }}try {diff --git a/lib/pages/tabs/settings_tab.dart b/lib/pages/tabs/settings_tab.dartindex d0d678ac..2417c46a 100644--- a/lib/pages/tabs/settings_tab.dart+++ b/lib/pages/tabs/settings_tab.dart@@ -74,7 +74,7 @@ class _SettingsTabState extends ConsumerState<SettingsTab> {await ref.read(settingsProvider.notifier).setTheme(theme);await sleepAsync(500); // workaround: brightness takes some time to be updatedif (mounted) {- updateSystemOverlayStyle(context);+ await updateSystemOverlayStyle(context);}}},diff --git a/lib/theme.dart b/lib/theme.dartindex 49c54216..a61d6f8d 100644--- a/lib/theme.dart+++ b/lib/theme.dart@@ -60,13 +60,16 @@ ThemeData getTheme(Brightness brightness) {);}-void updateSystemOverlayStyle(BuildContext context) {+Future<void> updateSystemOverlayStyle(BuildContext context) async {final brightness = Theme.of(context).brightness;final style = SystemUiOverlayStyle(- // statusBarColor: Colors.white, // androidstatusBarIconBrightness: brightness == Brightness.light ? Brightness.dark : Brightness.light, // androidstatusBarBrightness: brightness, // iOS+ systemNavigationBarColor: Colors.transparent,+ statusBarColor: Colors.transparent,);++ await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);SystemChrome.setSystemUIOverlayStyle(style);}