-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6024ea
commit 9e140bc
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import 'package:canteenlib/canteenlib.dart'; | ||
import 'package:dotenv/dotenv.dart'; | ||
|
||
late String url; | ||
void main() async { | ||
var envSecrets = DotEnv(includePlatformEnvironment: true)..load(); | ||
Canteen canteenInstance = Canteen(envSecrets["URL"]!); | ||
url = envSecrets["URL"]!; | ||
await canteenInstance.login(envSecrets["USER"]!, envSecrets["PASS"]!); | ||
var jidelnicek = await canteenInstance.jidelnicekDen(den: DateTime(2023, 11, 15)); | ||
vytisknoutInfoOJidelnicku(jidelnicek); | ||
} | ||
|
||
void vytisknoutInfoOJidelnicku(Jidelnicek jidelnicek) { | ||
print('--------------jídelníček pro den ${jidelnicek.den}--------------'); | ||
print('počet jídel: ${jidelnicek.jidla.length}'); | ||
print(Canteen(url).parseHtmlString(jidelnicek.jidla[0].nazev)); | ||
for (int i = 0; i < jidelnicek.jidla.length; i++) { | ||
print('------------Jídlo číslo $i------------'); | ||
print('název: ${jidelnicek.jidla[i].nazev}'); | ||
print('cena: ${jidelnicek.jidla[i].cena}'); | ||
print('varianta: ${jidelnicek.jidla[i].varianta}'); | ||
print('objednáno: ${jidelnicek.jidla[i].objednano}'); | ||
print('lze objednat: ${jidelnicek.jidla[i].lzeObjednat}'); | ||
print('na burze: ${jidelnicek.jidla[i].naBurze}'); | ||
print('den: ${jidelnicek.jidla[i].den}'); | ||
for (int k = 0; k < jidelnicek.jidla[i].alergeny.length; k++) { | ||
print('alergen: ${jidelnicek.jidla[i].alergeny[k].nazev} - ${jidelnicek.jidla[i].alergeny[k].popis}'); | ||
} | ||
print('orderUrl: ${jidelnicek.jidla[i].orderUrl}'); | ||
print('burzaUrl: ${jidelnicek.jidla[i].burzaUrl}'); | ||
if (jidelnicek.jidla[i].kategorizovano != null) { | ||
print('Hlavní jídlo: ${jidelnicek.jidla[i].kategorizovano!.hlavniJidlo}'); | ||
print('pití: ${jidelnicek.jidla[i].kategorizovano!.piti}'); | ||
print('polévka: ${jidelnicek.jidla[i].kategorizovano!.polevka}'); | ||
print('Salátový bar: ${jidelnicek.jidla[i].kategorizovano!.salatovyBar}'); | ||
print('ostatní: ${jidelnicek.jidla[i].kategorizovano!.ostatni}'); | ||
} | ||
print('--------------------------------------\n\n'); | ||
} | ||
print('--------------konec jídelníčku--------------'); | ||
} | ||
|
||
void vytisknoutInfoOUzivateli(Uzivatel uzivatel) { | ||
print('Kredit: ${uzivatel.kredit}'); // získat kredit | ||
print('Jméno: ${uzivatel.jmeno}'); // získat jméno | ||
print('Příjmení: ${uzivatel.prijmeni}'); // získat příjmení | ||
print('Kategorie: ${uzivatel.kategorie}'); // získat kategorii | ||
print('Účet pro platby: ${uzivatel.ucetProPlatby}'); // získat účet pro platby | ||
print('Variabilní symbol: ${uzivatel.varSymbol}'); // získat variabilní symbol | ||
print('Specifický symbol: ${uzivatel.specSymbol}'); // získat specifický symbol | ||
print('Uživatelské jméno: ${uzivatel.uzivatelskeJmeno}'); // získat uživatelské jméno | ||
} |