use textfield controller from constructor

This commit is contained in:
Rafeek Alkhoudare
2025-05-28 01:48:37 -05:00
parent 1db069e9a5
commit ee244fa5ed
2 changed files with 3 additions and 1 deletions

View File

@ -9,8 +9,9 @@ class SpaceNameTextfieldWidget extends StatelessWidget {
required this.isNameFieldInvalid, required this.isNameFieldInvalid,
required this.onChange, required this.onChange,
required this.screenWidth, required this.screenWidth,
required this.nameController,
}); });
TextEditingController nameController = TextEditingController(); TextEditingController nameController;
final void Function(String value) onChange; final void Function(String value) onChange;
final double screenWidth; final double screenWidth;
bool isNameFieldExist; bool isNameFieldExist;

View File

@ -132,6 +132,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
SpaceNameTextfieldWidget( SpaceNameTextfieldWidget(
isNameFieldExist: isNameFieldExist, isNameFieldExist: isNameFieldExist,
isNameFieldInvalid: isNameFieldInvalid, isNameFieldInvalid: isNameFieldInvalid,
nameController: nameController,
screenWidth: screenWidth, screenWidth: screenWidth,
onChange: (value) { onChange: (value) {
enteredName = value.trim(); enteredName = value.trim();