Flet Documentation

website·Indexed 34 days ago

https://flet.dev

Documentation for Flet, a framework to build interactive multi-platform apps in Python. It includes guides on creating desktop and web applications, mobile testing, iOS publishing, and a comprehensive reference for UI controls, types, and services such as SharedPreferences and UrlLauncher.

Tokens
528.9K
Snippets
2.9K
Records
4.3K
Agent score
72%

What's inside Flet

  1. Overview of flet.ProgressRing

    The ft.ProgressRing is a Material Design circular progress indicator used to show that an application is busy. It can be either determinate (showing a specific percentage of completion) or indeterminate (showing a continuous spinning animation).
    import flet as ft
    # A fixed progress ring at 40% completion
    ring = ft.ProgressRing(value=0.4, padding=ft.Padding.all(10))
  2. Overview of the KeyboardListener control

    The KeyboardListener control in Flet is used to detect keyboard interactions. It wraps another control (via the content property) and triggers specific event handlers when the user interacts with the keyboard while the listener has focus.
  3. Overview of Flet DragTarget

    The DragTarget control is used to complete a drag operation when a Draggable control is dropped onto it. A DragTarget will only accept a Draggable if both controls belong to the same group. The process involves the target first determining if it will accept the data (on_will_accept) and then finally accepting the data upon drop (on_accept).
  4. Overview of flet.ShareFile

    The ShareFile class represents a file to share, supporting both files stored on the local filesystem and files provided as raw in-memory bytes.
  5. Overview of CupertinoActionSheetAction

    The CupertinoActionSheetAction is an action button designed for use within a CupertinoActionSheet. It inherits from LayoutControl and allows for the definition of a button's content, visual style (default or destructive), and click behavior.
  6. Overview of InteractiveViewer

    The InteractiveViewer control allows users to pan, zoom, and rotate its content. It inherits from LayoutControl and is typically used for viewing large images or complex layouts that require navigation via gestures.
    import flet as ft
    
    # Basic usage
    ft.InteractiveViewer(content=ft.Image(src="image.jpg"))
  7. Overview of flet.auth.AuthorizationService

    The AuthorizationService is the OAuth authorization implementation used by Page.login. It coordinates the generation of authorization URLs, token exchange, token refreshing, and optional resolution of user and group information using a configured OAuthProvider.
  8. Overview of flet.Duration

    The Duration class represents a span of time (e.g., 27 days, 4 hours, 12 minutes, and 3 seconds) or the difference between two points in time. A duration can be negative if it represents a difference from a later time to an earlier one.
  9. Overview of the Flet Framework

    Flet is a Python framework used to build web, desktop, and mobile applications without requiring frontend experience in HTML, CSS, or JavaScript. It provides ready-made controls to create interfaces and connect them to Python libraries and application logic. Flet supports hot reload and can be packaged for Windows, macOS, Linux, iOS, Android, or published to the web.
  10. Overview of RawImage for high-performance pixel streaming

    The RawImage control displays pixel frames pushed from Python at full bandwidth. Unlike the standard Image control, RawImage uses a dedicated DataChannel to stream bytes, skipping MsgPack encoding/decoding.

    Transport Behavior:

    • Local transports (desktop apps, flet run, Pyodide): Frames are sent as uncompressed premultiplied RGBA8888 and uploaded directly to a GPU texture.
    • Remote transports (Web via WebSocket): Pillow and NumPy frames are PNG-encoded to save bandwidth.

    This control is recommended for animations, generated graphics, camera frames, and Pillow output requiring interactive frame rates.

  11. Overview of flet.pubsub.PubSubClient

    PubSubClient is a session-scoped facade over PubSubHub. It binds all publish and subscribe operations to a single session ID, allowing developers to perform pub/sub operations without explicitly passing the session identity in every call.