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(),
                    ])))
          ],
      )
    );
  }
相关推荐
国医中兴4 小时前
Flutter 三方库 stack_blur 鸿蒙适配指南 - 实现工业级高性能模糊滤镜、在 OpenHarmony 上打造极致视觉质感实战
flutter·华为·harmonyos
Justin在掘金5 小时前
Flutter Provider 状态管理深度指南
flutter
JMchen12310 小时前
跨技术栈:在Flutter/Compose中应用自定义View思想
java·经验分享·flutter·canvas·dart·自定义view
国医中兴12 小时前
Flutter 三方库 ngrouter 鸿蒙适配指南 - 实现高性能扁平化路由导航管理实战
flutter·harmonyos·鸿蒙·openharmony
lpftobetheone13 小时前
【Flutter】如何理解Dart语言的Isolate API
flutter
国医中兴13 小时前
Flutter 三方库 inject_generator 的鸿蒙化适配指南 - 自动化依赖注入注入生成器、驱动鸿蒙大型工程解耦实战
flutter·harmonyos·鸿蒙·openharmony·inject_generator
chdo14 小时前
从需求到实现:Flutter可变宽度滑动器的探索之路
flutter
国医中兴15 小时前
Flutter 三方库 themed_color_palette 的鸿蒙化适配指南 - 定义语义化调色板、在鸿蒙端实现像素级的主题切换实战
flutter·harmonyos·鸿蒙·openharmony·themed_color_palette
不爱吃糖的程序媛15 小时前
2026 年如何上车 Flutter-OH:环境搭建与上手流程
flutter