Skip to content

@control#

Decorator to optionally set widget name and 'isolated' while behaving like @dataclass.

Parameters:

  • dart_widget_name (str | type[T] | None, default: None ) –

    The name of widget on Dart side.

  • isolated (bool | None, default: None ) –

    If True, marks the control as isolated. An isolated control is excluded from page updates when its parent control is updated.

  • post_init_args (int, default: 1 ) –

    Number of InitVar arguments to pass to post_init.

  • dataclass_kwargs

    Additional keyword arguments passed to @dataclass.

Usage
  • Supports @control (without parentheses)
  • Supports @control("WidgetName") (with optional arguments)
  • Supports @control("WidgetName", post_init_args=1, isolated=True) to specify the number of InitVar arguments and isolation