Skip to content

Commit 6395e5d

Browse files
authored
Documentation.
Documentation.
1 parent ff7d5b0 commit 6395e5d

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

flet-navigator-docs.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1 align="center">FletNavigator v2.7.5 Documentation.</h1>
1+
<h1 align="center">FletNavigator v2.8.5 Documentation.</h1>
22

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

@@ -15,6 +15,7 @@
1515
- [`global_template`](#global_template)
1616
- [`render`](#render)
1717
- [`anon`](#anon)
18+
- [`anon_argless`](#anon_argless)
1819
- [Summary.](#summary)
1920

2021
<hr>
@@ -25,7 +26,7 @@ FletNavigator - Simple and fast navigator (router) for Flet (Python) that allows
2526
Installation is quite easy: ```pip install flet_navigator```
2627

2728
> [!WARNING]
28-
> ~FletNavigator is in active development phase + only one developer works on this project. Please, be patient and report all bugs.~
29+
> FletNavigator's development has been stopped, which means that the library will stop receiving updates and may break. But you can still ask for help by pulling new issue and writing down your problem. But that doesn't mean you shouldn't use this library, it's still usable, even very usable.
2930
3031
> [!NOTE]
3132
> Starting from `v2.7.5` FletNavigator is production-stable and almost completely ready to use. Any bug reports are very appreciated.
@@ -45,7 +46,7 @@ Installation is quite easy: ```pip install flet_navigator```
4546
- **NO TODO...**
4647

4748
**FletNavigator Known Bugs**:
48-
- **No flexible support for widgets like `AppBar` and others.**
49+
- **No flexible support for widgets like `AppBar` and others (not that big problem thought).**
4950

5051
<hr>
5152

@@ -221,7 +222,9 @@ def main(page: Page) -> None:
221222
- `FADE: int = 1` - Fade animation.
222223
- `SCALE: int = 2` - Scale animation.
223224
- `SHRINK: int = 3` - Shrink animation.
224-
- `ROTATE: int = 4` - Rotate animation.
225+
- `SHRINK_VERTICAL: int = 4` - Vertical shrink animation.
226+
- `ROTATE: int = 5` - Rotate animation.
227+
- `CUSTOM: int = 6` - Custom animation.
225228
- `SMOOTHNESS_1: list[float] = [0.9, 0.0]` - Smoothness level 1.
226229
- `SMOOTHNESS_2: list[float] = [0.9, 0.8, 0.0]` - Smoothness level 2.
227230
- `SMOOTHNESS_3: list[float] = [0.9, 0.8, 0.7, 0.0]` - Smoothness level 3.
@@ -238,8 +241,21 @@ def main(page: Page) -> None:
238241
- `optimized_delay: float = 0.001` - Animation optimized delay (when a lot of controls on the page).
239242
- `optimization_threshold: int = 5` - Optimization threshold (maximal amount of controls that force optimized delay using instead of simple delay).<br><br>
240243

244+
- `set_custom_animation(animation: Callable[[Control, float, float], None]) -> None` - Set custom out animation. See the example below.
241245
- `animate_out(page: Page, page_widgets: list[Control]) -> None` - Play out animation. Basically shouldn't be called by user.
242246

247+
Custom animation example
248+
```python
249+
# Takes current control (widget), multiplication value, and calculated smoothness value.
250+
def my_animation(control: Control, mult: float, smoothess: float) -> None:
251+
control.scale = Scale(scale=control.scale.scale if control.scale else 1)
252+
253+
control.scale.scale += mult * 0.1
254+
255+
anim = NavigatorAnimation(NavigatorAnimation.CUSTOM);
256+
anim.set_custom_animation(my_animation)
257+
```
258+
243259
<hr>
244260

245261
<h3 align="center"><code>route</code></h3>
@@ -392,11 +408,26 @@ app(anon(render)) # instead of app(lambda page: render(page))
392408

393409
<hr>
394410

411+
<h3 align="center">anon_argless</h3>
412+
413+
```anon_argless(function: Callable, args: Arguments=(), **kwargs: dict) -> Callable```
414+
415+
Turns function into argument-less lambda: `lambda: function(*args, **kwargs)`.
416+
417+
```python
418+
pg.add(FilledButton("Hello World!", on_click=anon(pg.navigate_homepage)))
419+
```
420+
421+
<hr>
422+
395423
<h3 align="center">Summary.</h3>
396-
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>
424+
Good luck and have fun using this library!
425+
426+
<a href="https://github.com/xzripper/flet_navigator/pulls">Make your contribution.</a><br>
427+
<a href="https://github.com/xzripper/flet_navigator/issues/new/choose">Report bug.</a>
397428

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

400431
<hr>
401432

402-
<p align="center"><b><i>FletNavigator V2.7.5</i></b></p>
433+
<p align="center"><b><i>FletNavigator V2.8.5</i></b></p>

0 commit comments

Comments
 (0)