buildWithStateWidget method

  1. @override
Widget buildWithStateWidget(
  1. BuildContext context
)
override

Called by the framework when the widget associated with this controller should build.

Implementations should return the widget subtree that would normally be produced by widget.build(context), optionally wrapping or augmenting it.

Implementation

@override
Widget buildWithStateWidget(BuildContext context) {
  if (wantKeepAlive && _keepAliveHandle == null) {
    _ensureKeepAlive();
  } else if (!wantKeepAlive && _keepAliveHandle != null) {
    _releaseKeepAlive();
  }
  return widget.build(context);
}