push tab to run and handling automation

This commit is contained in:
ashrafzarkanisala
2024-11-24 23:07:03 +03:00
parent 87c47a74ce
commit 0c555cda83
13 changed files with 295 additions and 154 deletions

View File

@ -30,19 +30,25 @@ class ThenContainer extends StatelessWidget {
fontSize: 18, fontWeight: FontWeight.bold)),
const SizedBox(height: 16),
Wrap(
spacing: 8,
runSpacing: 8,
children: state.thenItems
.map((item) => DraggableCard(
// key: Key(item['key']!),
imagePath: item['imagePath']!,
title: item['title']!,
deviceData: item,
padding: EdgeInsets.symmetric(
horizontal: 4, vertical: 8),
))
.toList(),
),
spacing: 8,
runSpacing: 8,
children: List.generate(
state.thenItems.length,
(index) => DraggableCard(
imagePath:
state.thenItems[index]['imagePath'] ?? '',
title: state.thenItems[index]['title'] ?? '',
deviceData: state.thenItems[index],
padding: const EdgeInsets.symmetric(
horizontal: 4, vertical: 8),
isFromThen: true,
isFromIf: false,
onRemove: () {
context.read<RoutineBloc>().add(
RemoveDragCard(
index: index, isFromThen: true));
},
))),
],
),
),