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(),
                    ])))
          ],
      )
    );
  }
相关推荐
QuantumLeap丶5 小时前
《Flutter全栈开发实战指南:从零到高级》- 01 - 从零开始搭建你的第一个Flutter应用
flutter
西西学代码7 小时前
Flutter---ListView
flutter
盆鱼宴之武冈分宴13 小时前
flutter openharmony项目新手从0到1的保姆级教程
flutter·openharmony
程序员老刘1 天前
Dart的宏取消了,期待3年的功能,说没就没了?
flutter·客户端·dart
_大学牲1 天前
Flutter 之魂 GetX🔥(三)深入掌握依赖管理
前端·flutter
西西学代码1 天前
Flutter---showCupertinoDialog
java·前端·flutter
爱吃水蜜桃的奥特曼1 天前
玩Android Flutter版本,通过项目了解Flutter项目快速搭建开发
android·flutter
西西学代码1 天前
Flutter---带输入框的对话框
flutter
_阿南_1 天前
flutter在Xcode26打包的iOS26上全屏支持右滑的问题
flutter·ios·xcode