This commit is contained in:
Michael S. 2024-06-11 23:11:42 +02:00
parent 70a494567a
commit 2979bc8184
5 changed files with 32 additions and 0 deletions

9
README copy.md Normal file
View file

@ -0,0 +1,9 @@
# A doner Flet app
An example of a minimal Flet app.
To run the app:
```
flet run [app_directory]
```

BIN
assets/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

2
code.sh Normal file
View file

@ -0,0 +1,2 @@
cd ./doner
source .venv/bin/activate

20
main.py Normal file
View file

@ -0,0 +1,20 @@
import flet as ft
def main(page: ft.Page):
page.title = "Döner Rechner"
def d_to_g(e):
tgeld.value = str(int(tdoner.value)*int(tpreis.value))
page.update()
def g_to_d(e):
tdoner.value = str(int(tgeld.value)/int(tpreis.value))
page.update()
tpreis = ft.TextField(value=5,keyboard_type="NUMBER",scale=0.5)
tdoner = ft.TextField(on_change=d_to_g,keyboard_type="NUMBER")
tgeld = ft.TextField(on_change=g_to_d,keyboard_type="NUMBER")
page.add(ft.SafeArea(ft.Row([tpreis,ft.Text("Preis")])),
ft.Row([tdoner,ft.Text("Döner")]),
ft.Text("zu"),
ft.Row([tgeld,ft.Text("Euro")]))
ft.app(main)

1
requirements.txt Normal file
View file

@ -0,0 +1 @@
flet==0.22.*