CupertinoRadio
Basic CupertinoRadios
        Inherits: LayoutControl
Properties
- 
          active_color(ColorValue | None) –The color used to fill this radio when it is selected. 
- 
          autofocus(bool) –Whether this radio will be selected as the initial focus. 
- 
          fill_color(ColorValue | None) –The color that fills this radio. 
- 
          focus_color(ColorValue | None) –The color for the radio's border when it has the input focus. 
- 
          inactive_color(ColorValue | None) –The color used to fill this radio when it is not selected. 
- 
          label(str | None) –The clickable label to display on the right of this radio. 
- 
          label_position(LabelPosition) –The position of the label relative to this radio. 
- 
          mouse_cursor(MouseCursor | None) –The cursor for a mouse pointer when it enters or is hovering over this radio. 
- 
          toggleable(bool) –Whether this radio button can return to an indeterminate state 
- 
          use_checkmark_style(bool) –Whether the radio displays in a checkbox style instead of the default radio style. 
- 
          value(str) –The value to set to RadioGroupancestor/parent when this radio
Events
- 
          on_blur(ControlEventHandler[CupertinoRadio] | None) –Called when this radio has lost focus. 
- 
          on_focus(ControlEventHandler[CupertinoRadio] | None) –Called when this radio has received focus. 
Examples#
Cupertino, Material and Adaptive Radios#
import flet as ft
def main(page: ft.Page):
    def handle_button_click(e: ft.Event[ft.Button]):
        message.value = f"Your favorite color is:  {group.value}"
        page.update()
    page.add(
        ft.Text("Select your favorite color:"),
        group := ft.RadioGroup(
            content=ft.Column(
                controls=[
                    ft.CupertinoRadio(
                        value="red",
                        label="Red - Cupertino Radio",
                        active_color=ft.Colors.RED,
                        inactive_color=ft.Colors.RED,
                    ),
                    ft.Radio(
                        value="green",
                        label="Green - Material Radio",
                        fill_color=ft.Colors.GREEN,
                    ),
                    ft.Radio(
                        value="blue",
                        label="Blue - Adaptive Radio",
                        adaptive=True,
                        active_color=ft.Colors.BLUE,
                    ),
                ]
            )
        ),
        ft.Button(content="Submit", on_click=handle_button_click),
        message := ft.Text(),
    )
ft.run(main)
Properties#
class-attribute
      instance-attribute
  
#
active_color: ColorValue | None = PRIMARY
The color used to fill this radio when it is selected.
class-attribute
      instance-attribute
  
#
autofocus: bool = False
Whether this radio will be selected as the initial focus.
If there is more than one control on a page with autofocus set, then the first one added to the page will get focus.
class-attribute
      instance-attribute
  
#
fill_color: ColorValue | None = None
The color that fills this radio.
class-attribute
      instance-attribute
  
#
focus_color: ColorValue | None = None
The color for the radio's border when it has the input focus.
class-attribute
      instance-attribute
  
#
inactive_color: ColorValue | None = None
The color used to fill this radio when it is not selected.
class-attribute
      instance-attribute
  
#
label: str | None = None
The clickable label to display on the right of this radio.
class-attribute
      instance-attribute
  
#
label_position: LabelPosition = RIGHT
The position of the label relative to this radio.
class-attribute
      instance-attribute
  
#
mouse_cursor: MouseCursor | None = None
The cursor for a mouse pointer when it enters or is hovering over this radio.
class-attribute
      instance-attribute
  
#
toggleable: bool = False
Whether this radio button can return to an indeterminate state by selecting it again when already selected.
class-attribute
      instance-attribute
  
#
use_checkmark_style: bool = False
Whether the radio displays in a checkbox style instead of the default radio style.
class-attribute
      instance-attribute
  
#
value: str = ''
The value to set to RadioGroup ancestor/parent when this radio
is selected.
Events#
class-attribute
      instance-attribute
  
#
on_blur: ControlEventHandler[CupertinoRadio] | None = None
Called when this radio has lost focus.
class-attribute
      instance-attribute
  
#
on_focus: ControlEventHandler[CupertinoRadio] | None = None
Called when this radio has received focus.

