TF-1694 Use KeyboardUtils to centralized management show/hide keyboard
(cherry picked from commit e2598476ecdc8c5d16a17dc3c777a34620013c64)
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class KeyboardUtils {
|
||||
void hideKeyboard(BuildContext context) {
|
||||
FocusScopeNode currentFocus = FocusScope.of(context);
|
||||
if (!currentFocus.hasPrimaryFocus) {
|
||||
currentFocus.unfocus();
|
||||
}
|
||||
static void hideKeyboard(BuildContext context) {
|
||||
FocusScope.of(context).unfocus();
|
||||
}
|
||||
|
||||
static void hideSystemKeyboardMobile() {
|
||||
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user