doBurzy method
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);
}