error new Control thing?!

This commit is contained in:
Michael S. 2024-07-02 18:44:27 +02:00
parent 710c865753
commit 420980649d
5 changed files with 8 additions and 44 deletions

View file

@ -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,
)

View file

@ -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)

View file

@ -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

View file

@ -1,5 +1,5 @@
import flet as ft
class Settings(ft.UserControl):
class Settings(ft.Control):
def __init__(self) -> None:
super().__init__()

View file

@ -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
]
]
]
[]