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(),
                    ])))
          ],
      )
    );
  }
相关推荐
kirk_wang37 分钟前
Flutter 三方库 `flutter_phone_direct_caller` 在 OpenHarmony 平台的适配实战
flutter·移动开发·跨平台·arkts·鸿蒙
爱吃大芒果1 小时前
Flutter 自定义 Widget 开发:从基础绘制到复杂交互
开发语言·javascript·flutter·华为·ecmascript·交互
孤鸿玉1 小时前
Flutter官方正在搞热更新(动态化)?硬核,干货,有证据,有代码
flutter·开源
L、2182 小时前
Flutter 与开源鸿蒙(OpenHarmony)的融合开发实践
flutter·开源·harmonyos
名字被你们想完了2 小时前
Flutter 实现一个容器内部元素可平移、缩放和旋转等功能(四)
flutter
爱吃大芒果2 小时前
Flutter 本地存储方案:SharedPreferences、SQFlite 与 Hive
开发语言·javascript·hive·hadoop·flutter·华为·harmonyos
爱吃大芒果2 小时前
Flutter 路由进阶:命名路由、动态路由与路由守卫实现
开发语言·javascript·flutter·华为·ecmascript
hh.h.2 小时前
低代码平台重构:Flutter组件库与鸿蒙分布式能力融合实践
flutter·低代码·重构
hh.h.3 小时前
轻量集成向:10分钟实现鸿蒙原生工程集成Flutter模块(HAR包导入+跨端通信)
flutter·华为·开源·harmonyos
hh.h.3 小时前
Flutter热重载与鸿蒙原子化服务的动态化革命
flutter·华为·harmonyos