如何将列表视图扩展到全屏
class OrderTestWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar(
title: Text(
AppLocalizations.of(context).ordertestwidgetTitle,
textAlign: TextAlign.center,
style: TextStyle(
color: AppColors.secondaryText,
fontWeight: FontWeight.w400,
fontSize: 21,
),
),
automaticallyImplyLeading: false,
backgroundColor: Color.fromARGB(255, 0, 163, 238),
),
body: Container(
constraints: BoxConstraints.expand(),
decoration: BoxDecoration(
color: Color.fromARGB(0, 0, 0, 0),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
width: 363,
height: 1000,
child: ListView.builder(
itemCount: 15,
itemBuilder: (context, index) {
return Card (
child: Group84ItemWidget(),
);
},
),
),
],
),
),
);
}
}
您可以这样做:
MediaQuery允许您从小部件树中的当前小部件中提取一些数据。
如何在不同任务中使用 MediaQuery 的示例。