From 7268253e35fd6ee9cb9ef252514a423bda3e9f3d Mon Sep 17 00:00:00 2001 From: hannathkadher Date: Thu, 23 Jan 2025 11:45:11 +0400 Subject: [PATCH] fixed button validation --- .../widgets/dialog/create_space_model_dialog.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart b/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart index c653d1b3..86a3938f 100644 --- a/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart +++ b/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart @@ -157,7 +157,7 @@ class CreateSpaceModelDialog extends StatelessWidget { const SizedBox(width: 10), Expanded( child: DefaultButton( - onPressed: state.errorMessage == null || + onPressed: state.errorMessage == null && isNameValid ? () { final updatedSpaceTemplate = @@ -236,7 +236,8 @@ class CreateSpaceModelDialog extends StatelessWidget { : null, backgroundColor: ColorsManager.secondaryColor, borderRadius: 10, - foregroundColor: isNameValid + foregroundColor: state.errorMessage == null && + isNameValid ? ColorsManager.whiteColors : ColorsManager.whiteColorsWithOpacity, child: const Text('OK'),