From 3e7007f58f6fdb1aa9a540bc4a3c14efbd78a135 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 7 Jan 2026 01:52:25 +0800 Subject: [PATCH] :bug: Trying to fix app scaffold focus conflict --- lib/widgets/app_scaffold.dart | 52 ++++++++++++++--------------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/lib/widgets/app_scaffold.dart b/lib/widgets/app_scaffold.dart index 0f7f371c..7fe03c23 100644 --- a/lib/widgets/app_scaffold.dart +++ b/lib/widgets/app_scaffold.dart @@ -357,44 +357,34 @@ class AppScaffold extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final focusNode = useFocusNode(); - - useEffect(() { - focusNode.requestFocus(); - return null; - }, []); - final appBarHeight = appBar?.preferredSize.height ?? 0; final safeTop = MediaQuery.of(context).padding.top; final noBackground = isNoBackground ?? isWideScreen(context); - final builtWidget = Focus( - focusNode: focusNode, - child: Scaffold( - extendBody: extendBody ?? true, - extendBodyBehindAppBar: true, - backgroundColor: Colors.transparent, - body: Column( - children: [ - IgnorePointer( - child: SizedBox( - height: appBar != null ? appBarHeight + safeTop : 0, - ), + final builtWidget = Scaffold( + extendBody: extendBody ?? true, + extendBodyBehindAppBar: true, + 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, - drawer: drawer, - endDrawer: endDrawer, - floatingActionButton: floatingActionButton, - floatingActionButtonAnimator: floatingActionButtonAnimator, - onDrawerChanged: onDrawerChanged, - onEndDrawerChanged: onEndDrawerChanged, + ), + if (body != null) Expanded(child: body!), + ], ), + appBar: appBar, + bottomNavigationBar: bottomNavigationBar, + bottomSheet: bottomSheet, + drawer: drawer, + endDrawer: endDrawer, + floatingActionButton: floatingActionButton, + floatingActionButtonAnimator: floatingActionButtonAnimator, + onDrawerChanged: onDrawerChanged, + onEndDrawerChanged: onEndDrawerChanged, ); return noBackground