Simple routing for the Flet framework.
Project description
FletRT
A really simple routing solution for the Flet framework, developed mainly for personal use.
Please note that this project is still incomplete and lacks many features available on flet.
Sample usage:
main.py:
import flet as ft
from fletrt import Router
def main(page: ft.Page):
Router(page, routes={
'/page-a': PageA(),
'/page-b': PageB()
}, starting_route='/page-a')
ft.app(target=main)
page_a.py:
import flet as ft
from fletrt import RouteView
class PageA(RouteView):
def body(self) -> ft.Container:
return ft.Container(
ft.Column(
controls=[
ft.Text("Hello World, from Page A!"),
ft.ElevatedButton("Go to Page B", on_click=lambda _: self._page.go('/page-b'))
]
)
)
page_b.py:
import flet as ft
from fletrt import RouteView
class PageB(RouteView):
def body(self) -> ft.Container:
return ft.Container(
ft.Column(
controls=[
ft.Text("Hello World, from Page B!"),
]
)
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fletrt-0.0.1.tar.gz
(5.7 kB
view hashes)
Built Distribution
fletrt-0.0.1-py3-none-any.whl
(6.5 kB
view hashes)