关键代码: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(),
])))
],
)
);
}