mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 18:16:34 +00:00
Merge pull request #217 from SyncrowIOT/SP-1584-FE-Block-Energy-Device-from-Being-Added-to-Then-Section-with-Validation-Message
Refactor energy clamp dialog to handle empty functions list gracefully
This commit is contained in:
@ -99,7 +99,27 @@ class _EnergyClampDialogState extends State<EnergyClampDialog> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const DialogHeader('Energy Clamp Conditions'),
|
const DialogHeader('Energy Clamp Conditions'),
|
||||||
Expanded(child: _buildMainContent(context, state)),
|
Expanded(
|
||||||
|
child: Visibility(
|
||||||
|
visible: _functions.isNotEmpty,
|
||||||
|
replacement: 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),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: _buildMainContent(context, state),
|
||||||
|
)),
|
||||||
_buildDialogFooter(context, state),
|
_buildDialogFooter(context, state),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user