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