У меня есть список карточек, но когда я изменил ширину карточки, она по-прежнему принимает ту же ширину, что и родительский контейнер. Я попытался обернуть listview, card и даже scrollView с помощью поля или контейнера определенного размера, но у меня ничего не получилось.
Container(
height: MediaQuery.of(context).size.height * 0.6,
width: MediaQuery.of(context).size.width * 0.8,
decoration: BoxDecoration(
color: kWhiteColor,
borderRadius: BorderRadius.all(
Radius.circular(MediaQuery.of(context).size.height * 0.02)),
),
child: Padding(
padding:
EdgeInsets.all(MediaQuery.of(context).size.height * 0.015),
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: ListView.builder(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: 10,
itemBuilder: (BuildContext context, int index) {
return SizedBox(
width: MediaQuery.of(context).size.width*0.001,
height: MediaQuery.of(context).size.height*0.3,
child: Card(
color: Colors.black,
),
);
},
),
),
),
),
White Card Позади находится родительский элемент или, можно сказать, самый внешний контейнер.