flet-dev / examples

Flet sample applications
MIT License
488 stars 199 forks source link

Client storage issue I ran into, dict initialization #137

Closed drawdel closed 5 months ago

drawdel commented 6 months ago

Running the following lines of code, my original code displayed the correct attributes on desktop mac, but None on web and ios. The debug messages 'item added' and 'item in list = True' was displayed on all 3 platforms, but on web and ios it displayed None instead of the expected attributes. The fix chatgpt gave me corrected it so that it now displays the correct attributes on all platforms. What was the issue here? I'm not an experienced programmer so I don't understand what happened. Is this something about Python I don't understand or something specific to flet?

functions_item.add_item(page, 'item_name', 23, 46, 15, 6, 2) page.add(ft.Text(f"item_name has {functions_item.fetch_item_attributes(page, 'item_name')}"))

Screenshot 2024-05-28 at 9 09 59 PM Screenshot 2024-05-28 at 9 10 08 PM

Here's what ChatGPT says about the fix.

Screenshot 2024-05-28 at 9 14 57 PM
ndonkoHenri commented 6 months ago

Please share some runnable code as text here, and not image/screenshot.

drawdel commented 6 months ago

https://pastebin.com/huUV8w7E

ndonkoHenri commented 6 months ago

https://pastebin.com/huUV8w7E

The code is not runnable. Please provide some runnable code that i can easily run to test the issue and further help you.