Answers for "hide 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
2

hide keyboard flutter

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

hide keyboard in flutter

/// Hide the soft keyboard.
void hideKeyboard(BuildContext context) {
  FocusScope.of(context).requestFocus(FocusNode());
}
Posted by: Guest on August-04-2021

Code answers related to "hide keyboard flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language