final List<String> list = [
"Eli's Poynt AC",
"Eli's Poynt Home DC",
];
bool isSettings = false;
ListView.builder(
shrinkWrap: true,
itemCount: list.length + 1,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(bottom: 16),
child: Container(
height: 112,
padding:
const EdgeInsets.symmetric(horizontal: 21, vertical: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: constants.Colors.greyDark,
),
child: Row(
children: [
SizedBox(
height: 80,
width: 80,
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image.asset('assets/images/poynt.jpg'),
),
),
const SizedBox(width: 15),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
list[index],
style: constants.Styles.normalHeavyTextStyleWhite,
),
const SizedBox(height: 6),
const Text(
'Evan Gbirol St, 18',
style: constants.Styles.smallBookTextStyleWhite,
),
],
),
),
SvgPicture.asset(constants.Assets.poynt1),
const SizedBox(width: 20),
IconButton(
onPressed: () {
setState(() {
isSettings = !isSettings;
});
},
icon: isSettings
? SvgPicture.asset(constants.Assets.remove2)
: SvgPicture.asset(constants.Assets.threeDot),
padding: EdgeInsets.zero,
constraints: const BoxConstraints(),
),
flutter点击按键切换图标
最新推荐文章于 2024-05-15 22:48:55 发布