Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
flet / controls / material / radio_group.py
Size: Mime:
from typing import Optional

from flet.controls.base_control import control
from flet.controls.control import Control
from flet.controls.control_event import ControlEventHandler

__all__ = ["RadioGroup"]


@control("RadioGroup")
class RadioGroup(Control):
    """
    Radio buttons let people select a single option from two or more choices.
    """

    content: Control
    """
    The content of the RadioGroup.

    Typically a list of `Radio` controls nested in a container control, e.g. `Column`,
    `Row`.
    """

    value: Optional[str] = None
    """
    Current value of the RadioGroup.
    """

    on_change: Optional[ControlEventHandler["RadioGroup"]] = None
    """
    Called when the state of the RadioGroup is changed.
    """

    def before_update(self):
        super().before_update()
        assert self.content.visible, "content must be visible"