flutter 设置body可延伸到状态栏

在这里插入图片描述
关键代码:extendBodyBehindAppBar: true


  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(),
                    ])))
          ],
      )
    );
  }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值