Skip to content

Better handling Flutter and platform errors #431

@FeodorFitsner

Description

@FeodorFitsner

Implementation details: https://docs.flutter.dev/testing/errors

A new page.on_error event handler has been added. It could be used to detect such errors like failed image downloads and other "unhandled" exceptions.

import flet
from flet import Image, Page, Row

def main(page: Page):
    img = Image(
        src=f"/icons1/icon-512.png" # image has an invalid URL
    )
    page.on_error = lambda e: print("Page error:", e.data)
    page.add(img)

flet.app(target=main)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions