From 3f71ba0e235c94d857dab0112cb377a5ad28929b Mon Sep 17 00:00:00 2001 From: Booker Date: Wed, 27 May 2026 14:33:26 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20H5ShellPage=20?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E9=A1=B6=E9=83=A8=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=B9=B6=E4=BC=98=E5=8C=96=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 106 ++++++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 46 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index bbcf94d..f5df625 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -549,6 +549,7 @@ class _H5ShellPageState extends State { @override Widget build(BuildContext context) { final currentSlot = _currentSlot; + final topInset = MediaQuery.paddingOf(context).top; final bottomInset = MediaQuery.viewInsetsOf(context).bottom; final showLineSwitch = !currentSlot.showShellCover && currentSlot.loadError == null && @@ -564,55 +565,68 @@ class _H5ShellPageState extends State { }, child: Scaffold( backgroundColor: Colors.white, - body: SafeArea( - bottom: false, - child: Stack( - children: [ - Positioned.fill( - child: _ShellFallback(progress: currentSlot.progress), - ), - Positioned.fill( - child: IndexedStack( - index: _currentLineIndex, - children: [ - for (var index = 0; index < _lineSlots.length; index += 1) - WebViewWidget( - key: ValueKey(index), - controller: _lineSlots[index].controller, - ), - ], - ), - ), - if (currentSlot.showShellCover) - Positioned.fill( - child: IgnorePointer( + body: Stack( + children: [ + SafeArea( + bottom: false, + child: Stack( + children: [ + Positioned.fill( child: _ShellFallback(progress: currentSlot.progress), ), - ), - if (!currentSlot.showShellCover && currentSlot.progress < 100) - LinearProgressIndicator( - value: currentSlot.progress == 0 - ? null - : currentSlot.progress / 100, - minHeight: 2, - ), - if (currentSlot.loadError != null) - _ErrorPanel( - message: currentSlot.loadError!, - onRetry: () => unawaited(_reloadCurrentLine()), - ), - if (showLineSwitch) - Positioned( - left: 20, - right: 20, - bottom: MediaQuery.paddingOf(context).bottom + 14, - child: _LineSwitchBar( - currentLine: _currentLine, - onSwitch: _showLineSwitcher, + Positioned.fill( + child: IndexedStack( + index: _currentLineIndex, + children: [ + for (var index = 0; + index < _lineSlots.length; + index += 1) + WebViewWidget( + key: ValueKey(index), + controller: _lineSlots[index].controller, + ), + ], + ), ), - ), - ], - ), + if (currentSlot.showShellCover) + Positioned.fill( + child: IgnorePointer( + child: _ShellFallback(progress: currentSlot.progress), + ), + ), + if (!currentSlot.showShellCover && currentSlot.progress < 100) + LinearProgressIndicator( + value: currentSlot.progress == 0 + ? null + : currentSlot.progress / 100, + minHeight: 2, + ), + if (currentSlot.loadError != null) + _ErrorPanel( + message: currentSlot.loadError!, + onRetry: () => unawaited(_reloadCurrentLine()), + ), + if (showLineSwitch) + Positioned( + left: 20, + right: 20, + bottom: MediaQuery.paddingOf(context).bottom + 14, + child: _LineSwitchBar( + currentLine: _currentLine, + onSwitch: _showLineSwitcher, + ), + ), + ], + ), + ), + Positioned( + top: 0, + left: 0, + right: 0, + height: topInset, + child: const ColoredBox(color: Colors.white), + ), + ], ), ), );