Vylepšení

This commit is contained in:
Matyáš Caras 2022-04-09 17:54:08 +02:00
parent 453b06e242
commit d106e78cb3
6 changed files with 111 additions and 86 deletions

7
CHANGELOG.md Normal file
View file

@ -0,0 +1,7 @@
# 0.1.1
- Přidán RefreshIndicator na obrazovku s jídelníčkem
- Přidáno odsazení od okrajů u jídelníčku
- Domovská obrazovka nyní zobrazuje zprávu, pokud na dnešní den není žádné jídlo v jídelníčku
- Upgrade knihovny
# 0.1.0
- První verze

View file

@ -49,7 +49,7 @@ class _BurzaPageState extends State<BurzaPage> {
Text("${b.pocet}x"),
TextButton(
onPressed: () {
widget.canteen.objednatZBurzy(b).then((_) {
widget.canteen.objednatZBurzy(b).then((a) {
nactiBurzu();
});
},

View file

@ -28,6 +28,14 @@ class _HomePageState extends State<HomePage> {
setState(() {
kredit = kr.kredit;
dnes = jd;
if (jd.jidla.isEmpty) {
obsah = [
const Text(
"Žádné jídlo pro dnešní den",
style: TextStyle(fontSize: 20),
)
];
}
for (var j in jd.jidla) {
if (j.objednano) jidloDnes = j;
obsah.add(
@ -99,6 +107,8 @@ class _HomePageState extends State<HomePage> {
physics: const AlwaysScrollableScrollPhysics(),
child: Center(
child: SizedBox(
child: SizedBox(
height: MediaQuery.of(context).size.height / 1.5,
child: Column(
children: [
const SizedBox(
@ -127,6 +137,7 @@ class _HomePageState extends State<HomePage> {
),
),
),
),
);
}
}

View file

@ -182,7 +182,9 @@ class _JidelnicekPageState extends State<JidelnicekPage> {
appBar: AppBar(
title: const Text('Jídelníček'),
),
body: Center(
body: RefreshIndicator(
child: Center(
child: SizedBox(
child: Column(
children: [
const SizedBox(height: 10),
@ -223,6 +225,7 @@ class _JidelnicekPageState extends State<JidelnicekPage> {
icon: const Icon(Icons.arrow_right)),
]),
SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
child: GestureDetector(
child: Column(children: obsah),
onHorizontalDragEnd: (details) {
@ -242,6 +245,10 @@ class _JidelnicekPageState extends State<JidelnicekPage> {
)
],
),
width: MediaQuery.of(context).size.width - 50,
),
),
onRefresh: nactiJidlo,
),
);
}

View file

@ -28,7 +28,7 @@ packages:
name: canteenlib
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0-alpha.13"
version: "0.1.0-alpha.14"
characters:
dependency: transitive
description:

View file

@ -6,7 +6,7 @@ publish_to: 'none'
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
version: 0.1.0+1
version: 0.1.1+2
environment:
sdk: ">=2.16.1 <3.0.0"
@ -16,7 +16,7 @@ dependencies:
sdk: flutter
flutter_localizations:
sdk: flutter
canteenlib: ^0.1.0-alpha.13
canteenlib: ^0.1.0-alpha.14
cupertino_icons: ^1.0.2
connectivity_plus: ^2.2.1
flutter_secure_storage: ^5.0.2