| // Copyright 2013 The Flutter Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // Autogenerated from Pigeon (v10.1.3), do not edit directly. |
| // See also: https://pub.dev/packages/pigeon |
| // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import |
| // ignore_for_file: avoid_relative_lib_imports |
| import 'dart:async'; |
| import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; |
| import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; |
| import 'package:flutter/services.dart'; |
| import 'package:flutter_test/flutter_test.dart'; |
| |
| import 'package:shared_preferences_foundation/messages.g.dart'; |
| |
| abstract class TestUserDefaultsApi { |
| static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => |
| TestDefaultBinaryMessengerBinding.instance; |
| static const MessageCodec<Object?> codec = StandardMessageCodec(); |
| |
| void remove(String key); |
| |
| void setBool(String key, bool value); |
| |
| void setDouble(String key, double value); |
| |
| void setValue(String key, Object value); |
| |
| Map<String?, Object?> getAll(String prefix, List<String?>? allowList); |
| |
| bool clear(String prefix, List<String?>? allowList); |
| |
| static void setup(TestUserDefaultsApi? api, |
| {BinaryMessenger? binaryMessenger}) { |
| { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.UserDefaultsApi.remove', 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.UserDefaultsApi.remove was null.'); |
| final List<Object?> args = (message as List<Object?>?)!; |
| final String? arg_key = (args[0] as String?); |
| assert(arg_key != null, |
| 'Argument for dev.flutter.pigeon.UserDefaultsApi.remove was null, expected non-null String.'); |
| api.remove(arg_key!); |
| return <Object?>[]; |
| }); |
| } |
| } |
| { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.UserDefaultsApi.setBool', 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.UserDefaultsApi.setBool was null.'); |
| final List<Object?> args = (message as List<Object?>?)!; |
| final String? arg_key = (args[0] as String?); |
| assert(arg_key != null, |
| 'Argument for dev.flutter.pigeon.UserDefaultsApi.setBool was null, expected non-null String.'); |
| final bool? arg_value = (args[1] as bool?); |
| assert(arg_value != null, |
| 'Argument for dev.flutter.pigeon.UserDefaultsApi.setBool was null, expected non-null bool.'); |
| api.setBool(arg_key!, arg_value!); |
| return <Object?>[]; |
| }); |
| } |
| } |
| { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.UserDefaultsApi.setDouble', 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.UserDefaultsApi.setDouble was null.'); |
| final List<Object?> args = (message as List<Object?>?)!; |
| final String? arg_key = (args[0] as String?); |
| assert(arg_key != null, |
| 'Argument for dev.flutter.pigeon.UserDefaultsApi.setDouble was null, expected non-null String.'); |
| final double? arg_value = (args[1] as double?); |
| assert(arg_value != null, |
| 'Argument for dev.flutter.pigeon.UserDefaultsApi.setDouble was null, expected non-null double.'); |
| api.setDouble(arg_key!, arg_value!); |
| return <Object?>[]; |
| }); |
| } |
| } |
| { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.UserDefaultsApi.setValue', 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.UserDefaultsApi.setValue was null.'); |
| final List<Object?> args = (message as List<Object?>?)!; |
| final String? arg_key = (args[0] as String?); |
| assert(arg_key != null, |
| 'Argument for dev.flutter.pigeon.UserDefaultsApi.setValue was null, expected non-null String.'); |
| final Object? arg_value = (args[1] as Object?); |
| assert(arg_value != null, |
| 'Argument for dev.flutter.pigeon.UserDefaultsApi.setValue was null, expected non-null Object.'); |
| api.setValue(arg_key!, arg_value!); |
| return <Object?>[]; |
| }); |
| } |
| } |
| { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.UserDefaultsApi.getAll', 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.UserDefaultsApi.getAll was null.'); |
| final List<Object?> args = (message as List<Object?>?)!; |
| final String? arg_prefix = (args[0] as String?); |
| assert(arg_prefix != null, |
| 'Argument for dev.flutter.pigeon.UserDefaultsApi.getAll was null, expected non-null String.'); |
| final List<String?>? arg_allowList = |
| (args[1] as List<Object?>?)?.cast<String?>(); |
| final Map<String?, Object?> output = |
| api.getAll(arg_prefix!, arg_allowList); |
| return <Object?>[output]; |
| }); |
| } |
| } |
| { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.UserDefaultsApi.clear', 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.UserDefaultsApi.clear was null.'); |
| final List<Object?> args = (message as List<Object?>?)!; |
| final String? arg_prefix = (args[0] as String?); |
| assert(arg_prefix != null, |
| 'Argument for dev.flutter.pigeon.UserDefaultsApi.clear was null, expected non-null String.'); |
| final List<String?>? arg_allowList = |
| (args[1] as List<Object?>?)?.cast<String?>(); |
| final bool output = api.clear(arg_prefix!, arg_allowList); |
| return <Object?>[output]; |
| }); |
| } |
| } |
| } |
| } |