add space between buttons

This commit is contained in:
hannathkadher
2024-11-27 14:23:18 +04:00
parent ff22a6b6ab
commit 85bc7ee8c0

View File

@ -323,18 +323,21 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
spacing: 8,
runSpacing: 8,
children: [
for (var product in selectedProducts)
for (var i = 0; i < selectedProducts.length; i++) ...[
HoverableButton(
iconPath: _mapIconToProduct(product.productId, products),
text: 'x${product.count}',
iconPath: _mapIconToProduct(selectedProducts[i].productId, products),
text: 'x${selectedProducts[i].count}',
onTap: () {
setState(() {
selectedProducts.remove(product);
selectedProducts.remove(selectedProducts[i]);
});
// Handle button tap
},
),
// Add Button
if (i < selectedProducts.length - 1)
const SizedBox(width: 2), // Add space except after the last button
],
const SizedBox(width: 2),
GestureDetector(
onTap: () {
showDialog(