24 lines
612 B
Python
24 lines
612 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
import flet as ft
|
|
|
|
from app.models import Strategy
|
|
|
|
ACCENTS: dict[str, str] = {
|
|
"freeturn": "#9E9E9E",
|
|
Strategy.BASIC.value: "#8CC8FF",
|
|
Strategy.ENHANCED.value: "#E85D5D",
|
|
}
|
|
|
|
|
|
def apply_accent(page: ft.Page, key: str) -> None:
|
|
seed = ACCENTS.get(key, ACCENTS[Strategy.BASIC.value])
|
|
page.theme = ft.Theme(color_scheme_seed=seed)
|
|
page.dark_theme = ft.Theme(color_scheme_seed=seed)
|
|
page.theme_mode = ft.ThemeMode.SYSTEM
|
|
|
|
|
|
def card(content: Any) -> ft.Card:
|
|
return ft.Card(content=ft.Container(content=content, padding=16))
|