【发布时间】:2026-01-09 02:25:02
【问题描述】:
像这样使用安全区域
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text("Payment Method"),
centerTitle: true,
leading: IconButton(
icon: Icon(
Icons.navigate_before,
size: 40,
),
onPressed: () {
Navigator.of(context).pop();
},
),
),
body: RefreshIndicator(
-----)
我将它用于状态栏
void main() {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark,
systemNavigationBarColor: Colors.white,
systemNavigationBarIconBrightness: Brightness.dark,
systemNavigationBarDividerColor: Colors.transparent,
));runApp(MyApp());}
但是现在由于应用栏的升高,应用栏和状态栏似乎是分开的,所以最好的解决方法是让应用栏和状态栏看起来合并
【问题讨论】:
-
您是否尝试将
elevation: 0添加到 AppBar ? -
其实我需要在 appbar 中提升
-
@TarunJain 可以分享截图吗?
标签: flutter dart flutter-layout flutter-appbar