error new Control thing?!
This commit is contained in:
parent
710c865753
commit
420980649d
5 changed files with 8 additions and 44 deletions
|
@ -30,11 +30,12 @@ def main(page: ft.Page):
|
|||
page.add(settings)
|
||||
page.update()
|
||||
|
||||
#test = ft.NavigationBarDestination(icon=ft.icons.HOME, label="Home")
|
||||
page.navigation_bar = ft.NavigationBar(
|
||||
destinations=[
|
||||
ft.NavigationDestination(icon=ft.icons.HOME, label="Home"),
|
||||
ft.NavigationDestination(icon=ft.icons.HISTORY, label="History"),
|
||||
ft.NavigationDestination(icon=ft.icons.SETTINGS, label="Settings")
|
||||
ft.NavigationBarDestination(icon=ft.icons.HOME, label="Home"),
|
||||
ft.NavigationBarDestination(icon=ft.icons.HISTORY, label="History"),
|
||||
ft.NavigationBarDestination(icon=ft.icons.SETTINGS, label="Settings")
|
||||
],
|
||||
on_change=on_navigation_change,
|
||||
)
|
||||
|
|
|
@ -6,7 +6,7 @@ def get_time():
|
|||
t = datetime.now()
|
||||
return [t.year, t.month, t.day, t.hour, t.minute, t.second]
|
||||
|
||||
class History(ft.UserControl):
|
||||
class History(ft.Control):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.settings, self.history = file_handler.load(self)
|
||||
|
|
|
@ -11,7 +11,7 @@ def get_time():
|
|||
def random_emoji():
|
||||
return choice("🍎🍐🍊🍋🍌🍉🍇🍓🍈🍒🍑🍍🥝🥭🥑🍅🍆🥒🥕🥬🌽🥔🍠🌰🥜🍯🥐🍞🥖🥨🥯🧀🥚🍳🥓🧄🧅🥞🧇🍤🍗🍖🍕🌭🍔🍟🥙🌮🌯🥗🥘🍝🍜🦪🍲🍥🍣🍱🍛🍚🧆🍙🍘🍢🍡🍧🍨🍦🍰🎂🍮🍭🍬🍫🍿🍩🍪🥮🧁🥛🧈🍼☕🍵🍶🍺🍻🥂🍷🥃🍸🍹🍾🧉🧃🧊🧂🥄🍴")
|
||||
|
||||
class Home(ft.UserControl):
|
||||
class Home(ft.Control):
|
||||
def __init__(self, history_instance: History) -> None:
|
||||
super().__init__()
|
||||
self.history_instance = history_instance
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import flet as ft
|
||||
class Settings(ft.UserControl):
|
||||
class Settings(ft.Control):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
|
|
|
@ -1,38 +1 @@
|
|||
[
|
||||
[
|
||||
"\ud83e\uddc1",
|
||||
"50",
|
||||
[
|
||||
2024,
|
||||
6,
|
||||
23,
|
||||
19,
|
||||
38,
|
||||
59
|
||||
]
|
||||
],
|
||||
[
|
||||
"\ud83c\udf5d",
|
||||
"800",
|
||||
[
|
||||
2024,
|
||||
6,
|
||||
23,
|
||||
19,
|
||||
39,
|
||||
6
|
||||
]
|
||||
],
|
||||
[
|
||||
"\ud83c\udf2d",
|
||||
"5",
|
||||
[
|
||||
2024,
|
||||
6,
|
||||
23,
|
||||
19,
|
||||
39,
|
||||
22
|
||||
]
|
||||
]
|
||||
]
|
||||
[]
|
Loading…
Reference in a new issue