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(),
                    ])))
          ],
      )
    );
  }
相关推荐
stringwu1 天前
Flutter 开发者必备:WebSocket 实用指南
flutter
小林的技术分享1 天前
关于排查 Flutter 3.27.0 版本Android端无法禁用Impeller引擎的过程记录
前端·flutter
coder_pig2 天前
🤡 公司Android老项目升级踩坑小记
android·flutter·gradle
w_y_fan2 天前
双token机制:flutter_secure_storage 实现加密存储
前端·flutter
dragon7252 天前
关于image组件设置宽高不生效问题的探究
flutter
会煮咖啡的猫2 天前
Flutter 是否需要 UI 组件库?
flutter
眼镜会飞2 天前
Flutter 3.x新版android端的build.gradle.kts文件配置arm64-v8a和armeabi-v7a等
android·前端·flutter
恋猫de小郭2 天前
Flutter 小技巧之有趣的 UI 骨架屏框架 skeletonizer
android·前端·flutter
一狐九2 天前
Flutter如何通过GlobalKey调用组件内的方法
前端·flutter
张风捷特烈2 天前
鸿蒙纪·Flutter卷#03 | 从配置证书到打包发布
android·flutter·harmonyos