This repository has been archived on 2023-10-14. You can view files and clone it, but cannot push or open issues or pull requests.
canteenlib/example/canteenlib_example.dart
Matyáš Caras 592f79f178 Future.error
2022-03-30 15:56:42 +02:00

21 lines
598 B
Dart

import 'package:canteenlib/canteenlib.dart';
void main(List<String> args) {
Canteen c = Canteen("https://kantyna.neco.cz");
c.login("uzivatel", "heslo").then((value) {
c.jidelnicekDen(den: DateTime.parse("2022-04-04")).then((t) async {
print((await c.ziskejUzivatele()).kredit);
c.objednat(t.jidla[0]).then(
(value) {
t.jidla[0] = value; // divně udělané ale nic lepšího teď nevymyslím
print(t.jidla[0].objednano);
print(t.jidla[0].orderUrl);
},
);
});
}).catchError((o) {
print(o);
return null;
});
}