Unverified Commit afe01503 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Clarify AutomaticKeepAliveClientMixin semantics in build method (#145297)

This should help folks who trace the code before reading the documentation.
parent eaf509aa
...@@ -400,6 +400,10 @@ mixin AutomaticKeepAliveClientMixin<T extends StatefulWidget> on State<T> { ...@@ -400,6 +400,10 @@ mixin AutomaticKeepAliveClientMixin<T extends StatefulWidget> on State<T> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (wantKeepAlive && _keepAliveHandle == null) { if (wantKeepAlive && _keepAliveHandle == null) {
_ensureKeepAlive(); _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(); return const _NullWidget();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment