feat: 更新 H5ShellPage 以支持顶部安全区域并优化布局
This commit is contained in:
@@ -549,6 +549,7 @@ class _H5ShellPageState extends State<H5ShellPage> {
|
||||
@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,7 +565,9 @@ class _H5ShellPageState extends State<H5ShellPage> {
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: SafeArea(
|
||||
body: Stack(
|
||||
children: [
|
||||
SafeArea(
|
||||
bottom: false,
|
||||
child: Stack(
|
||||
children: [
|
||||
@@ -575,7 +578,9 @@ class _H5ShellPageState extends State<H5ShellPage> {
|
||||
child: IndexedStack(
|
||||
index: _currentLineIndex,
|
||||
children: [
|
||||
for (var index = 0; index < _lineSlots.length; index += 1)
|
||||
for (var index = 0;
|
||||
index < _lineSlots.length;
|
||||
index += 1)
|
||||
WebViewWidget(
|
||||
key: ValueKey<int>(index),
|
||||
controller: _lineSlots[index].controller,
|
||||
@@ -614,6 +619,15 @@ class _H5ShellPageState extends State<H5ShellPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: topInset,
|
||||
child: const ColoredBox(color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user