Answers for "flutter textforfield focus"

3

flutter unfocus textfield

FocusScope.of(context).unfocus();
Posted by: Guest on October-12-2020
0

How to shift focus to next textfield in flutter?

@override
Widget build(BuildContext context) {
  return Scaffold(
    body: Column(
      children: <Widget>[
        TextField(
          decoration: InputDecoration(hintText: 'TextField A'),
          textInputAction: TextInputAction.next, // Moves focus to next.
        ),
        TextField(
          decoration: InputDecoration(hintText: 'TextField B'),
          textInputAction: TextInputAction.next, // Moves focus to next.
        ),
        TextField(
          decoration: InputDecoration(hintText: 'TextField C'),
          textInputAction: TextInputAction.done, // Hides the keyboard.
        ),
      ],
    ),
  );
}
Posted by: Guest on January-02-2022

Code answers related to "Dart"

Browse Popular Code Answers by Language