mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
Refactor visibility logic in Energy Clamp Dialog to handle empty functions list more elegantly
This commit is contained in:
@ -100,24 +100,26 @@ class _EnergyClampDialogState extends State<EnergyClampDialog> {
|
|||||||
children: [
|
children: [
|
||||||
const DialogHeader('Energy Clamp Conditions'),
|
const DialogHeader('Energy Clamp Conditions'),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _functions.isEmpty
|
child: Visibility(
|
||||||
? SizedBox(
|
visible: _functions.isNotEmpty,
|
||||||
child: Row(
|
replacement: SizedBox(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Center(
|
children: [
|
||||||
child: Text(
|
Center(
|
||||||
'You Cant add\n the Power Clamp to Then Section',
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
'You Cant add\n the Power Clamp to Then Section',
|
||||||
style: context.textTheme.bodyMedium!.copyWith(
|
textAlign: TextAlign.center,
|
||||||
color: ColorsManager.red,
|
style: context.textTheme.bodyMedium!.copyWith(
|
||||||
fontWeight: FontWeight.w400),
|
color: ColorsManager.red,
|
||||||
)),
|
fontWeight: FontWeight.w400),
|
||||||
],
|
)),
|
||||||
),
|
],
|
||||||
)
|
),
|
||||||
: _buildMainContent(context, state)),
|
),
|
||||||
|
child: _buildMainContent(context, state),
|
||||||
|
)),
|
||||||
_buildDialogFooter(context, state),
|
_buildDialogFooter(context, state),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user