fixed button validation

This commit is contained in:
hannathkadher
2025-01-23 11:45:11 +04:00
parent 24f7ab6af8
commit 7268253e35

View File

@ -157,7 +157,7 @@ class CreateSpaceModelDialog extends StatelessWidget {
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
onPressed: state.errorMessage == null || onPressed: state.errorMessage == null &&
isNameValid isNameValid
? () { ? () {
final updatedSpaceTemplate = final updatedSpaceTemplate =
@ -236,7 +236,8 @@ class CreateSpaceModelDialog extends StatelessWidget {
: null, : null,
backgroundColor: ColorsManager.secondaryColor, backgroundColor: ColorsManager.secondaryColor,
borderRadius: 10, borderRadius: 10,
foregroundColor: isNameValid foregroundColor: state.errorMessage == null &&
isNameValid
? ColorsManager.whiteColors ? ColorsManager.whiteColors
: ColorsManager.whiteColorsWithOpacity, : ColorsManager.whiteColorsWithOpacity,
child: const Text('OK'), child: const Text('OK'),