setup static method

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

Implementation

static void setup(TestFirebaseCoreHostApi? api,
    {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel, null);
    } else {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel,
              (Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_appName = (args[0] as String?);
        assert(arg_appName != null,
            'Argument for dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp was null, expected non-null String.');
        final PigeonFirebaseOptions? arg_initializeAppRequest =
            (args[1] as PigeonFirebaseOptions?);
        assert(arg_initializeAppRequest != null,
            'Argument for dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp was null, expected non-null PigeonFirebaseOptions.');
        final PigeonInitializeResponse output =
            await api.initializeApp(arg_appName!, arg_initializeAppRequest!);
        return <Object?>[output];
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.FirebaseCoreHostApi.initializeCore', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel, null);
    } else {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel,
              (Object? message) async {
        // ignore message
        final List<PigeonInitializeResponse?> output =
            await api.initializeCore();
        return <Object?>[output];
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.FirebaseCoreHostApi.optionsFromResource', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel, null);
    } else {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel,
              (Object? message) async {
        // ignore message
        final PigeonFirebaseOptions output = await api.optionsFromResource();
        return <Object?>[output];
      });
    }
  }
}