这是它现在的样子。我想改变图像width
和height
我该怎么做?
下面是我的代码:
class TabsFreelancerContainer extends StatelessWidget {
final String image, tittle;
const TabsFreelancerContainer({Key? key, required this.image, required this.tittle}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: Dimensions.height50,
width: Dimensions.width50,
decoration: BoxDecoration(
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.black.withOpacity(0.5),
blurRadius: Dimensions.radius10,
offset: const Offset(0.0, 5),
)
],
borderRadius: BorderRadius.circular(Dimensions.radius10),
color: Colors.white,
),
child: CachedNetworkImage(
imageUrl: image,
fit: BoxFit.contain,
placeholder: (context, url) => const Center(child: CircularProgressIndicator()),
errorWidget: (context, url, error) => const Icon(Icons.error),
),
),
SizedBox(
height: 5.h,
),
Expanded(child: SmallText(text: tittle, color: Colors.black, size: Dimensions.font13))
],
);
}
}
我向她展示了这些TabsFreelancerContainer
:
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: widget.list
.map(
(e) => InkWell(
onTap: () {
categoryDetailService.offSet = 1;
(categoryDetailService.data ?? []).clear();
categoryDetailService.fetchData(context, e.id.toString());
},
child: Padding(
padding: EdgeInsets.all(Dimensions.height10 - 2),
child: Tab(
height: Dimensions.height70 + 5,
child: TabsFreelancerContainer(
image: e.photo,
tittle: Get.put(AppController()).isEnglish() ? e.enName : e.arName,
),
),
),
),
)
.toList(),
),
1条答案
按热度按时间vx6bjr1n1#
您可以向Container添加填充,以便它可以基于填充值更改Widget的高度和宽度: