push add ac fucntions and handle doplicate adding to the then or if items

This commit is contained in:
ashrafzarkanisala
2024-11-19 00:54:43 +03:00
parent 54143b3ba9
commit 57b8f6b03e
60 changed files with 1392 additions and 24 deletions

View File

@ -28,12 +28,14 @@ class RoutineDevices extends StatelessWidget {
return Wrap(
spacing: 10,
runSpacing: 10,
children: deviceList
.map((device) => DraggableCard(
imagePath: device.getDefaultIcon(device.productType),
title: device.name ?? '',
))
.toList(),
children: deviceList.asMap().entries.map((entry) {
final index = entry.key;
final device = entry.value;
return DraggableCard(
imagePath: device.getDefaultIcon(device.productType),
title: device.name ?? '',
);
}).toList(),
);
}
return const Center(child: CircularProgressIndicator());