Skip to content

Commit 7cf46b0

Browse files
authored
Documentation v2.3.5
Documentation v2.3.5
1 parent a727743 commit 7cf46b0

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed

flet-navigator-docs.md

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1 align="center">FletNavigator v2.2.5 Documentation.</h1>
1+
<h1 align="center">FletNavigator v2.3.5 Documentation.</h1>
22

33
<h4 align="center">Menu:</h4>
44

@@ -34,11 +34,9 @@ Installation is quite easy: ```pip install flet_navigator```
3434

3535
**FletNavigator TODO**:
3636
- **Animations between page change. (50%).**
37-
- **Fix bugs.**
3837

3938
**FletNavigator Known Bugs**:
40-
- **Unable to trace previous page when manually updating URL in browser (`_nav_route_change_handler`). (Seems like fixed).**
41-
- **Non-tested in real projects.**
39+
- **No known bugs...**
4240

4341
<hr>
4442

@@ -100,15 +98,16 @@ Homepage is main page, that you can set with `set_homepage`, and navigate with `
10098
- `routes_data: dict[str, Any] = {}` - Routes data.
10199
- `homepage: str = '/'` - Homepage (main page).
102100
- `fade_effect: bool = True` - Use fade effect when switching pages? BETA.
101+
- `appbars: dict[int, Control] = {}` - Dictionary of appbars for each page (ID).
103102
- `route_changed_handler: RouteChangedHandler = None` - Route changed handler.<br><br>
104103

105104
- `__init__(routes: dict[str, Callable[[Page, 'VirtualFletNavigator', tuple[Any], str], None]], route_changed_handler: Callable[[str], None]=None) -> None` - Initialize Virtual Flet Navigator.
106105
- `navigate(route: str, page: Page, args: tuple[Any]=None) -> None` - Navigate to specific route. Specify `args` to transfer arguments to other page.
107106
- `navigate_homepage(page: Page, args: tuple[Any]=None) -> None` - Navigate to homepage.
108107
- `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.
109-
- `set_route_data(self, route: str, data: Any) -> int` - Set route data (cookies-like mechanism). Returns success/fail.
110-
- `get_route_data(self, route: str) -> Any` - Get route data.
111-
- `set_homepage(self, homepage: str) -> None` - Set homepage (main page).
108+
- `set_route_data(self, route: str, data: Any) -> int` - Set route data (cookies-like mechanism). Returns success/fail. More <a href="github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
109+
- `get_route_data(self, route: str) -> Any` - Get route data. More <a href="github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
110+
- `set_homepage(self, homepage: str) -> None` - Set homepage (main page). More <a href="github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
112111

113112
Using example:
114113

@@ -153,15 +152,16 @@ app(target=main)
153152
- `routes_data: dict[str, Any] = {}` - Routes data.
154153
- `homepage: str = '/'` - Homepage (main page).
155154
- `fade_effect: bool = True` - Use fade effect when switching pages? BETA.
155+
- `appbars: dict[int, Control] = {}` - Dictionary of appbars for each page (ID).
156156
- `route_changed_handler: RouteChangedHandler = None` - Route changed handler.<br><br>
157157

158158
- `__init__(page: Page, routes: dict[str, Callable[[Page, 'VirtualFletNavigator', tuple[Any], str], None]], route_changed_handler: Callable[[str], None]=None) -> None` - Initialize Flet Navigator.
159159
- `navigate(route: str, page: Page, args: tuple[Any]=None) -> None` - Navigate to specific route. Specify `args` to transfer arguments to other page.
160160
- `navigate_homepage(page: Page, args: tuple[Any]=None) -> None` - Navigate to homepage (main page).
161161
- `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.
162-
- `set_route_data(route: str, data: Any) -> int` - Set route data (cookies-like mechanism). Returns success/fail.
163-
- `get_route_data(route: str) -> Any` - Get route data.
164-
- `set_homepage(homepage: str) -> None` - Set homepage (main page).
162+
- `set_route_data(route: str, data: Any) -> int` - Set route data (cookies-like mechanism). Returns success/fail. More <a href="github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
163+
- `get_route_data(route: str) -> Any` - Get route data. More <a href="github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
164+
- `set_homepage(homepage: str) -> None` - Set homepage (main page). More <a href="github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
165165

166166
Using example:
167167

@@ -206,32 +206,17 @@ app(target=main, view=WEB_BROWSER) # Non-Virtual Navigator recommended in web.
206206
- `arguments: Arguments = None` - Arguments sent from previous page.
207207
- `previous_page: str = None` - Previous page.
208208
- `parameters: dict[str, Any] = None` - URL parameters. (Always `None` if `VirtualFletNavigator` used).
209+
- `page_id: int = None` - Page ID.<br><br>
209210

210-
<hr>
211-
212-
<h3 align="center"><code>template</code></h3>
213-
214-
```template(template_definition: TemplateDefinition, page_data: PageData) -> Union[Control, None]```
215-
216-
Used to render template. Example:<br>
217-
218-
```python
219-
def go_to_button(pg: PageData, args: Arguments) -> None:
220-
pg.page.add(FilledButton(args[0], on_click=lambda _: pg.navigator.navigate(args[1], pg.page, args[2]))) # Or return FilledButton so we can do things with button later.
221-
222-
def main(pg: PageData) -> None:
223-
pg.page.add(Text('Hello World!'))
224-
225-
template(go_to_button, pg, ('Go to second page.', 'second_page', None))
226-
```
211+
- `set_appbar(appbar: Control) -> None` - Set appbar for current page. More <a href="github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>.
227212

228213
<hr>
229214

230215
<h3 align="center"><code>define_page</code></h3>
231216

232-
```define_page(path: str, name: str=None) -> Callable[[PageData], None]```
217+
```define_page(path: str, name: str=None) -> PageDefinition```
233218

234-
Used to import page from other file. Example:<br><br>
219+
Used to import page from other file. More <a href="github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>. Example:<br><br>
235220

236221
`second_page.py`
237222

@@ -279,11 +264,29 @@ define_page('second_page', 'my_second_page_name') # => my_second_page_name
279264

280265
<hr>
281266

267+
<h3 align="center"><code>template</code></h3>
268+
269+
```template(template_definition: TemplateDefinition, page_data: PageData, arguments: Arguments=None) -> Union[Control, None]```
270+
271+
Used to render template. More <a href="github.com/xzripper/flet_navigator/issues/4#issuecomment-1817908000">detailed</a>. Example:<br>
272+
273+
```python
274+
def go_to_button(pg: PageData, args: Arguments) -> None:
275+
pg.page.add(FilledButton(args[0], on_click=lambda _: pg.navigator.navigate(args[1], pg.page, args[2]))) # Or return FilledButton so we can do things with button later.
276+
277+
def main(pg: PageData) -> None:
278+
pg.page.add(Text('Hello World!'))
279+
280+
template(go_to_button, pg, ('Go to second page.', 'second_page', None)) # Out is FilledButton with text 'Go to second page.', and on click redirect to `second_page` happens.
281+
```
282+
283+
<hr>
284+
282285
<h3 align="center">Summary.</h3>
283286
Summary! Now you know difference between virtual and non-virtual navigator, how to use navigator, etc! Good luck, have fun! But remember that project isn't finished!<br><br>
284287

285288
*Developer Note*: It would be great support for me if you'd added credits for FletNavigator! Optional!
286289

287290
<hr>
288291

289-
<p align="center"><b><i>FletNavigator V2.2.5</i></b></p>
292+
<p align="center"><b><i>FletNavigator V2.3.5</i></b></p>

0 commit comments

Comments
 (0)