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(),
                    ])))
          ],
      )
    );
  }
相关推荐
sunly_3 小时前
Flutter:导航固定背景图,滚动时导航颜色渐变
android·javascript·flutter
恋猫de小郭5 小时前
为什么跨平台框架可以适配鸿蒙,它们的技术原理是什么?
android·前端·flutter
SY.ZHOU6 小时前
详细讲解Flutter GetX的使用
flutter
sunly_6 小时前
Flutter:下拉框选择
flutter
明似水6 小时前
用 Melos 解决 Flutter Monorepo 的依赖冲突:一个真实案例
前端·javascript·flutter
张风捷特烈7 小时前
每日一题 Flutter#5,6 | 两道 Widget 选择题
android·flutter
玖夜Kty17 小时前
国内环境修改 flutter.bat 来设置 flutter 的网络环境
flutter
LinXunFeng18 小时前
Flutter - GetX Helper 助你规范应用 tag
flutter·github·visual studio code
阅文作家助手开发团队_山神1 天前
第五章:Flutter Quill渲染原理深度剖析:Delta到RichText的华丽转身
flutter
未来猫咪花1 天前
# Flutter状态管理对比:view_model vs Riverpod
flutter·ios·android studio