// Autogenerated from Pigeon (v11.0.1), 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, unnecessary_import 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'; enum FilePickerType { /// Pick only image(s) image, /// Pick only video(s) video, /// Pick image(s) and video(s) imageAndVideo, /// Pick any kind of file(s) generic, } class MoxxyPickerApi { /// Constructor for [MoxxyPickerApi]. 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. MoxxyPickerApi({BinaryMessenger? binaryMessenger}) : _binaryMessenger = binaryMessenger; final BinaryMessenger? _binaryMessenger; static const MessageCodec codec = StandardMessageCodec(); /// Open either the photo picker or the generic file picker to get a list of paths that were /// selected and are accessable. If the list is empty, then the user dismissed the picker without /// selecting anything. /// /// [type] specifies what kind of file(s) should be picked. /// /// [multiple] controls whether multiple files can be picked (true) or just a single file /// is enough (false). Future> pickFiles( FilePickerType arg_type, bool arg_multiple) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyPickerApi.pickFiles', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel .send([arg_type.index, arg_multiple]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else if (replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { return (replyList[0] as List?)!.cast(); } } /// Like [pickFiles] but sets multiple to false and returns the raw binary data from the file. Future pickFileWithData(FilePickerType arg_type) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.moxxy_native.MoxxyPickerApi.pickFileWithData', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_type.index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); } else if (replyList.length > 1) { throw PlatformException( code: replyList[0]! as String, message: replyList[1] as String?, details: replyList[2], ); } else { return (replyList[0] as Uint8List?); } } }