I tried to use flet.page.query to pass some parameters to the page, but ran into some problems. My match page.route: path handler reads the parameter string after the ? part of the path string and I can't seem to separate them at all because it seems page.path is not a string.
Here's an example of the code I'm working on right now:
import flet as ft
import flet_fastapi
async def main(page: ft.Page):
async def route_change(route):
page.views.clear()
match page.route:
case "/page1":
page.views.append(ft.View("/page1", [
ft.Text("page1")
]))
print("---")
print(page.query.get("test"))
print("---")
def view_pop(view):
page.views.pop()
top_view = page.views[-1]
page.go(top_view.route)
page.on_route_change = route_change
page.on_view_pop = view_pop
await page.go_async(page.route)
app = flet_fastapi.app(main)
Thank you in advance=)