control
control
#
control(
dart_widget_name: str | type[T] | None = None,
*,
isolated: bool | None = None,
post_init_args: int = 1,
**dataclass_kwargs,
) -> type[T] | Callable[[type[T]], type[T]]
Decorator to optionally set widget name and 'isolated' while behaving
like @dataclass
.
PARAMETER | DESCRIPTION |
---|---|
dart_widget_name
|
The name of widget on Dart side. |
isolated
|
If
TYPE:
|
post_init_args
|
Number of InitVar arguments to pass to post_init.
TYPE:
|
**dataclass_kwargs
|
Additional keyword arguments passed to
DEFAULT:
|
Usage
- Supports
@control
(without parentheses) - Supports
@control("WidgetName")
(with optional arguments) - Supports
@control("WidgetName", post_init_args=1, isolated=True)
to specify the number ofInitVar
arguments and isolation