flet icon indicating copy to clipboard operation
flet copied to clipboard

Custom splash screen

Open vv2006-mc opened this issue 1 year ago • 14 comments

every time flet loads, we get a loading page of flet icon or a loading wheel spinning. Is there a way to make a custom splash screen come up in place of the flet logo?

vv2006-mc avatar Sep 16 '22 15:09 vv2006-mc

This is exactly the issue i was about to raise! I checked the docs, but nothing.

Please HELP on this.

ndonkoHenri avatar Sep 16 '22 18:09 ndonkoHenri

you can create an assets folder then replace the elements you want in there. https://flet.dev/docs/guides/python/packaging-desktop-app#packaging-assets

hololeo avatar Sep 17 '22 15:09 hololeo

That’s for desktop apps. I mean for web apps. (For example, those made with fly.io or replit)

ndonkoHenri avatar Sep 18 '22 20:09 ndonkoHenri

https://github.com/flet-dev/examples/tree/main/python/apps/custom-loading-image I tried to follow this example. But when I implement this in my project, it doesn't work. I mean, the flet logo still shows up at the web app's launch.

ndonkoHenri avatar Sep 19 '22 20:09 ndonkoHenri

you created assets folder, and inside that icons folder, and in there the file to replace?

hololeo avatar Sep 19 '22 21:09 hololeo

Yes. Exactly. I named the file just as in the example. (loading-animation.png)

I even tried with the icon image provided in the example's assets/icon folder. But nothing.

ndonkoHenri avatar Sep 19 '22 21:09 ndonkoHenri

post your code and structure in a repo?

hololeo avatar Sep 19 '22 22:09 hololeo

Enable logging and see what's being loaded and from where:

import logging
logging.basicConfig(level=logging.DEBUG)

FeodorFitsner avatar Sep 20 '22 00:09 FeodorFitsner

It worked now. DEBU[2022-09-20T15:40:15+02:00] EmbedAssetsFS item: icons/loading-animation.png I just had to restart all from scratch(i was in hotreload mode). Just from noticing while closely looking at the logs that, any file added to my assets/icons directory(while still in HotReload) is never loaded/added. Is this a Bug or something normal @FeodorFitsner ?

So I can say briefly that, Restarting my app from scratch kind of solved the problem. Hope yours too @vv2006-mc ! Thanks y'all.

ndonkoHenri avatar Sep 20 '22 03:09 ndonkoHenri

By the way, does the name of the icon(loading-animation.png) matters. Will any other image(icon) with a different name get loaded? (what if there are several image files in this iconsdirectory? Any order of priority or something..?)

And also, is it possible to change the Animation at launch screen? By default, the image get bigger and fades away before our app's UI is shown...is it possible to change this Animation? If Yes, how please?

ndonkoHenri avatar Sep 20 '22 03:09 ndonkoHenri

post your code and structure in a repo?

https://github.com/ndonkoHenri/ToDo-App-with-Flet a personalised version of the example in the docs

ndonkoHenri avatar Sep 20 '22 03:09 ndonkoHenri

yeah hot reload works great but usually needs a reboot if you change something on init / startup. glad you got it fixed i know how those small overlooked things can drive you nuts

nice repo btw!

hololeo avatar Sep 20 '22 04:09 hololeo

is there a way to change this loading animation too? @FeodorFitsner image

vv2006-mc avatar Sep 25 '22 16:09 vv2006-mc

Ah, well, that UI is built before user app's data is loaded. I think it would be possible to customize with a custom Flet app runner which is coming soon™.

FeodorFitsner avatar Sep 25 '22 16:09 FeodorFitsner