diff --git a/packages/flutter/lib/src/widgets/automatic_keep_alive.dart b/packages/flutter/lib/src/widgets/automatic_keep_alive.dart index e5573db4a98..dd729d8cfc8 100644 --- a/packages/flutter/lib/src/widgets/automatic_keep_alive.dart +++ b/packages/flutter/lib/src/widgets/automatic_keep_alive.dart @@ -400,6 +400,10 @@ mixin AutomaticKeepAliveClientMixin on State { Widget build(BuildContext context) { if (wantKeepAlive && _keepAliveHandle == null) { _ensureKeepAlive(); + // Whenever wantKeepAlive's value changes (or might change), the + // subclass should call [updateKeepAlive]. + // That will ensure that the keepalive is disabled (or enabled) + // without requiring a rebuild. } return const _NullWidget(); }