useAutomaticKeepAlive function

void useAutomaticKeepAlive({
  1. bool wantKeepAlive = true,
})

Mark a widget using this hook as needing to stay alive even when it's in a lazy list that would otherwise remove it.

See also:

Implementation

void useAutomaticKeepAlive({
  bool wantKeepAlive = true,
}) {
  use(_AutomaticKeepAliveHook(
    wantKeepAlive: wantKeepAlive,
  ));
}