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

21 lines
598 B
Dart
Raw Permalink Normal View History

import 'package:canteenlib/canteenlib.dart';
2022-03-28 17:04:55 +02:00
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 {
2022-03-28 20:22:43 +02:00
print((await c.ziskejUzivatele()).kredit);
2022-03-28 17:04:55 +02:00
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);
},
);
});
2022-03-30 15:56:42 +02:00
}).catchError((o) {
print(o);
return null;
});
}