GetX<T extends GetLifeCycleMixin> constructor

const GetX<T extends GetLifeCycleMixin>({
  1. required GetXControllerBuilder<T> builder,
  2. Key? key,
  3. String? tag,
  4. bool global = true,
  5. bool autoRemove = true,
  6. bool assignId = false,
  7. void initState(
    1. GetXState<T> state
    )?,
  8. void dispose(
    1. GetXState<T> state
    )?,
  9. void didChangeDependencies(
    1. GetXState<T> state
    )?,
  10. void didUpdateWidget(
    1. GetX<T> oldWidget,
    2. GetXState<T> state
    )?,
  11. T? init,
})

Constructs a GetX widget.

The builder function is required and is used to build the widget based on the controller's state. Other parameters control the lifecycle behavior of the controller, such as whether it should be registered globally, and whether it should be automatically removed when the widget is disposed.

Implementation

const GetX({
  required this.builder,
  super.key,
  this.tag,
  this.global = true,
  this.autoRemove = true,
  this.assignId = false,
  this.initState,
  this.dispose,
  this.didChangeDependencies,
  this.didUpdateWidget,
  this.init,
});