CupertinoTimerPickerMode
Different modes of CupertinoTimerPicker.
Inherits: enum.Enum
Properties
HOUR_MINUTE- Mode that shows the timer duration in hour and minute.HOUR_MINUTE_SECONDS- Mode that shows the timer duration in hour, minute, and second.MINUTE_SECONDS- Mode that shows the timer duration in minute and second.
Examples
Showcase
import flet as ft
def showcase_card(mode: ft.CupertinoTimerPickerMode) -> ft.Container:
return ft.Container(
width=340,
padding=12,
border=ft.Border.all(1, ft.Colors.RED),
border_radius=10,
bgcolor=ft.Colors.SURFACE_CONTAINER_LOW,
content=ft.Column(
spacing=8,
controls=[
ft.Text(mode.name, weight=ft.FontWeight.BOLD),
ft.CupertinoTimerPicker(
mode=mode,
value=ft.Duration(seconds=754),
),
],
),
)
def main(page: ft.Page):
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
page.appbar = ft.AppBar(title="CupertinoTimerPickerMode Showcase")
page.add(
ft.SafeArea(
content=ft.Column(
controls=[
ft.Text("Compare timer picker layouts."),
ft.Row(
wrap=True,
spacing=12,
expand=True,
scroll=ft.ScrollMode.AUTO,
alignment=ft.MainAxisAlignment.CENTER,
controls=[
showcase_card(mode) for mode in ft.CupertinoTimerPickerMode
],
),
],
),
)
)
if __name__ == "__main__":
ft.run(main)
Properties
HOUR_MINUTEclass-attributeinstance-attribute
Mode that shows the timer duration in hour and minute.
Examples: 16 hours | 14 min
HOUR_MINUTE_SECONDSclass-attributeinstance-attribute
Mode that shows the timer duration in hour, minute, and second.
Examples: 16 hours | 14 min | 43 sec
MINUTE_SECONDSclass-attributeinstance-attribute
Mode that shows the timer duration in minute and second.
Examples: 14 min | 43 sec