Answers for "unfocus keyboard flutter"

6

close keyboard on button click flutter

class _HomeState extends State<Home> {
 var currentFocus;
    
 unfocus() {
    currentFocus = FocusScope.of(context);

    if (!currentFocus.hasPrimaryFocus) {
      currentFocus.unfocus();
    }
  }
  
Widget build(BuildContext context) {
    return GestureDetector(
      onTap: unfocus,
      child: Scaffold(...)
      )
     }
Posted by: Guest on August-28-2020
3

flutter trigger show off keyboard

FocusScope.of(context).unfocus()
Posted by: Guest on June-15-2020
2

flutter unfocus textfield

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

unfocused keyboard flutter

FocusManager.instance.primaryFocus.unfocus();
Posted by: Guest on August-27-2021
0

unfocus textfield flutter

FocusScope.of(context).unfocus();
_textEditingController.clear();
Posted by: Guest on June-23-2020

Code answers related to "unfocus keyboard flutter"

Browse Popular Code Answers by Language