handleViewFocusChanged method
- ViewFocusEvent event
override
Called whenever the PlatformDispatcher receives a notification that the focus state on a view has changed.
The event contains the view ID for the view that changed its focus
state.
See also:
- PlatformDispatcher.onViewFocusChange, which calls this method.
Implementation
@override
void handleViewFocusChanged(ViewFocusEvent event) {
super.handleViewFocusChanged(event);
for (final observer in List<WidgetsBindingObserver>.of(_observers)) {
try {
observer.didChangeViewFocus(event);
} catch (exception, stack) {
FlutterError.reportError(
FlutterErrorDetails(
exception: exception,
stack: stack,
library: 'widgets library',
context: ErrorDescription(
'while dispatching notifications for WidgetsBindingObserver.didChangeViewFocus',
),
),
);
}
}
}