retrieveAccounts method

  1. @override
Future<Iterable<ETAccount>> retrieveAccounts()

Retrieves all available accounts from the device.

Returns a list of ETAccount representing all accounts that have calendars. This includes Google accounts, local accounts, Exchange accounts, etc.

Throws a ETPermissionException if the user refuses to grant calendar permissions.

Throws a ETGenericException if any other error occurs during accounts retrieval.

Implementation

@override
Future<Iterable<ETAccount>> retrieveAccounts() async {
  try {
    final accounts = await _calendarApi.retrieveAccounts();
    return accounts.toETAccountList();
  } on PlatformException catch (e) {
    throw e.toETException();
  }
}