Skip to content

Aliases

AnimationValue module-attribute #

AnimationValue = Union[bool, int, Animation]

BadgeValue module-attribute #

BadgeValue = Union[str, Badge]

BlurValue module-attribute #

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

BorderRadiusValue module-attribute #

BorderRadiusValue = Union[Number, BorderRadius]

BorderSideStrokeAlignValue module-attribute #

BorderSideStrokeAlignValue = Union[
    BorderSideStrokeAlign, Number
]

BoxShadowValue module-attribute #

BoxShadowValue = Union[BoxShadow, list[BoxShadow]]

ColorValue module-attribute #

ColorValue = Union[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['BaseControl']

ControlEventHandler module-attribute #

ControlEventHandler = Union[
    Callable[[], Any],
    Callable[[Event[EventControlType]], Any],
]

ControlStateValue module-attribute #

ControlStateValue = Union[T, dict[ControlState, T]]

DateTimeValue module-attribute #

DateTimeValue = Union[datetime, date]

DurationValue module-attribute #

DurationValue = Union[Duration, int]

EventControlType module-attribute #

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

EventHandler module-attribute #

EventHandler = Union[
    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 enum,
  • the Cupertino icon set via the CupertinoIcons enum,
  • 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

IconDataOrControl module-attribute #

IconDataOrControl = Union[IconData, 'Control']

KeyValue module-attribute #

MarginValue module-attribute #

MarginValue = Union[Number, Margin]

Number module-attribute #

Number = Union[int, float]

OffsetValue module-attribute #

OffsetValue = Union[Offset, tuple[Number, Number]]

PaddingValue module-attribute #

PaddingValue = Union[Number, Padding]

ResponsiveNumber module-attribute #

ResponsiveNumber = Union[
    dict[Union[str, ResponsiveRowBreakpoint], Number],
    Number,
]

RotateValue module-attribute #

RotateValue = Union[Number, Rotate]

ScaleValue module-attribute #

ScaleValue = Union[Number, Scale]

StrOrControl module-attribute #

StrOrControl = Union[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 = Union[str, Tooltip]