Skip to content

Aliases

AnimationValue module-attribute #

AnimationValue = bool | int | Animation

BadgeValue module-attribute #

BadgeValue = str | Badge

BlurValue module-attribute #

BlurValue = Number | tuple[Number, Number] | Blur

BorderRadiusValue module-attribute #

BorderRadiusValue = Number | BorderRadius

BorderSideStrokeAlignValue module-attribute #

BorderSideStrokeAlignValue = BorderSideStrokeAlign | Number

BoxShadowValue module-attribute #

BoxShadowValue = BoxShadow | list[BoxShadow]

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()

ControlEvent module-attribute #

ControlEvent = Event[_BaseControlType]

ControlEventHandler module-attribute #

ControlEventHandler = (
    Callable[[], Any]
    | Callable[[Event[EventControlType]], Any]
)

ControlStateValue module-attribute #

ControlStateValue = T | dict[ControlState, T]

DateTimeValue module-attribute #

DateTimeValue = datetime | date

DurationValue module-attribute #

DurationValue = Duration | int

EventControlType module-attribute #

EventControlType = TypeVar(
    "EventControlType", bound=_BaseControlType
)

EventHandler module-attribute #

EventHandler = (
    Callable[[], Any] | Callable[[EventType], Any]
)

IconData #

Represents an icon used in the UI.

An icon can come from:

  • the Material icon set via the Icons icon collection,
  • the Cupertino icon set via the CupertinoIcons icon 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'

KeyValue module-attribute #

KeyValue = ValueKey | ScrollKey | str | int | float | bool

MarginValue module-attribute #

MarginValue = Number | Margin

Number module-attribute #

Number = int | float

OffsetValue module-attribute #

OffsetValue = Offset | tuple[Number, Number]

PaddingValue module-attribute #

PaddingValue = Number | Padding

ResponsiveNumber module-attribute #

ResponsiveNumber = (
    dict[str | ResponsiveRowBreakpoint, Number] | Number
)

RotateValue module-attribute #

RotateValue = Number | Rotate

ScaleValue module-attribute #

ScaleValue = Number | Scale

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 #

TooltipValue = str | Tooltip