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]
]

IconValue #

IconValue = Union[str, Icons, CupertinoIcons]

Type alias for icon values.

Represents an icon and can be: - a string (icon name), - a material icon from the Icons enum, - or a Cupertino icon from the CupertinoIcons enum.

Example
>>> import flet as ft
>>> ft.Icons.ABC
>>> ft.CupertinoIcons.BACK
>>> ft.Icons.random()
>>> ft.CupertinoIcons.random()
>>> ft.Icons.random(exclude=[ft.Icons.FAVORITE, ft.Icons.SCHOOL], weights={ft.Icons.SCHOOL: 150, ft.Icons.ADJUST: 5})
>>> ft.CupertinoIcons.random(exclude=[ft.CupertinoIcons.CAMERA, ft.CupertinoIcons.TABLE], weights={ft.CupertinoIcons.TABLE: 150, ft.CupertinoIcons.PENCIL: 5})

IconValueOrControl #

IconValueOrControl = Union[IconValue, 'Control']

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]