Skip to content

AdaptiveControl

Inherits: Control

Base class for controls that support adaptive behavior, which allows them to adjust their appearance and behavior based on the target platform (ex: Material design on Android/Windows/Linux, Cupertino design on iOS/macOS).

The adaptive property is applicable in two common scenarios:

  1. Platform-adaptive controls: These controls have a corresponding version on both Material and Cupertino platforms. When adaptive is set to True, the control renders the appropriate platform-specific implementation.

  2. Container controls: Controls that contain children (ex: Row, Column) can pass the adaptive value down to their children that do not explicitly define it themselves. This enables nested adaptive behavior in complex layouts.

Extension developers can use this base class to create their own adaptive controls by checking the adaptive flag at runtime and rendering accordingly.

Note

This class does not implement any platform-specific rendering itself. It is up to the control inheriting from it to interpret the adaptive flag and render accordingly.

Properties

  • adaptive(bool | None) –

    Enables platform-specific rendering or inheritance of adaptiveness

Properties#

adaptive #

adaptive: bool | None = None

Enables platform-specific rendering or inheritance of adaptiveness from parent controls.