Skip to content

Commit 122c6bd

Browse files
committed
Inline FilePicker instance in download method
Refactored the download method to instantiate FilePicker inline instead of assigning it to a variable, simplifying the code.
1 parent c4d7aa3 commit 122c6bd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/flet_charts/matplotlib_chart_with_toolbar.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,4 @@ async def download_click(self):
107107
fmt = self.download_fmt.value
108108
buffer = self.mpl.download(fmt)
109109
title = self.figure.canvas.manager.get_window_title()
110-
fp = ft.FilePicker()
111-
await fp.save_file(file_name=f"{title}.{fmt}", src_bytes=buffer)
110+
await ft.FilePicker().save_file(file_name=f"{title}.{fmt}", src_bytes=buffer)

0 commit comments

Comments
 (0)