-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNavigationRail.py
50 lines (44 loc) · 1.44 KB
/
NavigationRail.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import flet as ft
def main(page: ft.Page):
rail = ft.NavigationRail(
selected_index=0,
label_type=ft.NavigationRailLabelType.ALL,
# extended=True,
min_width=100,
min_extended_width=400,
leading=ft.FloatingActionButton(icon=ft.Icons.CREATE, text="Add"),
group_alignment=-0.9,
destinations=[
ft.NavigationRailDestination(
icon=ft.Icons.FAVORITE_BORDER,
selected_icon=ft.Icons.FAVORITE,
label="First",
),
ft.NavigationRailDestination(
icon=ft.Icon(ft.Icons.BOOKMARK_BORDER),
selected_icon=ft.Icon(ft.Icons.BOOKMARK),
label="Second",
),
ft.NavigationRailDestination(
icon=ft.Icons.SETTINGS_OUTLINED,
selected_icon=ft.Icon(ft.Icons.SETTINGS),
label_content=ft.Text("Settings"),
),
],
on_change=lambda e: print("Selected destination:", e.control.selected_index),
)
page.add(
ft.Row(
[
rail,
ft.VerticalDivider(width=1),
ft.Column(
[ft.Text("Body!")],
alignment=ft.MainAxisAlignment.START,
expand=True,
),
],
expand=True,
)
)
ft.app(main)