automaticKeepAlive<R> static method

StateWithMixinBuilder<AutomaticKeepAliveClientMixin<StatefulWidget>, R> automaticKeepAlive<R>({
  1. Key? key,
  2. dynamic tag,
  3. ReactiveModel<R> observe()?,
  4. Widget builder(
    1. BuildContext context,
    2. ReactiveModel<R>? rm
    )?,
  5. Widget builderWithChild(
    1. BuildContext context,
    2. ReactiveModel<R>? rm,
    3. Widget? child
    )?,
  6. Widget? child,
  7. void initState(
    1. BuildContext context,
    2. ReactiveModel<R>? rm
    )?,
  8. void dispose(
    1. BuildContext context,
    2. ReactiveModel<R>? rm
    )?,
  9. void didChangeDependencies(
    1. BuildContext context,
    2. ReactiveModel<R>? rm
    )?,
  10. void didUpdateWidget(
    1. BuildContext context,
    2. StateWithMixinBuilder<AutomaticKeepAliveClientMixin<StatefulWidget>, R> old
    )?,
  11. void afterInitialBuild(
    1. BuildContext context,
    2. ReactiveModel<R>? rm
    )?,
  12. void afterRebuild(
    1. BuildContext context,
    2. ReactiveModel<R>? rm
    )?,
})

StateBuilder mixin with AutomaticKeepAliveClientMixin

  • Required parameters:
    • builder : The builder callback to be executed whenever the widget is notified.
    • builderWithChild : The builder callback to be executed whenever the widget is notified. It must be use with child parameter.
    • child : Widget to be used with builderWithChild. Used for optimization. builder or and only or builderWithChild with child must be defined.
  • Optional parameters:
    • observe : The model to observer.
    • observeMany Callback to be called when the widget is first inserted.
    • dispose : Callback to be called when the widget is removed.
    • didChangeDependencies : Callback to be called when dependencies changed.
    • didUpdateWidget : Callback to be called when the widget updated
    • afterInitialBuild : Callback to be called after the first build of the widget.
    • afterRebuild : Callback to be called after each build.

Implementation

static StateWithMixinBuilder<AutomaticKeepAliveClientMixin, R>
    automaticKeepAlive<R>({
  Key? key,
  dynamic tag,
  ReactiveModel<R> Function()? observe,
  Widget Function(BuildContext context, ReactiveModel<R>? rm)? builder,
  Widget Function(BuildContext context, ReactiveModel<R>? rm, Widget? child)?
      builderWithChild,
  Widget? child,
  void Function(BuildContext context, ReactiveModel<R>? rm)? initState,
  void Function(BuildContext context, ReactiveModel<R>? rm)? dispose,
  void Function(BuildContext context, ReactiveModel<R>? rm)?
      didChangeDependencies,
  void Function(
    BuildContext context,
    StateWithMixinBuilder<AutomaticKeepAliveClientMixin, R> old,
  )?
      didUpdateWidget,
  void Function(BuildContext context, ReactiveModel<R>? rm)?
      afterInitialBuild,
  void Function(BuildContext context, ReactiveModel<R>? rm)? afterRebuild,
}) {
  return StateWithMixinBuilder<AutomaticKeepAliveClientMixin, R>(
    mixinWith: MixinWith.automaticKeepAliveClientMixin,
    key: key,
    observe: observe,
    builder: builder,
    builderWithChild: builderWithChild,
    child: child,
    initState: initState != null
        ? (context, rm, mix) => initState(context, rm)
        : null,
    dispose:
        dispose != null ? (context, rm, mix) => dispose(context, rm) : null,
    didChangeDependencies: didChangeDependencies != null
        ? (context, rm, mix) => didChangeDependencies(context, rm)
        : null,
    didUpdateWidget: didUpdateWidget != null
        ? (context, old, mix) => didUpdateWidget(context, old)
        : null,
    afterInitialBuild: afterInitialBuild,
    afterRebuild: afterRebuild,
  );
}