Files
copp/app/src/pages/main.py
2025-04-13 20:37:11 +05:00

81 lines
2.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import flet as ft
from src.base_models.text_fuild import TextField
from src.base_models.colour import color
from src.base_models.button import Button
import requests
from requests.exceptions import RequestException
class MainPage(ft.View):
def __init__(self,page:ft.Page,route:str,bgcolor:str):
self.page = page
#table=ft.DataTable(
#
#)
dd = ft.Dropdown(
label="таблица",
options=[
ft.DropdownOption(text="Сollection_form_opk")
]
)
rail = ft.NavigationRail(
selected_index=0,
label_type=ft.NavigationRailLabelType.ALL,
#extended=True,
height=1000,
min_width=100,
min_extended_width=200,
bgcolor=color[3],
group_alignment=-0.4,
destinations=[
ft.NavigationRailDestination(
icon=ft.Icons.HOME_OUTLINED,
selected_icon=ft.Icons.HOME_SHARP,
label="Home"
),
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="Second",
),
],
on_change=lambda e: print("Selected destination:", e.control.selected_index),
)
super().__init__(
route=route,
bgcolor=bgcolor,
controls=[
ft.Row(
expand=True,
controls=[
rail,
ft.VerticalDivider(width=1),
ft.Column(
alignment=ft.MainAxisAlignment.START,
expand=True,
controls=[
ft.Text("Добро пожаловать!"),
dd
],
),
]
)
]
)