Привет, друзья, у меня возникла проблема при настройке высоты карты представления на основе экрана, который я пробовал в нем, динамически настраивая экран с помощью приведенного ниже кода, пожалуйста, найдите экран. Мне нужны точные 10 полей под текстом, а не так много я пытался использовать динамический MediaQuery, если я не использую медиа-запрос, он выдает мне ошибку, например, дополнительное пространство под экраном, подобное этому, и я также не могу использовать поле размера, пожалуйста, помогите друзьям, когда я использую поэтапное представление сетки внизу есть место
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
final double itemHeight = (size.height - kToolbarHeight - 24) / 2.3;
final double itemWidth = size.width / 2;
return livevideolist != null
? new GridView.builder(
itemCount: livevideolist == null ? 0 : livevideolist.length,
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(
childAspectRatio: (itemWidth / itemHeight),
crossAxisCount: 2),
itemBuilder: (BuildContext context, int index) {
return new GestureDetector(
onTap: () {
String youtubeid = livevideolist[index]['url'];
playYoutubeVideo(youtubeid);
},
child: new Card(
elevation: 4.0,
margin: EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0),
child: new Column(
children: <Widget>[
new Container(
height: 150.0,
width: double.infinity,
decoration: new BoxDecoration(
image: new DecorationImage(
image:
new NetworkImage(livevideolist[index]['image']),
fit: BoxFit.fill,
),
),
),
Expanded(
child: new Container(
child: new Text(livevideolist[index]['title']),
margin: EdgeInsets.only(left: 10.0, top: 10.0),
),
),
],
),
),
);
},
)
: new Center(
child: new CircularProgressIndicator(),
);
}