mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-24 20:22:27 +00:00
removed unnecessary flag, that can be replaced with checking if the value equals null
.
This commit is contained in:
@ -79,7 +79,6 @@ class _DuplicateSpaceDialogFormState extends State<DuplicateSpaceDialogForm> {
|
||||
const SelectableText('Enter a new name for the duplicated space:'),
|
||||
DuplicateSpaceTextField(
|
||||
nameController: _nameController,
|
||||
isNameValid: _errorText == null,
|
||||
errorText: _errorText,
|
||||
),
|
||||
],
|
||||
|
@ -5,13 +5,11 @@ import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
class DuplicateSpaceTextField extends StatelessWidget {
|
||||
const DuplicateSpaceTextField({
|
||||
required this.nameController,
|
||||
required this.isNameValid,
|
||||
this.errorText,
|
||||
required this.errorText,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final TextEditingController nameController;
|
||||
final bool isNameValid;
|
||||
final String? errorText;
|
||||
|
||||
@override
|
||||
@ -33,7 +31,7 @@ class DuplicateSpaceTextField extends StatelessWidget {
|
||||
color: context.theme.colorScheme.error,
|
||||
fontSize: 8,
|
||||
),
|
||||
errorText: isNameValid ? null : errorText,
|
||||
errorText: errorText,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user