Skip to content

FletStaticFiles

Inherits: StaticFiles

Serve Flet app static files.

Parameters:

  • assets_dir (str | None, default: None ) –

    An absolute path to app's assets directory.

  • app_name (str | None, default: None ) –

    PWA application name.

  • app_short_name (str | None, default: None ) –

    PWA application short name.

  • app_description (str | None, default: None ) –

    PWA application description.

  • web_renderer (WebRenderer, default: AUTO ) –

    Type of web renderer.

  • route_url_strategy (RouteUrlStrategy, default: PATH ) –

    Routing URL strategy.

  • no_cdn (bool, default: False ) –

    Whether not load CanvasKit, Pyodide, and fonts from CDN.

  • websocket_endpoint_path (str | None, default: None ) –

    Absolute URL of Flet app WebSocket handler. Defaults to /ws.

Properties

Methods

  • lookup_path

    Returns the index file when no match is found.

Properties#

font_manifest_json instance-attribute #

font_manifest_json = ['assets', 'FontManifest.json']

index instance-attribute #

index = ['index.html']

manifest_json instance-attribute #

manifest_json = ['manifest.json']

Methods#

lookup_path #

lookup_path(path: str) -> tuple[str, stat_result | None]

Returns the index file when no match is found.

Parameters:

  • path (str) –

    Resource path.

Returns:

  • tuple[str, stat_result | None]

    [tuple[str, os.stat_result]]: Always returns a full path and stat result.