In a TextFormField I’m trying to unfocus with onTapOutside instead of using a GestureDetector, to unfocus when I tap outside the TextFormField.
onTapOutside: (pointer) {
if (FocusScope.of(context).focusedChild != null) {
FocusScope.of(context).focusedChild!.unfocus();
}
},
The problem is that since we start scrolling in the page it also unfocus the field selected.
Is there a way currently to patch this problem from onTapOutside ?
Is it possible to use onTapOutside without losing the focus when scrolling ?