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
@@ -21,7 +21,7 @@ FletNavigator - Simple and fast navigator (router) for Flet (Python) that allows
21
21
Installation is quite easy: ```pip install flet_navigator```
22
22
23
23
> [!WARNING]
24
-
> FletNavigator is in active development phase + only one developers works on this project. Please, be patient and report all bugs.
24
+
> FletNavigator is in active development phase + only one developer works on this project. Please, be patient and report all bugs.
25
25
26
26
**FletNavigator Features**:
27
27
-**✨ Simple installation and very simple using.**
@@ -72,7 +72,7 @@ URL Parameters (`http://127.0.0.1:53863/second_page?id=123&etc=true`) will be re
72
72
73
73
Route should have latin alphabet (no cyrillic), route can have underscores and digits. Route can't have special characters, cyrillic alphabet & spaces. Wrong route will be removed from registered routes.
74
74
75
-
```flet_navigator::constructor:51: Warning: Wrong route name: "$my_route1У H". Allowed only digits and underscores.```
75
+
```flet_navigator::constructor:302: Warning: Wrong route name: "$my_route1У H". Allowed only digits and underscores.```
76
76
77
77
<br>
78
78
@@ -103,44 +103,41 @@ Homepage is main page, that you can set with `set_homepage`, and navigate with `
103
103
-`appbars: dict[int, Control] = {}` - Dictionary of appbars for each page (ID).
-`navigate(route: str, page: Page, args: tuple[Any]=None) -> None` - Navigate to specific route. Specify `args` to transfer arguments to other page.
108
-
-`navigate_homepage(page: Page, args: tuple[Any]=None) -> None` - Navigate to homepage.
109
-
-`render(page: Page, args: tuple[Any]=None) -> None` - Render current route. If there is no route like that throw ROUTE-404 (if specified). Should be called only one time.
110
-
-`set_route_data(self, route: str, data: Any) -> int` - Set route data (cookies-like mechanism). Returns success/fail. More <ahref="https://github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
111
-
-`get_route_data(self, route: str) -> Any` - Get route data. More <ahref="https://github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
-`navigate(route: str, page: Page, args: Arguments=None) -> None` - Navigate to specific route. Specify `args` to transfer arguments to other page.
108
+
-`navigate_homepage(page: Page, args: Arguments=None) -> None` - Navigate to homepage.
109
+
-`render(page: Page, args: Arguments=None) -> None` - Render current route. If there is no route like that throw ROUTE-404 (if specified). Should be called once.
110
+
-`set_route_data(route: str, data: Any) -> int` - Set route data (cookies-like mechanism). Returns success/fail. More <ahref="https://github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
111
+
-`get_route_data(route: str) -> Any` - Get route data. More <ahref="https://github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
112
112
-`set_homepage(self, homepage: str) -> None` - Set homepage (main page). More <ahref="https://github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
113
113
114
114
Using example:
115
115
116
116
```python
117
-
from flet import app, Page, Text
117
+
from flet import app, Page, Text, FilledButton
118
118
119
-
from flet_navigator import VirtualFletNavigator, PageData, ROUTE_404
119
+
from flet_navigator import VirtualFletNavigator, PageData, ROUTE_404, route
120
120
121
121
122
+
@route('/')
122
123
defmain_page(pg: PageData) -> None:
123
-
pg.page.add(Text('Main page!'))
124
+
pg.add(FilledButton('Navigate to second page.', on_click=lambda_: pg.navigator.navigate('second_page', pg.page)))
-`navigate(route: str, page: Page, args: tuple[Any]=None, parameters: dict=None) -> None` - Navigate to specific route. Specify `args` to transfer arguments to other page.
-`navigate(route: str, page: Page, args: Arguments=None, parameters: dict=None) -> None` - Navigate to specific route. Specify `args` to transfer arguments to other page. Specify `parameters` to add URL parameters.
-`render(page: Page, args: tuple[Any]=None, route_parameters: dict[str, Any]={}) -> None` - Render current route. If there is no route like that throw ROUTE-404 (if specified). Should be called only one time.
164
161
-`set_route_data(route: str, data: Any) -> int` - Set route data (cookies-like mechanism). Returns success/fail. More <ahref="https://github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
165
162
-`get_route_data(route: str) -> Any` - Get route data. More <ahref="https://github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
@@ -168,34 +165,30 @@ app(target=main)
168
165
Using example:
169
166
170
167
```python
171
-
from flet import app, Page, Text, WEB_BROWSER
168
+
from flet import app, Page, Text, FilledButton, WEB_BROWSER
172
169
173
-
from flet_navigator import FletNavigatorROUTE_404
170
+
from flet_navigator import FletNavigator, PageData, ROUTE_404, route
174
171
175
172
173
+
@route('/')
176
174
defmain_page(pg: PageData) -> None:
177
-
pg.page.add(Text('Main page!'))
175
+
pg.add(FilledButton('Navigate to second page.', on_click=lambda_: pg.navigator.navigate('second_page', pg.page)))
0 commit comments