setUp static method

void setUp(
  1. SentianceUserContextListenerApi? api, {
  2. BinaryMessenger? binaryMessenger,
  3. String messageChannelSuffix = '',
})

Implementation

static void setUp(SentianceUserContextListenerApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) {
  messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
  {
    final BasicMessageChannel<Object?> __pigeon_channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.sentiance_user_context.SentianceUserContextListenerApi.didUpdate$messageChannelSuffix', pigeonChannelCodec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      __pigeon_channel.setMessageHandler(null);
    } else {
      __pigeon_channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.sentiance_user_context.SentianceUserContextListenerApi.didUpdate was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final UserContextUpdateCriteria? arg_criteria = args[0] == null ? null : UserContextUpdateCriteria.values[args[0]! as int];
        try {
          api.didUpdate(arg_criteria);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
}