resolve method Null safety
- PointerSignalEvent event
Resolves the event, calling the first registered callback if there was one.
This is called by the GestureBinding after the framework has finished dispatching the pointer signal event.
Implementation
@pragma('vm:notify-debugger-on-exception')
void resolve(PointerSignalEvent event) {
if (_firstRegisteredCallback == null) {
assert(_currentEvent == null);
return;
}
assert(_isSameEvent(_currentEvent!, event));
try {
_firstRegisteredCallback!(_currentEvent!);
} catch (exception, stack) {
InformationCollector? collector;
assert(() {
collector = () => <DiagnosticsNode>[
DiagnosticsProperty<PointerSignalEvent>('Event', event, style: DiagnosticsTreeStyle.errorProperty),
];
return true;
}());
FlutterError.reportError(FlutterErrorDetails(
exception: exception,
stack: stack,
library: 'gesture library',
context: ErrorDescription('while resolving a PointerSignalEvent'),
informationCollector: collector,
));
}
_firstRegisteredCallback = null;
_currentEvent = null;
}