flutter 设置body可延伸到状态栏

关键代码:extendBodyBehindAppBar: true

dart 复制代码
@override
  Widget build(BuildContext context) {
    return Scaffold(
      extendBodyBehindAppBar: true,//设置body是否可以延伸到状态栏
      backgroundColor: JadeColors.lightGrey,
      appBar: CustomAppBar(
        backgroundColor: Colors.transparent, //appbar设置透明不会遮挡body中的背景图
          leading: IconButton(
              onPressed: () => Navigator.pop(context),
              icon: Icon(Icons.arrow_back_ios, color: Colors.white)),
          title: Text(S.current.q,
              style: TextStyle(
                  fontSize: 38.sp,
                  color: Colors.white,
                  fontWeight: FontWeight.w600)),
          centerTitle: true),
      body: Stack(
        children: [
          Image.asset(PathConfig.imageWalletBg,fit: BoxFit.cover),
          SafeArea(
                child: Padding(
                    padding: EdgeInsets.all(40.w),
                    child:
                        Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [
                      _accountBalance(),
                      SizedBox(height: 80.h),
                      Text(S.current.q13,
                          style: TextStyle(fontSize: 30.sp, color: Color(0xff333333), fontWeight: FontWeight.w600)),
                      SizedBox(height: setHeight(20)),
                      _billList(),
                      SizedBox(height: 60.h),
                      Text(S.current.q14,
                          style: TextStyle(fontSize: 30.sp, color: Color(0xff333333), fontWeight: FontWeight.w600)),
                      SizedBox(height: 25.h),
                      _services(),
                    ])))
          ],
      )
    );
  }
相关推荐
stringwu12 小时前
Flutter 开发必备:MVI 架构的高效实现指南
前端·flutter
程序员老刘1 天前
Flutter版本选择指南:3.44系列继续观望 | 2026年6月
flutter·ai编程·客户端
用户965597361903 天前
Provider vs Bloc vs GetX vs Riverpod:Flutter 状态管理方案怎么选?
flutter
恋猫de小郭3 天前
Flutter Patchwork,不用 Fork 改依赖包源码的第三方工具
android·前端·flutter
程序员老刘3 天前
跑分第一的编程大模型,我为啥不用?
flutter·ai编程·vibecoding
恋猫de小郭4 天前
苹果 AirPods 协议,Android 也可以使用完整版 AirPods 能力
android·前端·flutter
张风捷特烈4 天前
Flutter 类库大揭秘#01 | path_provider架构与设计
android·flutter
恋猫de小郭6 天前
Android 限制侧载新进展,谷歌联合国内厂商推验证计划
android·前端·flutter
恋猫de小郭6 天前
解读 Android 17 全新内存限制,有没有“豁免”后门?
android·前端·flutter
程序员老刘9 天前
跨平台开发地图 | 2026年6月
flutter·ai编程·客户端