doBurzy method

Future<Jidelnicek> doBurzy(
  1. Jidlo j, {
  2. int amount = 1,
})

Uloží vaše jídlo z/do burzy

Vstup:

  • j - Jídlo, které chceme dát/vzít do/z burzy | Jidlo

Výstup:

  • Aktualizovaná instance Jidlo tohoto jídla NEBO Future jako chyba

Implementation

Future<Jidelnicek> doBurzy(Jidlo j, {int amount = 1}) async {
  if (canteenInstance == null) {
    return Future.error(CanteenLibExceptions.jePotrebaSePrihlasit);
  }
  if (canteenInstance!.missingFeatures.contains(Features.burza)) {
    return Future.error(CanteenLibExceptions.featureNepodporovana);
  }
  return canteenInstance!.doBurzy(j, amount: amount);
}