keyboardDismiss static method
Closes the keyboard.
If ifRemovesFocus
is true (the default) it also removes focus from whatever widget has it.
Implementation
static void keyboardDismiss(BuildContext context, {bool ifRemovesFocus = true}) {
/// How to Dismiss the Keyboard in Flutter the Right Way.
/// https://flutterigniter.com/dismiss-keyboard-form-lose-focus/
if (ifRemovesFocus) FocusScope.of(context).requestFocus(FocusNode());
SystemChannels.textInput.invokeMethod<dynamic>('TextInput.hide');
}