hideKeyboard static method

void hideKeyboard(
  1. BuildContext context
)

Hide the soft keyboard.

Implementation

static void hideKeyboard(BuildContext context) {
  FocusScopeNode currentFocus = FocusScope.of(context);
  if (!currentFocus.hasPrimaryFocus) {
    currentFocus.unfocus();
  }
}