I have a question.
I have an application with various forms with textfields. In each form i noted that when i use tab button to switch fields, focus disappear from the fields and goes i dont know where.
I tried to use Focus widget to see if on tab the focus change, and it doesn't (only when the focus return to the first field, Focus return me that it is changed)
Someone could help me? Thanks you
This is a snippet of Login form
Focus(
onFocusChange: ((value) => print("focus is changed")),
child: Column(
children: [
Semantics(
value: "Email",
child: TextFormField(
key: Key("Email"),
validator: (value) => emailValidator(value),
controller: _emailController,
),
),
const SizedBox(height: 20),
Semantics(
value: "Password",
child: TextFormField(
key: Key("Password"),
validator: (value) =>
formRequiredValidation("password", value),
textInputAction: TextInputAction.done,
obscureText: _isTypePassword,
controller: _passwordController,
onChanged: (value) {
setState(() {});
},
onFieldSubmitted: (String value) => _onSubmit(),
),
),
const SizedBox(height: 20),
SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
key: Key("Accedi"),
onPressed: _onSubmit,
child: const Text(
"ACCEDI",
),
),
),
const SizedBox(height: 20),
GestureDetector(
onTap: () {},
child: Text(
"Hai dimenticato la password?",
style: TextStyle(
color: Theme.of(context).primaryColor),
),
),
const SizedBox(height: 20),
GestureDetector(
onTap: () {},
child: Text(
"Non sei ancora registrato?",
style: TextStyle(
color: Theme.of(context).primaryColor),
),
),
],
),
),