mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-11 15:47:44 +00:00
push fixes and merge
This commit is contained in:
@ -35,6 +35,20 @@ class DraggableCard extends StatelessWidget {
|
||||
final deviceFunctions =
|
||||
state.selectedFunctions[deviceData['uniqueCustomId']] ?? [];
|
||||
|
||||
int index = state.thenItems.indexWhere(
|
||||
(item) => item['uniqueCustomId'] == deviceData['uniqueCustomId']);
|
||||
|
||||
if (index != -1) {
|
||||
return _buildCardContent(context, deviceFunctions, padding: padding);
|
||||
}
|
||||
|
||||
int ifIndex = state.ifItems.indexWhere(
|
||||
(item) => item['uniqueCustomId'] == deviceData['uniqueCustomId']);
|
||||
|
||||
if (ifIndex != -1) {
|
||||
return _buildCardContent(context, deviceFunctions, padding: padding);
|
||||
}
|
||||
|
||||
return Draggable<Map<String, dynamic>>(
|
||||
data: deviceData,
|
||||
feedback: Transform.rotate(
|
||||
@ -79,17 +93,13 @@ class DraggableCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: imagePath.contains('.svg')
|
||||
? SvgPicture.asset(
|
||||
imagePath,
|
||||
child: deviceData['type'] == 'tap_to_run'
|
||||
? Image.memory(
|
||||
base64Decode(deviceData['icon']),
|
||||
)
|
||||
: imagePath.contains('.png')
|
||||
? Image.asset(
|
||||
imagePath,
|
||||
)
|
||||
: Image.memory(
|
||||
base64Decode(imagePath),
|
||||
),
|
||||
: SvgPicture.asset(
|
||||
imagePath,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Padding(
|
||||
|
Reference in New Issue
Block a user