Saving and retreiving a string value from client storage adds quotation marks
See original GitHub issueDescription
Saving and retreiving a string value from the client storage adds quotation marks around it.
Code example to reproduce the issue:
import flet
from flet import Page, TextField
class MyApp:
@staticmethod
def static_run(page: Page) -> None:
MyApp(page)
def __init__(self, page: Page):
self.page: Page = page
self.text_field = TextField(label="Value Store", value=self.get_text(), on_submit=self.save_text)
self.page.add(self.text_field)
self.text_field.focus()
def get_text(self) -> str:
key = "text"
if self.page.client_storage.contains_key(key):
return self.page.client_storage.get(key)
else:
return "Enter some text here."
def save_text(self, e):
key = "text"
self.page.client_storage.set(key, self.text_field.value)
if __name__ == '__main__':
flet.app(target=MyApp.static_run, assets_dir="assets")
# flet.app(target=MyApp.static_run, assets_dir="assets", view=flet.WEB_BROWSER, port=8080)
Describe the results you received:
- Start the application
- Enter some text and press enter to save it to client storage
3. Stop and reopen the app. There are now quotations around the text
Flet version (pip show flet
):
Version: 0.1.63
Operating system:
Arch Linux x86
Additional environment details:
I am using a venv
with these requirements installed:
flet
py-staticmaps[cairo]
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
HTML5 localstorage adding in double quotes - Stack Overflow
localStorage always store the string data with double quotes, when you are retrieving the same data you will get with double quotes.
Read more >Stores double quotes as part of a string · Issue #174 - GitHub
In one part of my app I am storing a string in localStorage to correctly set the app theme on page load const...
Read more >Why you may need quotation marks in CSV files?
In CSV files, quotation marks function as text qualifiers. This means that they define what text should be stored as a single value...
Read more >Understanding Quotation Marks in PowerShell - Scripting Blog
Windows PowerShell can't recognize a string value unless delimiters (or boundaries) are defined by the user. In Windows PowerShell, single and ...
Read more >MySQL 8.0 Reference Manual :: 9.1.1 String Literals
In certain client environments, it may also be necessary to escape NUL or Control+Z. The mysql client truncates quoted strings containing NUL characters...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It will be closed automatically when PR is merged.
Fixed in the next release coming later this week.
For workaround unwrap the value with
json.loads()
, for example: