Skip to content

Commit

Permalink
Make wording in nested nav recipe device-agnostic. (#11775)
Browse files Browse the repository at this point in the history
_Description of what this PR is changing or adding, and why:_

The recipe assumed that the developer is building an Android app.

* Updated the wording so as not to exclude iOS apps.
* Small change to intro to make it clear which pages were being created.

_Issues fixed by this PR (if any):_

_PRs or commits this PR depends on (if any):_

## Presubmit checklist

- [x] This PR is marked as draft with an explanation if not meant to
land until a future stable release.
- [x] This PR doesn’t contain automatically generated corrections
(Grammarly or similar).
- [x] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style) — for example, it
doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [x] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
of 80 characters or fewer.
  • Loading branch information
antfitch authored Mar 5, 2025
1 parent ae7475f commit 5c3e68a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion site-shared
17 changes: 11 additions & 6 deletions src/content/cookbook/effects/nested-nav.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ be better handled nested within another widget.

Consider an Internet of Things (IoT) setup flow for a wireless
light bulb that you control with your app.
This setup flow consists of 4 pages:
find nearby bulbs, select the bulb that you want to add,
add the bulb, and then complete the setup.
This setup flow consists of four pages:

* `find_devices` page: Find nearby bulbs.
* `select_device` page: Select the bulb that you want to
add.
* `connecting` page: Add the bulb.
* `finished` page: Complete the setup.

You could orchestrate this behavior from your top-level
`Navigator` widget. However, it makes more sense to define a second,
nested `Navigator` widget within your `SetupFlow` widget,
and let the nested `Navigator` take ownership over the 4 pages
and let the nested `Navigator` take ownership over the four pages
in the setup flow. This delegation of navigation facilitates
greater local control, which is
generally preferable when developing software.
Expand Down Expand Up @@ -160,7 +165,7 @@ want to exit the setup flow.

Prompt the user to confirm exiting the setup flow,
and ensure that the prompt appears when the user
presses the hardware back button on Android.
presses the hardware back button on their device.

<?code-excerpt "lib/prompt_user.dart (PromptUser)"?>
```dart
Expand Down Expand Up @@ -232,7 +237,7 @@ PreferredSizeWidget _buildFlowAppBar() {
```

When the user taps the back arrow in the app bar,
or presses the back button on Android,
or presses the back button on their device,
an alert dialog pops up to confirm that the
user wants to leave the setup flow.
If the user presses **Leave**, then the setup flow pops itself
Expand Down

0 comments on commit 5c3e68a

Please sign in to comment.