SignalEffect constructor

const SignalEffect({
  1. dynamic effect(
    1. BuildContext context
    )?,
  2. @Deprecated('Use effect instead') void callback(
    1. BuildContext context
    )?,
  3. required Widget child,
  4. String? debugLabel,
  5. Key? key,
})

Creates a SignalEffect widget.

The effect is executed inside a reactive effect. The child is rendered normally.

Implementation

const SignalEffect({
  dynamic Function(BuildContext context)? effect,
  @Deprecated('Use effect instead')
  void Function(BuildContext context)? callback,
  required this.child,
  this.debugLabel,
  super.key,
})  : assert(effect != null || callback != null,
          'Either effect or callback must be provided'),
      _effect = effect ?? callback;