This commit is contained in:
2024-04-19 16:59:43 +00:00
commit f5694011b8
16 changed files with 379 additions and 0 deletions

9
utils/__init__.py Normal file
View File

@ -0,0 +1,9 @@
from .view import AppView
from .title import Title
from .views import views_handler
__all__ = [
"AppView",
"Title",
"views_handler"
]

4
utils/title.py Normal file
View File

@ -0,0 +1,4 @@
import os
def Title(title: str):
return str(os.path.basename(title)).replace('.py', '').title()

7
utils/view.py Normal file
View File

@ -0,0 +1,7 @@
import flet as ft
class AppView(ft.View):
def __init__(self, route, controls):
super().__init__()
self.controls = controls
self.route = route

7
utils/views.py Normal file
View File

@ -0,0 +1,7 @@
from modules import Home, Settings
def views_handler(page):
return {
'/': Home(page),
'/settings': Settings(page)
}