setMethodCallHandlers static method

dynamic setMethodCallHandlers()

Implementation

static setMethodCallHandlers() {
  MethodChannelMidtransPlugin.channel.setMethodCallHandler((call) async {
    if (call.method == 'onTransactionResult') {
      final json = Map<String, dynamic>.from(call.arguments);
      MidtransPluginPlatform.onTransactionResult
          .add(TransactionResult.fromJson(json));
      return;
    }

    throw UnimplementedError('${call.method} has not been implemented');
  });
}