-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
56 lines (50 loc) · 1.81 KB
/
main.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
51
52
53
54
55
56
"""UVT Main"""
from pathlib import Path
import flet as ft # type: ignore
import flet_easy as fs # type: ignore
from assets.app_colors import AppColors
app = fs.FletEasy(
route_init="/home",
path_views=Path(__file__).parent / "views",
)
@app.view
def view(data: fs.Datasy):
"""Main View"""
return fs.Viewsy(
appbar=ft.AppBar(
title=ft.Text("UVT"),
center_title=True,
bgcolor=ft.colors.SURFACE_VARIANT,
actions=[
ft.PopupMenuButton(
items=[
ft.PopupMenuItem(
text="Home", on_click=data.go(data.route_init)
),
ft.PopupMenuItem(
text="RJ45 Wiring Scheme", on_click=data.go("/rj45_scheme")
),
ft.PopupMenuItem(
text="Copper Color Code", on_click=data.go("/copper/color_code")
),
ft.PopupMenuItem(
text="Fiber Color Code", on_click=data.go("/fiber_color_code")
),
ft.PopupMenuItem(
text="Static IP Instructions", on_click=data.go("/uv/statics")
),
ft.PopupMenuItem(
text="Copper Pair Calculator", on_click=data.go("/copper/pair_to_color")
),
ft.PopupMenuItem(
text="Distance Calculator", on_click=data.go("/distance_calc")
),
]
),
],
),
vertical_alignment="center",
horizontal_alignment="center",
bgcolor=AppColors.BG
)
app.run()