didChangeViewFocus method

void didChangeViewFocus(
  1. ViewFocusEvent event
)

Called whenever the PlatformDispatcher receives a notification that the focus state on a view has changed.

The view ID of the FlutterView in which a particular BuildContext resides can be retrieved with View.of(context).viewId, so that it may be compared with the view ID in the event to see if the event pertains to the given context.

Implementation

void didChangeViewFocus(ViewFocusEvent event) {
  // Record the triggered event
  assert(() {
    if (_debugPrintEvents) {
      debugPrint(
          '$_consoleLeadingLine pausedAppLifecycleState() in $_consoleClassName');
    }
    return true;
  }());
}