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(),
                    ])))
          ],
      )
    );
  }
相关推荐
Bowen_J1 小时前
Flutter和Dart 网络协议实现
网络协议·flutter·dart
SoaringHeart7 小时前
Flutter组件封装:聊天气包图片组件NChatBubble
前端·flutter
传奇开心果编程9 小时前
【六大移动UI框架比较学与练】第3课:文本、图片、布局核心组件实战对照
android·flutter·react native·ios·swiftui·移动开发·android jetpack
黑科技iOS上架14 小时前
机审友好的iOS混淆方案:无固定二进制特征才能过审4.3
flutter·ios·objective-c·cocoa·审核
传奇开心果编程16 小时前
【六大移动UI框架比较学与练】第4课:列表与滚动——懒加载、复用与状态保持实战对照
android·flutter·react native·ios·swiftui·移动开发·android jetpack
恋猫de小郭16 小时前
Flutter 奇葩 Bug:错过一次合成,后续每帧的 Raster 都顺带变慢?
android·前端·flutter
好的佩奇2 天前
Dart 之 JSON
android·flutter·dart
恋猫de小郭3 天前
站起来,Flutter 要支持真正的 3D Texture 了
android·前端·flutter
黑科技iOS上架4 天前
iOS4.3合规自测手段:二进制分析
flutter·ios·cocoa·审核
好的佩奇4 天前
蓝牙之 GATT 数据模型
android·flutter·蓝牙