From cda23db609e50ffddbad226a7ba24b6a7a8c6ccc Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 14 Oct 2025 22:53:59 +0800 Subject: [PATCH] :bug: Make the background image not responsive for virtual keyboard to provide better visual experience on iOS 26 --- lib/screens/tabs.dart | 1 + lib/widgets/app_scaffold.dart | 34 ++++++++++++++++------------------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/lib/screens/tabs.dart b/lib/screens/tabs.dart index 8b9dd678..d2bf86c2 100644 --- a/lib/screens/tabs.dart +++ b/lib/screens/tabs.dart @@ -126,6 +126,7 @@ class TabsScreen extends HookConsumerWidget { return Scaffold( backgroundColor: Colors.transparent, extendBody: true, + resizeToAvoidBottomInset: false, body: ClipRRect( borderRadius: const BorderRadius.only( topLeft: Radius.circular(16), diff --git a/lib/widgets/app_scaffold.dart b/lib/widgets/app_scaffold.dart index 977cf26c..395cacfa 100644 --- a/lib/widgets/app_scaffold.dart +++ b/lib/widgets/app_scaffold.dart @@ -314,28 +314,22 @@ class AppScaffold extends HookConsumerWidget { final noBackground = isNoBackground ?? isWideScreen(context); - final content = Column( - children: [ - IgnorePointer( - child: SizedBox(height: appBar != null ? appBarHeight + safeTop : 0), - ), - if (body != null) Expanded(child: body!), - ], - ); - - return Focus( + final builtWidget = Focus( focusNode: focusNode, child: Scaffold( extendBody: extendBody ?? true, extendBodyBehindAppBar: true, - backgroundColor: - noBackground - ? Colors.transparent - : Theme.of(context).scaffoldBackgroundColor, - body: - noBackground - ? content - : AppBackground(isRoot: true, child: content), + backgroundColor: Colors.transparent, + body: Column( + children: [ + IgnorePointer( + child: SizedBox( + height: appBar != null ? appBarHeight + safeTop : 0, + ), + ), + if (body != null) Expanded(child: body!), + ], + ), appBar: appBar, bottomNavigationBar: bottomNavigationBar, bottomSheet: bottomSheet, @@ -348,6 +342,10 @@ class AppScaffold extends HookConsumerWidget { onEndDrawerChanged: onEndDrawerChanged, ), ); + + return noBackground + ? builtWidget + : AppBackground(isRoot: true, child: builtWidget); } }