Aliases
AppCallable
module-attribute
#
Type alias for Flet app lifecycle callbacks.
Represents a callable (synchronous or asynchronous) that accepts a single argument of
type Page. The return value is ignored.
Used for both main and before_main handlers.
Type alias for Flet app lifecycle callbacks.
Represents a callable (synchronous or asynchronous) that accepts a single argument of
type Page. The return value is ignored.
Used for both main and before_main handlers.
AnimationValue
module-attribute
#
Type alias for animation configuration values.
Represents animation input as either:
- True or False to enable or disable animation,
- an int duration in milliseconds,
- or an explicit Animation configuration.
Type alias for animation configuration values.
Represents animation input as either:
- True or False to enable or disable animation,
- an int duration in milliseconds,
- or an explicit Animation configuration.
BadgeValue
module-attribute
#
Type alias for badge content values.
Represents a badge as either:
- a str value, rendered as a text label badge,
- or a Badge.
Type alias for badge content values.
Represents a badge as either:
- a str value, rendered as a text label badge,
- or a Badge.
BlurValue
module-attribute
#
Type alias for blur configuration values.
Represents blur as either:
- a single sigma value applied to both axes,
- a (sigma_x, sigma_y) tuple,
- or an explicit Blur object.
Type alias for blur configuration values.
Represents blur as either:
- a single sigma value applied to both axes,
- a (sigma_x, sigma_y) tuple,
- or an explicit Blur object.
BorderRadiusValue
module-attribute
#
BorderRadiusValue = Number | BorderRadius
Type alias for border radius values.
Represents radius as either:
- a single numeric radius applied to all corners,
- or an explicit BorderRadius configuration.
Type alias for border radius values.
Represents radius as either:
- a single numeric radius applied to all corners,
- or an explicit BorderRadius configuration.
BorderSideStrokeAlignValue
module-attribute
#
BorderSideStrokeAlignValue = BorderSideStrokeAlign | Number
Type alias for border stroke alignment values.
Represents stroke alignment as either:
- a BorderSideStrokeAlign enum value,
- or a numeric alignment value.
Type alias for border stroke alignment values.
Represents stroke alignment as either:
- a BorderSideStrokeAlign enum value,
- or a numeric alignment value.
BoxShadowValue
module-attribute
#
ColorValue
module-attribute
#
ColorValue = str | Colors | CupertinoColors
Type alias for color values.
Represents a color and can be:
- a string (representing a color name or hex value),
- a material color from the Colors enum,
- or a Cupertino color from the CupertinoColors enum.
More information here.
Type alias for color values.
Represents a color and can be:
- a string (representing a color name or hex value),
- a material color from the Colors enum,
- or a Cupertino color from the CupertinoColors enum.
More information here.
context
module-attribute
#
context = Context()
Global context object for the running Flet app.
Use flet.context to access the current page and control
auto-update behavior inside callbacks.
Global context object for the running Flet app.
Use flet.context to access the current page and control
auto-update behavior inside callbacks.
ControlEvent
module-attribute
#
ControlEvent = Event[_BaseControlType]
Type alias for an event emitted by any base control.
Type alias for an event emitted by any base control.
ControlEventHandler
module-attribute
#
Type alias for typed control event callback handlers.
Represents a callback that accepts either:
- no arguments,
- or a typed Event for a specific control type.
Type alias for typed control event callback handlers.
Represents a callback that accepts either:
- no arguments,
- or a typed Event for a specific control type.
ControlStateValue
module-attribute
#
ControlStateValue = T | dict[ControlState, T]
Type alias for state-dependent control values.
Represents either:
- a single value applied to all (supported) states,
- or a mapping from ControlState to per-state values.
Type alias for state-dependent control values.
Represents either:
- a single value applied to all (supported) states,
- or a mapping from ControlState to per-state values.
DateTimeValue
module-attribute
#
Type alias for date/time values.
Represents either a datetime or a date.
Type alias for date/time values.
Represents either a datetime or a date.
DurationValue
module-attribute
#
Type alias for duration values.
Represents duration as either:
- a Duration object,
- or an integer number of milliseconds (or seconds, depending on context).
Type alias for duration values.
Represents duration as either:
- a Duration object,
- or an integer number of milliseconds (or seconds, depending on context).
EventControlType
module-attribute
#
EventControlType = TypeVar(
"EventControlType", bound=_BaseControlType
)
Type variable bound to a control type for typed event payloads.
Type variable bound to a control type for typed event payloads.
EventHandler
module-attribute
#
Type alias for generic event callback handlers.
Represents a callback that accepts either:
- no arguments,
- or an Event-derived payload.
Type alias for generic event callback handlers.
Represents a callback that accepts either:
- no arguments,
- or an Event-derived payload.
IconData
#
Represents an icon used in the UI.
An icon can come from:
- the Material icon set via the
Iconsicon collection, - the Cupertino icon set via the
CupertinoIconsicon collection, - or a custom icon set defined by the developer.
Internally, an icon is stored as an integer that encodes icon's index in its originating code set.
Encoding structure:
- Lower 16 bits (bits 0-15): the icon's index.
- Third byte (bits 16-24): the icon set identifier (set ID), which distinguishes between icon sets like Material, Cupertino, etc.
This encoding scheme allows a single integer to uniquely represent any icon across multiple icon sets.
Inherits: IntEnum
Methods
-
random–Selects a random icon from the subclass enum, with optional exclusions and weights.
IconDataOrControl
module-attribute
#
IconDataOrControl = IconData | 'Control'
Type alias for icon-like values.
Represents either:
- an IconData value
(for example, a member of Icons or CupertinoIcons),
- or a custom icon Control.
Type alias for icon-like values.
Represents either:
- an IconData value
(for example, a member of Icons or CupertinoIcons),
- or a custom icon Control.
KeyValue
module-attribute
#
MarginValue
module-attribute
#
Type alias for margin values.
Represents margin as either:
- a single numeric value applied to all sides,
- or an explicit Margin configuration.
Type alias for margin values.
Represents margin as either:
- a single numeric value applied to all sides,
- or an explicit Margin configuration.
Type alias for numeric values (int or float).
OffsetValue
module-attribute
#
Type alias for offset values.
Represents offset as either:
- an Offset object,
- or an (x, y) tuple.
Type alias for offset values.
Represents offset as either:
- an Offset object,
- or an (x, y) tuple.
PaddingValue
module-attribute
#
Type alias for padding values.
Represents padding as either:
- a single numeric value applied to all sides,
- or an explicit Padding configuration.
Type alias for padding values.
Represents padding as either:
- a single numeric value applied to all sides,
- or an explicit Padding configuration.
ResponsiveNumber
module-attribute
#
ResponsiveNumber = (
dict[str | ResponsiveRowBreakpoint, Number] | Number
)
Type alias for responsive numeric values.
Represents either:
- a single numeric value used for all breakpoints,
- or a breakpoint-to-value mapping keyed by string or
ResponsiveRowBreakpoint.
Type alias for responsive numeric values.
Represents either:
- a single numeric value used for all breakpoints,
- or a breakpoint-to-value mapping keyed by string or
ResponsiveRowBreakpoint.
RotateValue
module-attribute
#
Type alias for rotation values.
Represents rotation as either:
- a numeric angle in radians,
- or an explicit Rotate transform.
Type alias for rotation values.
Represents rotation as either:
- a numeric angle in radians,
- or an explicit Rotate transform.
ScaleValue
module-attribute
#
Type alias for scale values.
Represents scale as either:
- a numeric uniform scale factor,
- or an explicit Scale transform.
Type alias for scale values.
Represents scale as either:
- a numeric uniform scale factor,
- or an explicit Scale transform.
StrOrControl
module-attribute
#
StrOrControl = str | 'Control'
Type alias for string or control values.
Represents a string or a control and can be:
- a string, which will be converted internally into a Text control,
- or a control.
Type alias for string or control values.
Represents a string or a control and can be:
- a string, which will be converted internally into a Text control,
- or a control.
TooltipValue
module-attribute
#
Type alias for tooltip values.
Represents a tooltip as either:
- a str message,
- or a Tooltip.
Type alias for tooltip values.
Represents a tooltip as either:
- a str message,
- or a Tooltip.