mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
fixed issue
This commit is contained in:
@ -45,14 +45,14 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
|
||||
selectedIcon = widget.icon ?? Assets.location;
|
||||
nameController = TextEditingController(text: widget.name ?? '');
|
||||
selectedProducts = widget.selectedProducts.isNotEmpty ? widget.selectedProducts : [];
|
||||
isOkButtonEnabled = enteredName.isNotEmpty || widget.name!.isNotEmpty;
|
||||
isOkButtonEnabled = enteredName.isNotEmpty || nameController.text.isNotEmpty;
|
||||
isNameFieldInvalid = nameController.text.isEmpty;
|
||||
}
|
||||
|
||||
@override
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenWidth = MediaQuery.of(context).size.width;
|
||||
final screenHeight = MediaQuery.of(context).size.height;
|
||||
|
||||
return AlertDialog(
|
||||
title: widget.isEdit ? const Text('Edit Space') : const Text('Create New Space'),
|
||||
@ -121,6 +121,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
|
||||
isOkButtonEnabled = true;
|
||||
isNameFieldInvalid = false;
|
||||
} else {
|
||||
isNameFieldInvalid = true;
|
||||
isOkButtonEnabled = false;
|
||||
}
|
||||
});
|
||||
@ -233,7 +234,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
|
||||
Expanded(
|
||||
child: DefaultButton(
|
||||
onPressed: () {
|
||||
if (enteredName.trim().isEmpty || widget.name!.isEmpty) {
|
||||
if (nameController.text.isEmpty) {
|
||||
setState(() {
|
||||
isNameFieldInvalid = true;
|
||||
});
|
||||
|
Reference in New Issue
Block a user