Skip to content

Events

Configure custom events

config_event_handler Decorator to add Flet event configurations. The decorated function must receive the [data:Datasy] parameter to be able to manipulate the app elements.

Example

  • Handle the event when the app is disconnected
@app.config_event_handler
def event_handler(data: fs.Datasy):
    page = data.page

    def on_disconnect(e):
        print("Disconnect test application")

    page.on_disconnect = on_disconnect