MethodChannelIdwiseFlutter constructor

MethodChannelIdwiseFlutter()

Implementation

MethodChannelIdwiseFlutter() {
  methodChannel.setMethodCallHandler((handler) async {
    switch (handler.method) {
      case 'onJourneyStarted':
        journeyCallbacks?.onJourneyStarted(handler.arguments);
        break;
      case 'onJourneyCompleted':
        journeyCallbacks?.onJourneyCompleted(handler.arguments);
        break;
      case 'onJourneyCancelled':
        journeyCallbacks?.onJourneyCancelled(handler.arguments);
        break;
      case 'onJourneyResumed':
        journeyCallbacks?.onJourneyResumed(handler.arguments);
        break;
      case 'onError':
        journeyCallbacks?.onError(handler.arguments);
        break;
      case 'onInitializeError':
        _onInitializeErrorCallback?.call(handler.arguments);
        break;
      case 'onStepCaptured':
        stepCallbacks?.onStepCaptured(handler.arguments);
        break;
      case 'onStepResult':
        stepCallbacks?.onStepResult(handler.arguments);
        break;
      case 'onStepSkipped':
        stepCallbacks?.onStepSkipped(handler.arguments);
        break;
      case 'onStepCancelled':
        stepCallbacks?.onStepCancelled(handler.arguments);
        break;
      case 'journeySummary':
        _onJourneySummaryCallback?.call(handler.arguments);
        break;
      default:
        print('Unknown method from MethodChannel: ${handler.method}');
        break;
    }
  });
}