mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Extracted Chip into a private method.
This commit is contained in:
@ -66,31 +66,7 @@ class TagChipDisplay extends StatelessWidget {
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
..._groupedTags.entries.map((entry) {
|
||||
return Chip(
|
||||
avatar: SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: SvgPicture.asset(
|
||||
entry.key.icon ?? 'assets/icons/gateway.svg',
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
label: Text(
|
||||
'x${entry.value}',
|
||||
style: context.textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.spaceColor,
|
||||
),
|
||||
),
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
side: const BorderSide(
|
||||
color: ColorsManager.spaceColor,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
..._groupedTags.entries.map((entry) => _buildChip(context, entry)),
|
||||
EditChip(
|
||||
onTap: () => showDialog<void>(
|
||||
context: context,
|
||||
@ -124,6 +100,35 @@ class TagChipDisplay extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
Chip _buildChip(
|
||||
BuildContext context,
|
||||
MapEntry<ProductModel, int> entry,
|
||||
) {
|
||||
return Chip(
|
||||
avatar: SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: SvgPicture.asset(
|
||||
entry.key.icon ?? 'assets/icons/gateway.svg',
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
label: Text(
|
||||
'${entry.value}',
|
||||
style: context.textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.spaceColor,
|
||||
),
|
||||
),
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
side: const BorderSide(
|
||||
color: ColorsManager.spaceColor,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAddDevicesButton(BuildContext context) {
|
||||
return TextButton(
|
||||
onPressed: () => showDialog<void>(
|
||||
|
Reference in New Issue
Block a user