deleteAccount method

Future<void> deleteAccount ()

Implementation

Future<void> deleteAccount() async {
  try {
    deleteAccountStatus = DeleteAccountStatus.DELETEING;
    notifyListeners();
    await deleteAccountFromDatabase();
    deleteAccountStatus = DeleteAccountStatus.DELETED;
    notifyListeners();
  } on CloudFunctionsException catch (cloudFuncError) {
    print(cloudFuncError.code);
    print(cloudFuncError.message);
    deleteAccountStatus = DeleteAccountStatus.ERROR;
    notifyListeners();
  } catch (err) {
    print(err.toString());
    deleteAccountStatus = DeleteAccountStatus.ERROR;
    notifyListeners();
  }
}