mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
Refactor energy clamp dialog to handle empty functions list gracefully
This commit is contained in:
@ -99,7 +99,25 @@ class _EnergyClampDialogState extends State<EnergyClampDialog> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const DialogHeader('Energy Clamp Conditions'),
|
||||
Expanded(child: _buildMainContent(context, state)),
|
||||
Expanded(
|
||||
child: _functions.isEmpty
|
||||
? SizedBox(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
'You Cant add\n the Power Clamp to Then Section',
|
||||
textAlign: TextAlign.center,
|
||||
style: context.textTheme.bodyMedium!.copyWith(
|
||||
color: ColorsManager.red,
|
||||
fontWeight: FontWeight.w400),
|
||||
)),
|
||||
],
|
||||
),
|
||||
)
|
||||
: _buildMainContent(context, state)),
|
||||
_buildDialogFooter(context, state),
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user