Skip to content

Commit

Permalink
feat: add stub for getting a contact photo
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothvino42 committed Dec 15, 2023
1 parent 19e7e7a commit b4a295c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/framework/stub/contacts_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import 'package:flutter/foundation.dart';

typedef ContactSuccessCallback = void Function(List<Contact> contacts);
typedef ContactErrorCallback = void Function(dynamic);
typedef ContactPhotoSuccessCallback = void Function(Uint8List);
typedef ContactPhotoErrorCallback = void Function(dynamic);

abstract class ContactManager {
void getPhoneContacts(
ContactSuccessCallback onSuccess, ContactErrorCallback onError);

Future<void> getContactPhoto(String id, ContactPhotoSuccessCallback onSuccess,
ContactPhotoErrorCallback onError);
Future<bool> requestPermission();
}

Expand All @@ -19,6 +22,13 @@ class ContactManagerStub extends ContactManager {
"Phone Contact Service is not enabled. Please review the Ensemble documentation.");
}

@override
Future<void> getContactPhoto(String id, ContactPhotoSuccessCallback onSuccess,
ContactPhotoErrorCallback onError) {
throw ConfigError(
"Phone Contact Service is not enabled. Please review the Ensemble documentation.");
}

@override
Future<bool> requestPermission() {
throw ConfigError(
Expand Down

0 comments on commit b4a295c

Please sign in to comment.