Skip to content

Conversation

goderbauer
Copy link
Member

Description

CupertinoTabView can now restore the state of its internal Navigator if provided with e restoration ID.

Related Issues

#62916

Tests

I added the following tests:

  • Navigator of CupertinoTabView restores state

Checklist

Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

@flutter-dashboard flutter-dashboard bot added f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. labels Oct 2, 2020
@goderbauer goderbauer requested review from justinmc and shihaohong and removed request for justinmc October 2, 2020 21:44
Copy link
Contributor

@shihaohong shihaohong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a quick suggestion about linking to a code sample to the API docs that could help clarify how to use the restorationScopeId. Otherwise, LGTM

/// Restoration ID to save and restore the state of the [Navigator] built by
/// this [CupertinoTabView].
///
/// {@macro flutter.widgets.navigator.restorationScopeId}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does one unfamiliar with State Restoration go about learning about how to use it? I'm thinking that naturally, developers look for code samples to play around with how to use this. I personally used the test code in this PR to familiarize myself with how to use state restoration with the Navigator/CupertinoTabView.

There is a code sample at Navigator.restorablePush and Navigatoor.restorablePushNamed, so maybe we could link there?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I added three more links to the "see also" section in the macro.

@goderbauer goderbauer force-pushed the restorableCupertinoTabView branch from 84fe408 to 03b6484 Compare October 6, 2020 17:18
@goderbauer goderbauer merged commit 582c67a into flutter:master Oct 6, 2020
@goderbauer goderbauer deleted the restorableCupertinoTabView branch October 6, 2020 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants