-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Add more documentation around keep alive #168311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add more documentation around keep alive #168311
Conversation
/// To manage keep-alive behavior, you can use [KeepAlive] directly or rely on | ||
/// notifications. For convenience, you can also mix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @ValentinVignal!
/// the state of individual items in a scrollable list. | ||
/// | ||
/// Normally, widgets in a lazily built list like [ListView.builder] are | ||
/// disposed of when they leave the visible area to save resources. This means |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// disposed of when they leave the visible area to save resources. This means | |
/// disposed of when they leave the visible area to maintain performance. This means |
/// [TwoDimensionalViewport], to manage the lifecycle of widgets that need to | ||
/// remain alive even when scrolled out of view. | ||
/// | ||
/// The [SliverChildBuilderDelegate] and [SliverChildListDelegate] delegates, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that some widgets in the framework already have this built-in is really valuable I think. Can we mention it above in the other areas where AutomaticKeepAlive comes up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it in Add mention of addAutomaticKeepAlives. It felt like having a template for it would be overkill, so I copied and pasted. Tell me what you think about it
@Piinks @victorsanni Hopefully Use template and passive voice is what you expected |
I'm a bit confused by the failure of "Linux docs_test"
Shouldn't it be solved by adding a /// @docImport 'automatic_keep_alive.dart';
/// @docImport 'sliver.dart'; at top of the file using the |
I think what is happening here is that within the new templates, there are also |
I did some digging, it looks like @Piinks should I revert what I did for this comment #168311 (comment) and use copy and paste? What do you think is the best to do? |
Oh! So sorry I gave poor advice, I thought we had successfully done this before.
Yes, it sounds like that will be the best course to land this. Sorry again about mistaking the template abilities here. |
No problem at all. It made me run through dartdoc and set up my local to run I reverted the usage of |
@@ -413,6 +413,61 @@ class SliverChildBuilderDelegate extends SliverChildDelegate { | |||
/// none of the children will ever try to keep themselves alive. | |||
/// | |||
/// Defaults to true. | |||
/// | |||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops sorry about that, I removed it in Remove empty line in documentation
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
@@ -355,7 +372,18 @@ class KeepAliveHandle extends ChangeNotifier { | |||
} | |||
|
|||
/// A mixin with convenience methods for clients of [AutomaticKeepAlive]. Used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A mixin with convenience methods for clients of [AutomaticKeepAlive]. Used | |
/// A mixin with convenience methods for clients of [AutomaticKeepAlive]. It is used |
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Should
KeepAlive
docs suggest we shouldn't use it, but I believe this might not be a good recommendation #146612Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.