didChangeMetrics method
This routine is invoked when the window metrics have changed. This happens when the keyboard is open or dismissed, among others. It is the opportunity to check if the field has the focus and to ensure it is fully visible in the viewport when the keyboard is displayed
Implementation
@override
void didChangeMetrics() {
if (widget.focusNode.hasFocus) {
_ensureVisible();
}
}