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(),
                    ])))
          ],
      )
    );
  }
相关推荐
一人前行41 分钟前
Flutter_学习记录_iOS 模拟器用Charles抓包
flutter
l软件定制开发工作室1 天前
Flutter系列教程之(5)——常用控件Widget的使用示例
flutter
leluckys1 天前
flutter 专题 八十五 Flutter 应用调试
flutter
ClaNNEd@1 天前
Flutter&JSON
flutter·json
阿长长啊1 天前
Flutter 介绍及安装使用
flutter
snail2012111 天前
Flutter_boost混编开发系统MethodChannel之坑
flutter
leluckys1 天前
flutter 专题 八十二 Flutter路由框架Fluro简介
开发语言·javascript·flutter
l软件定制开发工作室1 天前
Flutter系列教程之(6)——Tab导航与ListView使用
flutter
null_null9991 天前
flutter Running Gradle task ‘assembleDebug‘...
flutter
一人前行1 天前
Flutter_学习记录_各个屏幕的适配
学习·flutter