Commit f2e05aed by tanghuan

SafeArea设置

1 parent 264872f7
...@@ -57,10 +57,7 @@ class WebPage extends StatelessWidget { ...@@ -57,10 +57,7 @@ class WebPage extends StatelessWidget {
body: Stack( body: Stack(
children: [ children: [
state.loaded state.loaded
? SizedBox( ? WebViewWidget(controller: ctx.read<WebCubit>().controller)
height: MediaQuery.of(ctx).size.height - 60, // 减去100像素留空
child: WebViewWidget(controller: ctx.read<WebCubit>().controller),
)
: const Center( : const Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
...@@ -123,7 +120,8 @@ class WebPage extends StatelessWidget { ...@@ -123,7 +120,8 @@ class WebPage extends StatelessWidget {
// ios 不使用 PopScope // ios 不使用 PopScope
if (Platform.isIOS) { if (Platform.isIOS) {
return scaffold; //return scaffold;
return SafeArea(child: scaffold);
} }
return PopScope( return PopScope(
...@@ -134,7 +132,7 @@ class WebPage extends StatelessWidget { ...@@ -134,7 +132,7 @@ class WebPage extends StatelessWidget {
} }
ctx.read<WebCubit>().handleBack(); ctx.read<WebCubit>().handleBack();
}, },
child: scaffold, child: SafeArea(child: scaffold),
); );
}, },
listener: (context, state) { listener: (context, state) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!