flutter Chip 组件
前言
Chip 组件,是一个简单而精美的组件,但是它有几个变体,例如InputChip、ChoiceChip、FilterChip 和ActionChip。记录一下
Chip() 及变体的简单使用
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Chip(
avatar: CircleAvatar(
backgroundColor: Colors.grey.shade800,
child: const Text('AB'), ),
label: const Text('Aaron Burr'),
),
InputChip(
avatar: CircleAvatar(
backgroundColor: Colors.grey.shade800,
child: const Text('AB'), ),
label: const Text('Aaron Burr'),
),
ChoiceChip(
avatar: CircleAvatar(
backgroundColor: Colors.grey.shade800,
child: const Text('AB'), ),
label: const Text('Aaron Burr'), selected: false,
),
FilterChip(
avatar: CircleAvatar(
backgroundColor: Colors.grey.shade800,
child: const Text('AB'), ),
label: const Text('Aaron Burr'), onSelected: (bool value) {
},
),
ActionChip(
avatar: CircleAvatar(
backgroundColor: Colors.grey.shade800,
child: const Text('AB'), ),
label: const Text('Aaron Burr'),
),
],
)