Initial
This commit is contained in:
9
utils/__init__.py
Normal file
9
utils/__init__.py
Normal 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
4
utils/title.py
Normal 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
7
utils/view.py
Normal 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
7
utils/views.py
Normal file
@ -0,0 +1,7 @@
|
||||
from modules import Home, Settings
|
||||
|
||||
def views_handler(page):
|
||||
return {
|
||||
'/': Home(page),
|
||||
'/settings': Settings(page)
|
||||
}
|
Reference in New Issue
Block a user