parent
5a4dd5e0b6
commit
79aa728ced
2 changed files with 26 additions and 8 deletions
|
@ -87,7 +87,10 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 100,
|
height: 100,
|
||||||
child: Row(children: const [
|
child: Row(children: const [
|
||||||
CircularProgressIndicator(),
|
Padding(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
Text("Přihlašuji vás")
|
Text("Přihlašuji vás")
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
|
|
|
@ -84,16 +84,31 @@ class _JidelnicekPageState extends State<JidelnicekPage> {
|
||||||
),
|
),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (!j.lzeObjednat) return;
|
if (!j.lzeObjednat) return;
|
||||||
|
showDialog(
|
||||||
widget.canteen
|
context: context,
|
||||||
.objednat(j)
|
barrierDismissible: false,
|
||||||
.then((value) => nactiJidlo())
|
builder: (_) => Dialog(
|
||||||
.catchError((o) {
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
child: Row(children: const [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
Text("Objednávám...")
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
widget.canteen.objednat(j).then((_) {
|
||||||
|
Navigator.of(context, rootNavigator: true).pop();
|
||||||
|
nactiJidlo();
|
||||||
|
}).catchError((o) {
|
||||||
|
Navigator.of(context, rootNavigator: true).pop();
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (bc) => AlertDialog(
|
builder: (bc) => AlertDialog(
|
||||||
title: const Text(
|
title: const Text(
|
||||||
"Nepodařilo se vložit jídlo na burzu"),
|
"Jídlo se nepodařilo objednat."),
|
||||||
content: Text(o.toString()),
|
content: Text(o.toString()),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
|
@ -107,7 +122,7 @@ class _JidelnicekPageState extends State<JidelnicekPage> {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onLongPress: () async {
|
onLongPress: () async {
|
||||||
if (!j.objednano) return;
|
if (!j.objednano || j.burzaUrl == null) return;
|
||||||
if (!j.naBurze) {
|
if (!j.naBurze) {
|
||||||
// pokud není na burze, radši se zeptáme
|
// pokud není na burze, radši se zeptáme
|
||||||
var d = await showDialog(
|
var d = await showDialog(
|
||||||
|
|
Reference in a new issue