UI Vylepšení (#3)

This commit is contained in:
Matyáš Caras 2022-04-25 20:35:57 +02:00
parent bf642ee9ed
commit bf183a379e
3 changed files with 132 additions and 126 deletions

View file

@ -125,6 +125,7 @@ class _LoginPageState extends State<LoginPage> {
title: const Text("Přihlášení"), title: const Text("Přihlášení"),
), ),
body: Center( body: Center(
child: SingleChildScrollView(
child: SizedBox( child: SizedBox(
width: MediaQuery.of(context).size.width - 50, width: MediaQuery.of(context).size.width - 50,
child: Column( child: Column(
@ -153,7 +154,8 @@ class _LoginPageState extends State<LoginPage> {
), ),
TextField( TextField(
autofillHints: const [AutofillHints.url], autofillHints: const [AutofillHints.url],
decoration: const InputDecoration(labelText: 'iCanteen URL'), decoration:
const InputDecoration(labelText: 'iCanteen URL'),
keyboardType: TextInputType.url, keyboardType: TextInputType.url,
controller: canteenControl, controller: canteenControl,
), ),
@ -180,10 +182,12 @@ class _LoginPageState extends State<LoginPage> {
"Snažíte se přihlásit přes nešifrované spojení HTTP, jste si jisti, že tak chcete učinit?")), "Snažíte se přihlásit přes nešifrované spojení HTTP, jste si jisti, že tak chcete učinit?")),
actions: [ actions: [
TextButton( TextButton(
onPressed: () => Navigator.pop(c, true), onPressed: () =>
Navigator.pop(c, true),
child: const Text("Ano")), child: const Text("Ano")),
TextButton( TextButton(
onPressed: () => Navigator.pop(c, false), onPressed: () =>
Navigator.pop(c, false),
child: const Text("Ne, změnit")) child: const Text("Ne, změnit"))
], ],
)); ));
@ -203,10 +207,12 @@ class _LoginPageState extends State<LoginPage> {
"Toto není oficiální aplikace k ovládání iCanteen. Autor neručí za ztráty nebo nefunkčnost v souvislosti s používáním této aplikace. Tato zpráva se znovu neukáže.")), "Toto není oficiální aplikace k ovládání iCanteen. Autor neručí za ztráty nebo nefunkčnost v souvislosti s používáním této aplikace. Tato zpráva se znovu neukáže.")),
actions: [ actions: [
TextButton( TextButton(
onPressed: () => Navigator.pop(c, true), onPressed: () =>
Navigator.pop(c, true),
child: const Text("Souhlasím")), child: const Text("Souhlasím")),
TextButton( TextButton(
onPressed: () => Navigator.pop(c, false), onPressed: () =>
Navigator.pop(c, false),
child: const Text("Nesouhlasím")) child: const Text("Nesouhlasím"))
], ],
)); ));
@ -215,8 +221,8 @@ class _LoginPageState extends State<LoginPage> {
} }
var canteen = Canteen(canteenControl.text); var canteen = Canteen(canteenControl.text);
var l = var l = await canteen.login(
await canteen.login(userControl.text, passControl.text); userControl.text, passControl.text);
if (!l) { if (!l) {
ScaffoldMessenger.of(context).hideCurrentSnackBar(); ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
@ -245,6 +251,6 @@ class _LoginPageState extends State<LoginPage> {
), ),
), ),
), ),
); ));
} }
} }

View file

@ -126,7 +126,7 @@ class _BurzaPageState extends State<BurzaPage> {
SingleChildScrollView( SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
child: SizedBox( child: SizedBox(
height: MediaQuery.of(context).size.height - 120, height: MediaQuery.of(context).size.height / 1.3,
child: Column(children: obsah), child: Column(children: obsah),
), ),
) )

View file

@ -283,7 +283,7 @@ class _JidelnicekPageState extends State<JidelnicekPage> {
.onPrimary .onPrimary
.withOpacity(0), .withOpacity(0),
child: Column(children: obsah), child: Column(children: obsah),
height: MediaQuery.of(context).size.height - 160, height: MediaQuery.of(context).size.height / 1.3,
), ),
onHorizontalDragEnd: (details) { onHorizontalDragEnd: (details) {
if (details.primaryVelocity?.compareTo(0) == -1) { if (details.primaryVelocity?.compareTo(0) == -1) {