forked from goderbauer/contact_picker
/
platform.dart
69 lines (54 loc) · 2.54 KB
/
platform.dart
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
68
69
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'email_contact.dart';
import 'full_contact/full_contact.dart';
import 'phone_contact.dart';
import 'method_channel_contact_picker.dart';
/// Interface for fluttercontactpicker package. See said package for documentation.
abstract class ContactPickerPlatform extends PlatformInterface {
/// Constructs a ContactPickerPlatform
ContactPickerPlatform() : super(token: _token);
static final Object _token = Object();
static ContactPickerPlatform _instance = MethodChannelContactPicker();
/// The default [ContactPickerPlatform] to use.
///
/// Defaults to [MethodChannelContactPicker]
static ContactPickerPlatform get instance => _instance;
/// Platform-specific plugins should set this with their own platform-specific
/// class that extends [ContactPickerPlatform] when they register themselves.
static set instance(ContactPickerPlatform instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}
bool get available =>
throw UnimplementedError('available has not been implemented');
Future<List<String>> getAvailableProperties() async =>
throw UnimplementedError(
'getAvailableProperties() has not been implemented');
Future<PhoneContact> pickPhoneContact({bool askForPermission = true}) async {
throw UnimplementedError('pickPhoneContact() has not been implemented');
}
Future<List<PhoneContact>> pickPhoneContacts(
{bool askForPermission = true, bool multiple = true}) {
throw UnimplementedError('pickPhoneContacts() has not been implemented');
}
Future<EmailContact> pickEmailContact({bool askForPermission = true}) async {
throw UnimplementedError('pickEmailContact() has not been implemented');
}
Future<List<EmailContact>> pickEmailContacts(
{bool askForPermission = true, bool multiple = true}) {
throw UnimplementedError('pickEmailContacts() has not been implemented');
}
Future<FullContact> pickFullContact({bool askForPermission = true}) {
throw UnimplementedError('pickFullContact() has not been implemented');
}
Future<List<FullContact>> pickFullContacts(
{bool askForPermission = true, bool multiple = true}) {
throw UnimplementedError('pickFullContacts() has not been implemented');
}
Future<bool> hasPermission() async {
throw UnimplementedError('hasPermission() has not been implemented');
}
Future<bool> requestPermission({bool force = false}) async {
throw UnimplementedError('hasPermission() has not been implemented');
}
}