resolve method

void resolve(
  1. 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);
    // Nothing in the framework/app wants to handle the `event`. Allow the
    // platform to trigger any default native actions.
    event.respond(
      allowPlatformDefault: true
    );
    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;
}