flet icon indicating copy to clipboard operation
flet copied to clipboard

Replace Appstartup screen with a Custom Flutter Widget

Open HappyCoder256 opened this issue 1 year ago • 1 comments

Duplicate Check

  • [x] I have searched the opened issues and there are no duplicates

Describe the requested feature

I want to produce my own startup screen instead of the progress ring with a text. I want to add my own flutter widget through the build template.

Suggest a solution

Atleast can u put the startup screen mechanism in the flet build template instead putting it in the main flet package.

Screenshots

No response

Additional details

No response

HappyCoder256 avatar May 24 '25 00:05 HappyCoder256

Implemented in Flet 0.86.0+ through #6616.

You can now replace the boot/startup screen with your own Flutter widget through a Flet extension. This screen appears while the packaged app is starting, before the first Python-driven page is displayed, and can contain your own layout, branding, and animations.

To use this:

  1. Override FletExtension.createBootScreen() in your extension’s Dart code and return your custom widget for a chosen name.

  2. Add the extension to your app’s dependencies.

  3. Select that name in the app’s pyproject.toml:

    [tool.flet.boot_screen]
    name = "my_screen"
    
    [tool.flet.boot_screen.my_screen]
    bgcolor = "#101020"
    

    my_screen must match the name handled by your extension. The second table contains options passed to your widget.

  4. Rebuild the app with flet build <platform> to include the extension and configuration.

The widget receives startup status updates, including the preparation/startup stage and any startup error. Flet manages removing the boot screen when the app is ready. The custom boot-screen guide includes a complete implementation.

For a working example, see the SpinKit boot screen and its Flutter widget source. You can also use that animated loader directly by adding flet-spinkit as a dependency and selecting name = "spinkit".

ndonkoHenri avatar Sep 23 '26 11:09 ndonkoHenri