From 66011974a33432d7215fc6f60dfc178f554ee75b Mon Sep 17 00:00:00 2001 From: Nicholas Kalar Date: Mon, 24 Nov 2025 21:10:35 -0500 Subject: [PATCH] Added app bar to select apps --- src/main.py | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/main.py b/src/main.py index c603ebe..0184155 100644 --- a/src/main.py +++ b/src/main.py @@ -1,26 +1,29 @@ import flet as ft +from MealBuilder import builder +from MealSelector import selector def main(page: ft.Page): - counter = ft.Text("0", size=50, data=0) - - def increment_click(e): - counter.data += 1 - counter.value = str(counter.data) - counter.update() - - page.floating_action_button = ft.FloatingActionButton( - icon=ft.Icons.ADD, on_click=increment_click - ) - page.add( - ft.SafeArea( - ft.Container( - counter, - alignment=ft.alignment.center, - ), - expand=True, - ) + main_appbar = ft.AppBar( + title=ft.Text("Meal Picker"), + bgcolor=ft.Colors.GREEN_700, + center_title=False, + actions=[ + ft.PopupMenuButton( + items=[ + ft.PopupMenuItem(text="Meal Selector", on_click=lambda e: selector(page)), + ft.PopupMenuItem(text="Meal Builder", on_click=lambda e: builder(page)), + ] + ) + ] ) + page.appbar = main_appbar -ft.app(main) + page.add(ft.Pagelet( + content = ft.Text("Welcome to Meal Picker! Please select an option from the menu above to get started.") + ) + ) + +if __name__ == "__main__": + ft.app(main) \ No newline at end of file