mirror of
https://github.com/flutter/flutter
synced 2024-08-25 02:46:31 +00:00
Clarify AutomaticKeepAliveClientMixin semantics in build method (#145297)
This should help folks who trace the code before reading the documentation.
This commit is contained in:
parent
eaf509aaf8
commit
afe01503d8
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue