Mastersam07 / Mastersam07/kaisel

Question: How to Guard a Modal?

Open
#90 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
69
Forks
2
Avg merge
18m
Merged PRs (30d)
9

Description

Is it correct that guards are not run for modal flows?

Edit: I found this in the comments.

```
/// Guards on the main router are **not** rerun when starting a flow
/// (a flow is its own transient state, not a navigation on the main
/// stack). The sub-router has no guards by default; pass [flowGuards]
/// if you need them.
```

Maybe this would be worth pointing out in the docs.

Edit 2: Are guards not run for the first route in a flow? It might also be worth adding the `reevaluateOn` parameter to running modal flows. Also, having a way to dismiss a modal flow with a guard would be useful.

Edit 3: Now I'm confused why sometimes you can add flowGuards and sometimes it's not an option.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the existing routing documentation and the modal-flow API entry points for guards, flowGuards, and reevaluateOn. Clarify when main-router and flow guards run, whether the first route is covered, and what options exist for guarded dismissal; done means the documented behavior and available parameters are unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.