Compare commits
5 Commits
Unifty-App
...
3f10d8049a
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f10d8049a | |||
| 8e9d57c5cb | |||
| ff32de4ac0 | |||
| b137fcb0f9 | |||
| dfca9bf2ed |
@@ -1,5 +1,5 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "Meal Picker"
|
name = "NoteNook"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "An app designed to build, store, and select meals for shopping purposes."
|
description = "An app designed to build, store, and select meals for shopping purposes."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@@ -18,7 +18,7 @@ org = "codes.kalar"
|
|||||||
|
|
||||||
# project display name that is used as an app title on Android and iOS home screens,
|
# project display name that is used as an app title on Android and iOS home screens,
|
||||||
# shown in window titles and about app dialogs on desktop.
|
# shown in window titles and about app dialogs on desktop.
|
||||||
product = "Meal Picker"
|
product = "NoteNook"
|
||||||
|
|
||||||
# company name to display in about app dialogs
|
# company name to display in about app dialogs
|
||||||
company = "Nick Kalar"
|
company = "Nick Kalar"
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ from dotenv import load_dotenv
|
|||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
file_path = os.getenv("FILE_PATH") + "/checklist.md" if os.getenv("FILE_PATH") else "./checklist.md"
|
checklist_file_path = os.getenv("FILE_PATH") + "/checklist.md" if os.getenv("FILE_PATH") else "./checklist.md"
|
||||||
|
|
||||||
|
ingredients_file_path = "./src/json/ingredients.json"
|
||||||
|
|
||||||
def read_json() -> dict:
|
def read_json() -> dict:
|
||||||
try:
|
try:
|
||||||
with open("./src/json/ingredients.json", "rt") as file:
|
with open(ingredients_file_path, "rt") as file:
|
||||||
return json.load(file)
|
return json.load(file)
|
||||||
except:
|
except:
|
||||||
print("Could not find or read file.")
|
print("Could not find or read file.")
|
||||||
@@ -17,7 +19,7 @@ def read_json() -> dict:
|
|||||||
|
|
||||||
def update_json(meals: dict) -> None:
|
def update_json(meals: dict) -> None:
|
||||||
try:
|
try:
|
||||||
with open("./src/json/ingredients.json", "w") as file:
|
with open(ingredients_file_path, "w") as file:
|
||||||
json.dump(meals, file, indent=4)
|
json.dump(meals, file, indent=4)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Unable to write data to file. {e}")
|
print(f"Unable to write data to file. {e}")
|
||||||
@@ -44,7 +46,7 @@ def combine_ingredients(meals: dict) -> dict:
|
|||||||
|
|
||||||
def write_checklist(data: dict) -> None:
|
def write_checklist(data: dict) -> None:
|
||||||
try:
|
try:
|
||||||
with open(file_path, 'w') as checklist:
|
with open(checklist_file_path, 'w') as checklist:
|
||||||
for ingredient, details in data.items():
|
for ingredient, details in data.items():
|
||||||
s = ingredient + " - " + str(details['quantity'])
|
s = ingredient + " - " + str(details['quantity'])
|
||||||
if details['units'] != None:
|
if details['units'] != None:
|
||||||
|
|||||||
BIN
src/assets/hamburger.png
Normal file
BIN
src/assets/hamburger.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
10
src/main.py
10
src/main.py
@@ -5,12 +5,14 @@ from models.MenuBar import create_menubar
|
|||||||
|
|
||||||
|
|
||||||
def main(page: ft.Page):
|
def main(page: ft.Page):
|
||||||
|
page.window.width = 750
|
||||||
|
page.window.height = 900
|
||||||
|
page.window.top = 10
|
||||||
page.appbar = create_menubar(page, selector, builder)
|
page.appbar = create_menubar(page, selector, builder)
|
||||||
|
page.bgcolor = '#013328'
|
||||||
|
|
||||||
page.add(ft.Pagelet(
|
page.add(ft.Pagelet(content=ft.Text()))
|
||||||
content = ft.Text("Welcome to Meal Picker! Please select an option from the menu above to get started.")
|
selector(page)
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
ft.app(main)
|
ft.app(main)
|
||||||
@@ -2,15 +2,17 @@ import flet as ft
|
|||||||
|
|
||||||
def create_menubar(page: ft.Page, selector, builder):
|
def create_menubar(page: ft.Page, selector, builder):
|
||||||
menu = ft.AppBar(
|
menu = ft.AppBar(
|
||||||
title=ft.Text("Meal Picker"),
|
title=ft.Text("NoteNook"),
|
||||||
bgcolor=ft.Colors.GREEN_700,
|
bgcolor='#CC8B65',
|
||||||
center_title=False,
|
center_title=False,
|
||||||
actions=[
|
actions=[
|
||||||
ft.PopupMenuButton(
|
ft.PopupMenuButton(
|
||||||
items=[
|
items=[
|
||||||
ft.PopupMenuItem(text="Meal Selector", on_click=lambda e: selector(page)),
|
ft.PopupMenuItem(text="Meal Selector", on_click=lambda e: selector(page)),
|
||||||
ft.PopupMenuItem(text="Meal Builder", on_click=lambda e: builder(page)),
|
ft.PopupMenuItem(text="Meal Builder", on_click=lambda e: builder(page)),
|
||||||
]
|
],
|
||||||
|
icon = ft.Icons.FASTFOOD_OUTLINED,
|
||||||
|
icon_color = '#E3DCD2'
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user