AutomaticKeepAlive now keeps alive#16445
Merged
goderbauer merged 6 commits intoflutter:masterfrom Apr 11, 2018
Merged
Conversation
Hixie
reviewed
Apr 11, 2018
| // If we are called during the first build of this subtree the links to the | ||
| // children will not be hooked up yet. In that case this method returns | ||
| // null despite the fact that we will have a child after the build | ||
| // completes. It's the callers responsibility to deal with this case. |
Hixie
reviewed
Apr 11, 2018
| // If the child doesn't exist yet, we got called during the very first | ||
| // build of this subtree. Wait until the end of the frame to update | ||
| // the child when the child is guaranteed to be present. | ||
| SchedulerBinding.instance.addPostFrameCallback((_) { |
Contributor
There was a problem hiding this comment.
we should be explicit about argument names and types even if we don't use them, that way people editing or copying the code don't have to look up what it is
Hixie
reviewed
Apr 11, 2018
| } | ||
|
|
||
| class _AlwaysKeepAlive extends StatefulWidget{ | ||
| const _AlwaysKeepAlive({Key key}):super(key:key); |
Contributor
There was a problem hiding this comment.
trivial nits: space before { on the class line, spaces around first : and space after second : on the constructor line.
There was a problem hiding this comment.
in the future, maybe it's a good idea to integrate pre-commit hook of dart prettifier which automatically formats code style to the branch.
Hixie
reviewed
Apr 11, 2018
| expect(find.byKey(const GlobalObjectKey<_AlwaysKeepAliveState>(0)), findsOneWidget); | ||
| await tester.drag(find.byType(ListView), const Offset(0.0, -1000.0)); // move to bottom | ||
| await tester.pump(); | ||
| expect(find.byKey(const GlobalObjectKey<_AlwaysKeepAliveState>(0)), findsOneWidget); |
Contributor
There was a problem hiding this comment.
maybe also verify that "keep me alive" is present but "FooBar" is not?
Contributor
DaveShuckerow
pushed a commit
to DaveShuckerow/flutter
that referenced
this pull request
May 14, 2018
Fixes flutter#16346. See flutter#16346 (comment) for detailed explanation of what was going wrong before this fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16346.
See #16346 (comment) for detailed explanation of what was going wrong before this fix.