Skip to content

Aliases

AnimationValue #

AnimationValue = Union[bool, int, Animation]

BadgeValue #

BadgeValue = Union[str, Badge]

BlurValue #

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

BorderRadiusValue #

BorderRadiusValue = Union[Number, BorderRadius]

BorderSideStrokeAlignValue #

BorderSideStrokeAlignValue = Union[
    BorderSideStrokeAlign, Number
]

BoxShadowValue #

BoxShadowValue = Union[BoxShadow, list[BoxShadow]]

ColorValue #

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.

ControlEvent #

ControlEvent = Event['BaseControl']

ControlEventHandler #

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

ControlStateValue #

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

DateTimeValue #

DateTimeValue = Union[datetime, date]

DurationValue #

DurationValue = Union[Duration, int]

EventControlType #

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

EventHandler #

EventHandler = Union[
    Callable[[], Any], Callable[[EventType], Any]
]

IconData #

Bases: IntEnum

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.

random #

random(
    exclude: list[T] | None = None,
    weights: dict[T, int] | None = None,
) -> T | None

Selects a random icon from the subclass enum, with optional exclusions and weights.

IconDataOrControl #

IconDataOrControl = Union[IconData, 'Control']

KeyValue #

MarginValue #

MarginValue = Union[Number, Margin]

Number #

Number = Union[int, float]

OffsetValue #

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

PaddingValue #

PaddingValue = Union[Number, Padding]

ResponsiveNumber #

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

RotateValue #

RotateValue = Union[Number, Rotate]

ScaleValue #

ScaleValue = Union[Number, Scale]

StrOrControl #

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.

TooltipValue #

TooltipValue = Union[str, Tooltip]