From ae4dc0e9f0e71d90a9b19b0e9aaa9398f99e7e27 Mon Sep 17 00:00:00 2001 From: Suyunmeng Date: Wed, 1 Oct 2025 17:11:06 +0800 Subject: [PATCH 1/5] fix(ui): Replace fixed height padding with SafeArea in web page --- lib/pages/web/web.dart | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/pages/web/web.dart b/lib/pages/web/web.dart index 9d67d4f..4f98a8b 100644 --- a/lib/pages/web/web.dart +++ b/lib/pages/web/web.dart @@ -70,15 +70,16 @@ class WebScreenState extends State { _webViewController?.goBack(); }, child: Scaffold( - body: Column(children: [ - SizedBox(height: MediaQuery.of(context).padding.top), - LinearProgressIndicator( - value: _progress, - backgroundColor: Colors.grey[200], - valueColor: const AlwaysStoppedAnimation(Colors.blue), - ), - Expanded( - child: InAppWebView( + // Use SafeArea to handle small window mode properly + body: SafeArea( + child: Column(children: [ + LinearProgressIndicator( + value: _progress, + backgroundColor: Colors.grey[200], + valueColor: const AlwaysStoppedAnimation(Colors.blue), + ), + Expanded( + child: InAppWebView( initialSettings: settings, initialUrlRequest: URLRequest(url: WebUri(_url)), onWebViewCreated: (InAppWebViewController controller) { @@ -206,6 +207,7 @@ class WebScreenState extends State { ), ), ]), + ), )); } } From 6c8f383c05f24a0fc953d847445d726ce3bb08e4 Mon Sep 17 00:00:00 2001 From: Suyunmeng Date: Wed, 1 Oct 2025 17:11:38 +0800 Subject: [PATCH 2/5] fix(ui): Add SafeArea wrapper to settings page ListView --- lib/pages/settings/settings.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pages/settings/settings.dart b/lib/pages/settings/settings.dart index 750a0d2..278ef9c 100644 --- a/lib/pages/settings/settings.dart +++ b/lib/pages/settings/settings.dart @@ -43,10 +43,11 @@ class _SettingsScreenState extends State { Widget build(BuildContext context) { final controller = Get.put(_SettingsController()); return Scaffold( - body: Obx( + // Use SafeArea to handle small window mode properly + body: SafeArea( + child: Obx( () => ListView( children: [ - // SizedBox(height: MediaQuery.of(context).padding.top), Visibility( visible: !controller._managerStorageGranted.value || !controller._notificationGranted.value || @@ -181,6 +182,7 @@ class _SettingsScreenState extends State { ), ], ), + ), )); } From 5260548fc93ee5f1f25cd9c449186d4ad6e30cf9 Mon Sep 17 00:00:00 2001 From: Suyunmeng Date: Wed, 1 Oct 2025 17:58:59 +0800 Subject: [PATCH 3/5] fix(ui): Remove nested Scaffold in WebScreen to fix small window mode blank screen --- lib/pages/settings/settings.dart | 5 +---- lib/pages/web/web.dart | 24 ++++++++++-------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/lib/pages/settings/settings.dart b/lib/pages/settings/settings.dart index 278ef9c..f0e7660 100644 --- a/lib/pages/settings/settings.dart +++ b/lib/pages/settings/settings.dart @@ -43,9 +43,7 @@ class _SettingsScreenState extends State { Widget build(BuildContext context) { final controller = Get.put(_SettingsController()); return Scaffold( - // Use SafeArea to handle small window mode properly - body: SafeArea( - child: Obx( + body: Obx( () => ListView( children: [ Visibility( @@ -182,7 +180,6 @@ class _SettingsScreenState extends State { ), ], ), - ), )); } diff --git a/lib/pages/web/web.dart b/lib/pages/web/web.dart index 4f98a8b..361f7d7 100644 --- a/lib/pages/web/web.dart +++ b/lib/pages/web/web.dart @@ -69,17 +69,15 @@ class WebScreenState extends State { if (didPop) return; _webViewController?.goBack(); }, - child: Scaffold( - // Use SafeArea to handle small window mode properly - body: SafeArea( - child: Column(children: [ - LinearProgressIndicator( - value: _progress, - backgroundColor: Colors.grey[200], - valueColor: const AlwaysStoppedAnimation(Colors.blue), - ), - Expanded( - child: InAppWebView( + // Remove nested Scaffold to fix small window mode rendering issue + child: Column(children: [ + LinearProgressIndicator( + value: _progress, + backgroundColor: Colors.grey[200], + valueColor: const AlwaysStoppedAnimation(Colors.blue), + ), + Expanded( + child: InAppWebView( initialSettings: settings, initialUrlRequest: URLRequest(url: WebUri(_url)), onWebViewCreated: (InAppWebViewController controller) { @@ -206,8 +204,6 @@ class WebScreenState extends State { }, ), ), - ]), - ), - )); + ])); } } From 51f2ad734d48ce15b8b784434218163038c4eecd Mon Sep 17 00:00:00 2001 From: Suyunmeng Date: Wed, 1 Oct 2025 18:00:42 +0800 Subject: [PATCH 4/5] fix(ui): Restore Scaffold in WebScreen and wrap FadeIndexedStack with SafeArea in MyHomePage --- lib/main.dart | 5 ++++- lib/pages/web/web.dart | 21 +++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 355b4cc..bb6689a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -95,7 +95,9 @@ class MyHomePage extends StatelessWidget { final controller = Get.put(_MainController()); return Scaffold( - body: Obx( + // Wrap body with SafeArea to handle small window mode properly + body: SafeArea( + child: Obx( () => FadeIndexedStack( lazy: true, index: controller.selectedIndex.value, @@ -107,6 +109,7 @@ class MyHomePage extends StatelessWidget { ], ), ), + ), bottomNavigationBar: Obx(() => NavigationBar( destinations: [ NavigationDestination( diff --git a/lib/pages/web/web.dart b/lib/pages/web/web.dart index 361f7d7..5d12291 100644 --- a/lib/pages/web/web.dart +++ b/lib/pages/web/web.dart @@ -69,15 +69,15 @@ class WebScreenState extends State { if (didPop) return; _webViewController?.goBack(); }, - // Remove nested Scaffold to fix small window mode rendering issue - child: Column(children: [ - LinearProgressIndicator( - value: _progress, - backgroundColor: Colors.grey[200], - valueColor: const AlwaysStoppedAnimation(Colors.blue), - ), - Expanded( - child: InAppWebView( + child: Scaffold( + body: Column(children: [ + LinearProgressIndicator( + value: _progress, + backgroundColor: Colors.grey[200], + valueColor: const AlwaysStoppedAnimation(Colors.blue), + ), + Expanded( + child: InAppWebView( initialSettings: settings, initialUrlRequest: URLRequest(url: WebUri(_url)), onWebViewCreated: (InAppWebViewController controller) { @@ -204,6 +204,7 @@ class WebScreenState extends State { }, ), ), - ])); + ]), + )); } } From 47fdd89820a2e681ba7721348e1d47d2b125137b Mon Sep 17 00:00:00 2001 From: Suyunmeng Date: Wed, 1 Oct 2025 18:42:18 +0800 Subject: [PATCH 5/5] fix(ui): Ensure stack fills viewport in compact mode --- lib/main.dart | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index bb6689a..702b505 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -98,18 +98,20 @@ class MyHomePage extends StatelessWidget { // Wrap body with SafeArea to handle small window mode properly body: SafeArea( child: Obx( - () => FadeIndexedStack( - lazy: true, - index: controller.selectedIndex.value, - children: [ - WebScreen(key: webGlobalKey), - const OpenListScreen(), - const DownloadManagerPage(), - const SettingsScreen() - ], + () => SizedBox.expand( + child: FadeIndexedStack( + lazy: true, + index: controller.selectedIndex.value, + children: [ + WebScreen(key: webGlobalKey), + const OpenListScreen(), + const DownloadManagerPage(), + const SettingsScreen() + ], + ), + ), ), ), - ), bottomNavigationBar: Obx(() => NavigationBar( destinations: [ NavigationDestination(