Skip to content

BaseControl

Base class for all Flet controls and services.

Properties

Methods

  • before_event

    Intercept an event before its handler is executed.

  • is_isolated

    Return whether this control is marked as isolated.

  • update

    Request a UI update for this control.

Properties#

data class-attribute instance-attribute #

data: Any = skip_field()

Arbitrary data of any type.

key class-attribute instance-attribute #

key: KeyValue | None = None

page property #

page: Page | BasePage

The page to which this control belongs to.

parent property #

parent: BaseControl | None

The direct ancestor(parent) of this control.

It defaults to None and will only have a value when this control is mounted (added to the page tree).

The Page control (which is the root of the tree) is an exception - it always has parent=None.

Methods#

before_event #

before_event(e: ControlEvent)

Intercept an event before its handler is executed.

Return False to cancel dispatch. Return True or None to continue normal event processing.

is_isolated #

is_isolated()

Return whether this control is marked as isolated.

Isolated controls are excluded from parent-driven update traversal and are expected to manage their own update boundaries.

update #

update() -> None

Request a UI update for this control.

Call after changing control state or properties. The control must be attached to a page and not marked as frozen.