commit 697750055f07613bd0a2de0ec40fa12d2c1b6f4a Author: Ignace Suy Date: Sun Mar 23 21:37:01 2025 +0100 two diff --git a/README.md b/README.md new file mode 100644 index 0000000..e426d55 --- /dev/null +++ b/README.md @@ -0,0 +1,81 @@ +# FletTry1 app + +## Run the app + +### uv + +Run as a desktop app: + +``` +uv run flet run +``` + +Run as a web app: + +``` +uv run flet run --web +``` + +### Poetry + +Install dependencies from `pyproject.toml`: + +``` +poetry install +``` + +Run as a desktop app: + +``` +poetry run flet run +``` + +Run as a web app: + +``` +poetry run flet run --web +``` + +For more details on running the app, refer to the [Getting Started Guide](https://flet.dev/docs/getting-started/). + +## Build the app + +### Android + +``` +flet build apk -v +``` + +For more details on building and signing `.apk` or `.aab`, refer to the [Android Packaging Guide](https://flet.dev/docs/publish/android/). + +### iOS + +``` +flet build ipa -v +``` + +For more details on building and signing `.ipa`, refer to the [iOS Packaging Guide](https://flet.dev/docs/publish/ios/). + +### macOS + +``` +flet build macos -v +``` + +For more details on building macOS package, refer to the [macOS Packaging Guide](https://flet.dev/docs/publish/macos/). + +### Linux + +``` +flet build linux -v +``` + +For more details on building Linux package, refer to the [Linux Packaging Guide](https://flet.dev/docs/publish/linux/). + +### Windows + +``` +flet build windows -v +``` + +For more details on building Windows package, refer to the [Windows Packaging Guide](https://flet.dev/docs/publish/windows/). \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..50c906f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[project] +name = "flet-try1" +version = "0.1.0" +description = "" +readme = "README.md" +requires-python = ">=3.9" +authors = [ + { name = "Flet developer", email = "you@example.com" } +] +dependencies = [ + "flet==0.27.6" +] + +[tool.flet] +# org name in reverse domain name notation, e.g. "com.mycompany". +# Combined with project.name to build bundle ID for iOS and Android apps +org = "com.mycompany" + +# project display name that is used as an app title on Android and iOS home screens, +# shown in window titles and about app dialogs on desktop. +product = "flet-try1" + +# company name to display in about app dialogs +company = "Flet" + +# copyright text to display in about app dialogs +copyright = "Copyright (C) 2025 by Flet" + +[tool.flet.app] +path = "src" + +[tool.uv] +dev-dependencies = [ + "flet[all]==0.27.6", +] + +[tool.poetry] +package-mode = false + +[tool.poetry.group.dev.dependencies] +flet = {extras = ["all"], version = "0.27.6"} \ No newline at end of file diff --git a/src/assets/icon.png b/src/assets/icon.png new file mode 100644 index 0000000..bebc6d5 Binary files /dev/null and b/src/assets/icon.png differ diff --git a/src/assets/splash_android.png b/src/assets/splash_android.png new file mode 100644 index 0000000..8772f3f Binary files /dev/null and b/src/assets/splash_android.png differ diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..554effa --- /dev/null +++ b/src/main.py @@ -0,0 +1,25 @@ +import flet as ft +import time + + +def main(page: ft.Page): + counter = ft.Text("0", size=50, data=0) + + def increment_click(e): + counter.data += 1 + counter.value = str(counter.data) + counter.update() + + page.floating_action_button = ft.FloatingActionButton( + icon=ft.Icons.ADD, on_click=increment_click + ) + page.add(counter) + t2 = ft.Text("-", size=40) + page.add(t2) + for i in range(10): + t2.value = f"Step {i}" + page.update() + time.sleep(1) + + +ft.app(main)