blob: c581d5118216f8b8d88cdbd51de16159eec8caca [file] [log] [blame]
// 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 (v9.2.4), 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?> getAllWithPrefix(String prefix);
void clearWithPrefix(String prefix);
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.getAllWithPrefix', 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.getAllWithPrefix 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.getAllWithPrefix was null, expected non-null String.');
final Map<String?, Object?> output =
api.getAllWithPrefix(arg_prefix!);
return <Object?>[output];
});
}
}
{
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.UserDefaultsApi.clearWithPrefix', 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.clearWithPrefix 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.clearWithPrefix was null, expected non-null String.');
api.clearWithPrefix(arg_prefix!);
return <Object?>[];
});
}
}
}
}