diff --git a/app/main.py b/app/main.py index 7305e91..656f4f3 100644 --- a/app/main.py +++ b/app/main.py @@ -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, ) diff --git a/app/pages/history.py b/app/pages/history.py index a275bf2..06201f4 100644 --- a/app/pages/history.py +++ b/app/pages/history.py @@ -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) diff --git a/app/pages/home.py b/app/pages/home.py index a50aedf..7666ea5 100644 --- a/app/pages/home.py +++ b/app/pages/home.py @@ -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 diff --git a/app/pages/settings.py b/app/pages/settings.py index 34703c7..afad1f2 100644 --- a/app/pages/settings.py +++ b/app/pages/settings.py @@ -1,5 +1,5 @@ import flet as ft -class Settings(ft.UserControl): +class Settings(ft.Control): def __init__(self) -> None: super().__init__() diff --git a/app/saves/history.json b/app/saves/history.json index c7bf3e2..0637a08 100644 --- a/app/saves/history.json +++ b/app/saves/history.json @@ -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 - ] - ] -] \ No newline at end of file +[] \ No newline at end of file