mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-27 17:44:56 +00:00
Added routines search field functionlity
This commit is contained in:
@ -33,17 +33,33 @@ class _ScenesAndAutomationsState extends State<ScenesAndAutomations> {
|
||||
runSpacing: 10,
|
||||
children: scenes.asMap().entries.map((entry) {
|
||||
final scene = entry.value;
|
||||
return DraggableCard(
|
||||
imagePath: Assets.logo,
|
||||
title: scene.name,
|
||||
deviceData: {
|
||||
'deviceId': scene.id,
|
||||
'name': scene.name,
|
||||
'status': scene.status,
|
||||
'type': scene.type,
|
||||
'icon': scene.icon,
|
||||
},
|
||||
);
|
||||
if (state.searchText != null && state.searchText!.isNotEmpty) {
|
||||
return scene.name.toLowerCase().contains(state.searchText!.toLowerCase())
|
||||
? DraggableCard(
|
||||
imagePath: Assets.logo,
|
||||
title: scene.name,
|
||||
deviceData: {
|
||||
'deviceId': scene.id,
|
||||
'name': scene.name,
|
||||
'status': scene.status,
|
||||
'type': scene.type,
|
||||
'icon': scene.icon,
|
||||
},
|
||||
)
|
||||
: Container();
|
||||
} else {
|
||||
return DraggableCard(
|
||||
imagePath: Assets.logo,
|
||||
title: scene.name,
|
||||
deviceData: {
|
||||
'deviceId': scene.id,
|
||||
'name': scene.name,
|
||||
'status': scene.status,
|
||||
'type': scene.type,
|
||||
'icon': scene.icon,
|
||||
},
|
||||
);
|
||||
}
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user