Skip to content

Commit a44cfe3

Browse files
authored
Update splash-test.py
The "splash" property has been deprecated in recent versions of Flet. This patch updates the code to address this issue. Additionally as per request (flet-dev#165 (comment)) the bar is now stored in a variable, and we use page.overlay.remove(my_bar) to remove it
1 parent c1b3710 commit a44cfe3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

python/controls/page/splash-test.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
from time import sleep
2-
3-
import flet
2+
import flet as ft
43
from flet import ElevatedButton, ProgressBar
54

6-
75
def main(page):
86
def button_click(e):
9-
page.splash = ProgressBar()
7+
my_bar = ProgressBar()
8+
9+
page.overlay.append(my_bar)
1010
btn.disabled = True
1111
page.update()
1212
sleep(3)
13-
page.splash = None
13+
14+
page.overlay.remove(my_bar)
1415
btn.disabled = False
1516
page.update()
1617

1718
btn = ElevatedButton("Do some lengthy task!", on_click=button_click)
18-
1919
page.add(btn)
2020

21-
22-
flet.app(target=main)
21+
ft.app(target=main)

0 commit comments

Comments
 (0)