setup static method

void setup(
  1. AGMLAuthApiHandler? api, {
  2. BinaryMessenger? binaryMessenger,
})

Implementation

static void setup(AGMLAuthApiHandler? api, {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.AuthPigeon.AGMLAuthApiHandler.oAuthUserState', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.AuthPigeon.AGMLAuthApiHandler.oAuthUserState was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final bool? arg_state = (args[0] as bool?);
        assert(arg_state != null,
            'Argument for dev.flutter.pigeon.AuthPigeon.AGMLAuthApiHandler.oAuthUserState was null, expected non-null bool.');
        try {
          api.oAuthUserState(arg_state!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
}