messages.dart
1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// 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.
import 'package:pigeon/pigeon.dart';
@ConfigurePigeon(PigeonOptions(
dartOut: 'lib/src/messages.g.dart',
dartTestOut: 'test/test_api.g.dart',
objcHeaderOut: 'ios/Classes/messages.g.h',
objcSourceOut: 'ios/Classes/messages.g.m',
objcOptions: ObjcOptions(
prefix: 'FLT',
),
copyrightHeader: 'pigeons/copyright.txt',
))
class MaxSize {
MaxSize(this.width, this.height);
double? width;
double? height;
}
class MediaSelectionOptions {
MediaSelectionOptions({
required this.maxSize,
this.imageQuality,
required this.requestFullMetadata,
required this.allowMultiple,
});
MaxSize maxSize;
int? imageQuality;
bool requestFullMetadata;
bool allowMultiple;
}
// Corresponds to `CameraDevice` from the platform interface package.
enum SourceCamera { rear, front }
// Corresponds to `ImageSource` from the platform interface package.
enum SourceType { camera, gallery }
class SourceSpecification {
SourceSpecification(this.type, this.camera);
SourceType type;
SourceCamera? camera;
}
@HostApi(dartHostTestHandler: 'TestHostImagePickerApi')
abstract class ImagePickerApi {
@async
@ObjCSelector('pickImageWithSource:maxSize:quality:fullMetadata:')
String? pickImage(SourceSpecification source, MaxSize maxSize,
int? imageQuality, bool requestFullMetadata);
@async
@ObjCSelector('pickMultiImageWithMaxSize:quality:fullMetadata:')
List<String?> pickMultiImage(
MaxSize maxSize, int? imageQuality, bool requestFullMetadata);
@async
@ObjCSelector('pickVideoWithSource:maxDuration:')
String? pickVideo(SourceSpecification source, int? maxDurationSeconds);
/// Selects images and videos and returns their paths.
@async
@ObjCSelector('pickMediaWithMediaSelectionOptions:')
List<String?> pickMedia(MediaSelectionOptions mediaSelectionOptions);
}