unfocusOnTap method
Wraps this widget in a GestureDetector that unfocuses the current keyboard/focus on tap.
Implementation
Widget unfocusOnTap() {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: this,
);
}