You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It simplifies the imports by .py files of the pages, the use is similar to the other forms of routing by FletEasy, since the AddPagesy class is used in files other than main.py.
Example of structure:
In the file ìndex.py:
importfletasftimportflet_easyasfs# We add a pageindex=fs.AddPagesy()
@index.page(route="/home", title="Flet-Easy")asyncdefindex_page(data: fs.Datasy):
returnft.View(
controls=[
ft.Text("Home page"),
],
vertical_alignment=ft.MainAxisAlignment.CENTER,
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
)
In the main.py file it should be:
frompathlibimportPathimportflet_easyasfsapp=fs.FletEasy(
route_init="/home",
path_view=Path(__file__).parent/"views",
)
# We run the applicationapp.run()
Note: The folder name can be anything, just add a correct path.
The text was updated successfully, but these errors were encountered:
It simplifies the imports by .py files of the pages, the use is similar to the other forms of routing by
FletEasy
, since theAddPagesy
class is used in files other than main.py.Example of structure:
In the file
ìndex.py
:In the main.py file it should be:
The text was updated successfully, but these errors were encountered: