| // 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 (v0.3.0), 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, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name |
| // @dart = 2.12 |
| import 'dart:async'; |
| import 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List; |
| |
| import 'package:flutter/foundation.dart' show WriteBuffer, ReadBuffer; |
| import 'package:flutter/services.dart'; |
| |
| class _PrimitiveHostApiCodec extends StandardMessageCodec { |
| const _PrimitiveHostApiCodec(); |
| } |
| |
| class PrimitiveHostApi { |
| /// Constructor for [PrimitiveHostApi]. The [binaryMessenger] named argument is |
| /// available for dependency injection. If it is left null, the default |
| /// BinaryMessenger will be used which routes to the host platform. |
| PrimitiveHostApi({BinaryMessenger? binaryMessenger}) |
| : _binaryMessenger = binaryMessenger; |
| |
| final BinaryMessenger? _binaryMessenger; |
| |
| static const MessageCodec<Object?> codec = _PrimitiveHostApiCodec(); |
| |
| Future<int> anInt(int arg) async { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveHostApi.anInt', codec, |
| binaryMessenger: _binaryMessenger); |
| final Map<Object?, Object?>? replyMap = |
| await channel.send(arg) as Map<Object?, Object?>?; |
| if (replyMap == null) { |
| throw PlatformException( |
| code: 'channel-error', |
| message: 'Unable to establish connection on channel.', |
| details: null, |
| ); |
| } else if (replyMap['error'] != null) { |
| final Map<Object?, Object?> error = |
| (replyMap['error'] as Map<Object?, Object?>?)!; |
| throw PlatformException( |
| code: (error['code'] as String?)!, |
| message: error['message'] as String?, |
| details: error['details'], |
| ); |
| } else { |
| return (replyMap['result'] as int?)!; |
| } |
| } |
| |
| Future<bool> aBool(bool arg) async { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveHostApi.aBool', codec, |
| binaryMessenger: _binaryMessenger); |
| final Map<Object?, Object?>? replyMap = |
| await channel.send(arg) as Map<Object?, Object?>?; |
| if (replyMap == null) { |
| throw PlatformException( |
| code: 'channel-error', |
| message: 'Unable to establish connection on channel.', |
| details: null, |
| ); |
| } else if (replyMap['error'] != null) { |
| final Map<Object?, Object?> error = |
| (replyMap['error'] as Map<Object?, Object?>?)!; |
| throw PlatformException( |
| code: (error['code'] as String?)!, |
| message: error['message'] as String?, |
| details: error['details'], |
| ); |
| } else { |
| return (replyMap['result'] as bool?)!; |
| } |
| } |
| |
| Future<String> aString(String arg) async { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveHostApi.aString', codec, |
| binaryMessenger: _binaryMessenger); |
| final Map<Object?, Object?>? replyMap = |
| await channel.send(arg) as Map<Object?, Object?>?; |
| if (replyMap == null) { |
| throw PlatformException( |
| code: 'channel-error', |
| message: 'Unable to establish connection on channel.', |
| details: null, |
| ); |
| } else if (replyMap['error'] != null) { |
| final Map<Object?, Object?> error = |
| (replyMap['error'] as Map<Object?, Object?>?)!; |
| throw PlatformException( |
| code: (error['code'] as String?)!, |
| message: error['message'] as String?, |
| details: error['details'], |
| ); |
| } else { |
| return (replyMap['result'] as String?)!; |
| } |
| } |
| |
| Future<double> aDouble(double arg) async { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveHostApi.aDouble', codec, |
| binaryMessenger: _binaryMessenger); |
| final Map<Object?, Object?>? replyMap = |
| await channel.send(arg) as Map<Object?, Object?>?; |
| if (replyMap == null) { |
| throw PlatformException( |
| code: 'channel-error', |
| message: 'Unable to establish connection on channel.', |
| details: null, |
| ); |
| } else if (replyMap['error'] != null) { |
| final Map<Object?, Object?> error = |
| (replyMap['error'] as Map<Object?, Object?>?)!; |
| throw PlatformException( |
| code: (error['code'] as String?)!, |
| message: error['message'] as String?, |
| details: error['details'], |
| ); |
| } else { |
| return (replyMap['result'] as double?)!; |
| } |
| } |
| |
| Future<Map<Object?, Object?>> aMap(Map<Object?, Object?> arg) async { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveHostApi.aMap', codec, |
| binaryMessenger: _binaryMessenger); |
| final Map<Object?, Object?>? replyMap = |
| await channel.send(arg) as Map<Object?, Object?>?; |
| if (replyMap == null) { |
| throw PlatformException( |
| code: 'channel-error', |
| message: 'Unable to establish connection on channel.', |
| details: null, |
| ); |
| } else if (replyMap['error'] != null) { |
| final Map<Object?, Object?> error = |
| (replyMap['error'] as Map<Object?, Object?>?)!; |
| throw PlatformException( |
| code: (error['code'] as String?)!, |
| message: error['message'] as String?, |
| details: error['details'], |
| ); |
| } else { |
| return (replyMap['result'] as Map<Object?, Object?>?)!; |
| } |
| } |
| |
| Future<List<Object?>> aList(List<Object?> arg) async { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveHostApi.aList', codec, |
| binaryMessenger: _binaryMessenger); |
| final Map<Object?, Object?>? replyMap = |
| await channel.send(arg) as Map<Object?, Object?>?; |
| if (replyMap == null) { |
| throw PlatformException( |
| code: 'channel-error', |
| message: 'Unable to establish connection on channel.', |
| details: null, |
| ); |
| } else if (replyMap['error'] != null) { |
| final Map<Object?, Object?> error = |
| (replyMap['error'] as Map<Object?, Object?>?)!; |
| throw PlatformException( |
| code: (error['code'] as String?)!, |
| message: error['message'] as String?, |
| details: error['details'], |
| ); |
| } else { |
| return (replyMap['result'] as List<Object?>?)!; |
| } |
| } |
| |
| Future<Int32List> anInt32List(Int32List arg) async { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveHostApi.anInt32List', codec, |
| binaryMessenger: _binaryMessenger); |
| final Map<Object?, Object?>? replyMap = |
| await channel.send(arg) as Map<Object?, Object?>?; |
| if (replyMap == null) { |
| throw PlatformException( |
| code: 'channel-error', |
| message: 'Unable to establish connection on channel.', |
| details: null, |
| ); |
| } else if (replyMap['error'] != null) { |
| final Map<Object?, Object?> error = |
| (replyMap['error'] as Map<Object?, Object?>?)!; |
| throw PlatformException( |
| code: (error['code'] as String?)!, |
| message: error['message'] as String?, |
| details: error['details'], |
| ); |
| } else { |
| return (replyMap['result'] as Int32List?)!; |
| } |
| } |
| |
| Future<List<bool?>> aBoolList(List<bool?> arg) async { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveHostApi.aBoolList', codec, |
| binaryMessenger: _binaryMessenger); |
| final Map<Object?, Object?>? replyMap = |
| await channel.send(arg) as Map<Object?, Object?>?; |
| if (replyMap == null) { |
| throw PlatformException( |
| code: 'channel-error', |
| message: 'Unable to establish connection on channel.', |
| details: null, |
| ); |
| } else if (replyMap['error'] != null) { |
| final Map<Object?, Object?> error = |
| (replyMap['error'] as Map<Object?, Object?>?)!; |
| throw PlatformException( |
| code: (error['code'] as String?)!, |
| message: error['message'] as String?, |
| details: error['details'], |
| ); |
| } else { |
| return (replyMap['result'] as List<Object?>?)!.cast<bool?>(); |
| } |
| } |
| |
| Future<Map<String?, int?>> aStringIntMap(Map<String?, int?> arg) async { |
| final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveHostApi.aStringIntMap', codec, |
| binaryMessenger: _binaryMessenger); |
| final Map<Object?, Object?>? replyMap = |
| await channel.send(arg) as Map<Object?, Object?>?; |
| if (replyMap == null) { |
| throw PlatformException( |
| code: 'channel-error', |
| message: 'Unable to establish connection on channel.', |
| details: null, |
| ); |
| } else if (replyMap['error'] != null) { |
| final Map<Object?, Object?> error = |
| (replyMap['error'] as Map<Object?, Object?>?)!; |
| throw PlatformException( |
| code: (error['code'] as String?)!, |
| message: error['message'] as String?, |
| details: error['details'], |
| ); |
| } else { |
| return (replyMap['result'] as Map<Object?, Object?>?)! |
| .cast<String?, int?>(); |
| } |
| } |
| } |
| |
| class _PrimitiveFlutterApiCodec extends StandardMessageCodec { |
| const _PrimitiveFlutterApiCodec(); |
| } |
| |
| abstract class PrimitiveFlutterApi { |
| static const MessageCodec<Object?> codec = _PrimitiveFlutterApiCodec(); |
| |
| int anInt(int arg); |
| bool aBool(bool arg); |
| String aString(String arg); |
| double aDouble(double arg); |
| Map<Object?, Object?> aMap(Map<Object?, Object?> arg); |
| List<Object?> aList(List<Object?> arg); |
| Int32List anInt32List(Int32List arg); |
| List<bool?> aBoolList(List<bool?> arg); |
| Map<String?, int?> aStringIntMap(Map<String?, int?> arg); |
| static void setup(PrimitiveFlutterApi? api) { |
| { |
| const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveFlutterApi.anInt', codec); |
| if (api == null) { |
| channel.setMessageHandler(null); |
| } else { |
| channel.setMessageHandler((Object? message) async { |
| assert(message != null, |
| 'Argument for dev.flutter.pigeon.PrimitiveFlutterApi.anInt was null. Expected int.'); |
| final int input = (message as int?)!; |
| final int output = api.anInt(input); |
| return output; |
| }); |
| } |
| } |
| { |
| const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveFlutterApi.aBool', codec); |
| if (api == null) { |
| channel.setMessageHandler(null); |
| } else { |
| channel.setMessageHandler((Object? message) async { |
| assert(message != null, |
| 'Argument for dev.flutter.pigeon.PrimitiveFlutterApi.aBool was null. Expected bool.'); |
| final bool input = (message as bool?)!; |
| final bool output = api.aBool(input); |
| return output; |
| }); |
| } |
| } |
| { |
| const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveFlutterApi.aString', codec); |
| if (api == null) { |
| channel.setMessageHandler(null); |
| } else { |
| channel.setMessageHandler((Object? message) async { |
| assert(message != null, |
| 'Argument for dev.flutter.pigeon.PrimitiveFlutterApi.aString was null. Expected String.'); |
| final String input = (message as String?)!; |
| final String output = api.aString(input); |
| return output; |
| }); |
| } |
| } |
| { |
| const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveFlutterApi.aDouble', codec); |
| if (api == null) { |
| channel.setMessageHandler(null); |
| } else { |
| channel.setMessageHandler((Object? message) async { |
| assert(message != null, |
| 'Argument for dev.flutter.pigeon.PrimitiveFlutterApi.aDouble was null. Expected double.'); |
| final double input = (message as double?)!; |
| final double output = api.aDouble(input); |
| return output; |
| }); |
| } |
| } |
| { |
| const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveFlutterApi.aMap', codec); |
| if (api == null) { |
| channel.setMessageHandler(null); |
| } else { |
| channel.setMessageHandler((Object? message) async { |
| assert(message != null, |
| 'Argument for dev.flutter.pigeon.PrimitiveFlutterApi.aMap was null. Expected Map<Object?, Object?>.'); |
| final Map<Object?, Object?> input = |
| (message as Map<Object?, Object?>?)!; |
| final Map<Object?, Object?> output = api.aMap(input); |
| return output; |
| }); |
| } |
| } |
| { |
| const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveFlutterApi.aList', codec); |
| if (api == null) { |
| channel.setMessageHandler(null); |
| } else { |
| channel.setMessageHandler((Object? message) async { |
| assert(message != null, |
| 'Argument for dev.flutter.pigeon.PrimitiveFlutterApi.aList was null. Expected List<Object?>.'); |
| final List<Object?> input = (message as List<Object?>?)!; |
| final List<Object?> output = api.aList(input); |
| return output; |
| }); |
| } |
| } |
| { |
| const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveFlutterApi.anInt32List', codec); |
| if (api == null) { |
| channel.setMessageHandler(null); |
| } else { |
| channel.setMessageHandler((Object? message) async { |
| assert(message != null, |
| 'Argument for dev.flutter.pigeon.PrimitiveFlutterApi.anInt32List was null. Expected Int32List.'); |
| final Int32List input = (message as Int32List?)!; |
| final Int32List output = api.anInt32List(input); |
| return output; |
| }); |
| } |
| } |
| { |
| const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveFlutterApi.aBoolList', codec); |
| if (api == null) { |
| channel.setMessageHandler(null); |
| } else { |
| channel.setMessageHandler((Object? message) async { |
| assert(message != null, |
| 'Argument for dev.flutter.pigeon.PrimitiveFlutterApi.aBoolList was null. Expected List<bool?>.'); |
| final List<bool?> input = (message as List<bool?>?)!; |
| final List<bool?> output = api.aBoolList(input); |
| return output; |
| }); |
| } |
| } |
| { |
| const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>( |
| 'dev.flutter.pigeon.PrimitiveFlutterApi.aStringIntMap', codec); |
| if (api == null) { |
| channel.setMessageHandler(null); |
| } else { |
| channel.setMessageHandler((Object? message) async { |
| assert(message != null, |
| 'Argument for dev.flutter.pigeon.PrimitiveFlutterApi.aStringIntMap was null. Expected Map<String?, int?>.'); |
| final Map<String?, int?> input = (message as Map<String?, int?>?)!; |
| final Map<String?, int?> output = api.aStringIntMap(input); |
| return output; |
| }); |
| } |
| } |
| } |
| } |