addCreditCard method

Future<void> addCreditCard (
  1. CreditCardCreationRequest req
)

Implementation

Future<void> addCreditCard(CreditCardCreationRequest req) async {
  try {
    status = DataBackendStatus.LOADING;
    notifyListeners();
    await addCreditCardToDatabase(req);
    creditCardsDirty = true;
    status = DataBackendStatus.OUTDATED;
    notifyListeners();
    status = DataBackendStatus.OUTDATED;
    notifyListeners();
  } catch (err) {
    print(err.toString());
    status = DataBackendStatus.ERROR;
    notifyListeners();
  }
}