mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 14:47:23 +00:00
Refactor visibility handling for scenes and automations in FetchRoutineScenesAutomation
This commit is contained in:
@ -17,10 +17,6 @@ class FetchRoutineScenesAutomation extends StatefulWidget {
|
||||
|
||||
class _FetchRoutineScenesState extends State<FetchRoutineScenesAutomation>
|
||||
with HelperResponsiveLayout {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -45,15 +41,15 @@ class _FetchRoutineScenesState extends State<FetchRoutineScenesAutomation>
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
if (state.scenes.isEmpty)
|
||||
Text(
|
||||
Visibility(
|
||||
visible: state.scenes.isNotEmpty,
|
||||
replacement: Text(
|
||||
"No scenes found",
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
),
|
||||
),
|
||||
if (state.scenes.isNotEmpty)
|
||||
SizedBox(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
@ -110,6 +106,7 @@ class _FetchRoutineScenesState extends State<FetchRoutineScenesAutomation>
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Automations",
|
||||
@ -119,15 +116,15 @@ class _FetchRoutineScenesState extends State<FetchRoutineScenesAutomation>
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
if (state.automations.isEmpty)
|
||||
Text(
|
||||
Visibility(
|
||||
visible: state.automations.isNotEmpty,
|
||||
replacement: Text(
|
||||
"No automations found",
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
),
|
||||
),
|
||||
if (state.automations.isNotEmpty)
|
||||
SizedBox(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
@ -192,6 +189,7 @@ class _FetchRoutineScenesState extends State<FetchRoutineScenesAutomation>
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user