diff --git a/README copy.md b/README copy.md new file mode 100644 index 0000000..137bffe --- /dev/null +++ b/README copy.md @@ -0,0 +1,9 @@ +# A doner Flet app + +An example of a minimal Flet app. + +To run the app: + +``` +flet run [app_directory] +``` \ No newline at end of file diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 0000000..d0bc6f1 Binary files /dev/null and b/assets/icon.png differ diff --git a/code.sh b/code.sh new file mode 100644 index 0000000..ba0ad10 --- /dev/null +++ b/code.sh @@ -0,0 +1,2 @@ +cd ./doner +source .venv/bin/activate diff --git a/main.py b/main.py new file mode 100644 index 0000000..d3cb2cd --- /dev/null +++ b/main.py @@ -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) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d54c7ec --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +flet==0.22.* \ No newline at end of file