Skip to content

Add barrierBuilder support to showDialog and showGeneralDialog#187992

Merged
auto-submit[bot] merged 9 commits into
flutter:masterfrom
Mairramer:feat/add-barrier-builder
Jul 22, 2026
Merged

Add barrierBuilder support to showDialog and showGeneralDialog#187992
auto-submit[bot] merged 9 commits into
flutter:masterfrom
Mairramer:feat/add-barrier-builder

Conversation

@Mairramer

@Mairramer Mairramer commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Related to #21039

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. labels Jun 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a barrierBuilder parameter to showDialog, showGeneralDialog, DialogRoute, and RawDialogRoute to allow custom modal barrier building, and adds corresponding tests. However, several changes in the test files incorrectly remove null assertion operators (!) from nullable expressions (such as navigatorKey.currentState and ModalRoute.of(context)) that are assigned to non-nullable variables, which will cause compile-time errors.

Comment thread packages/flutter/test/widgets/routes_test.dart Outdated
Comment thread packages/flutter/test/widgets/routes_test.dart Outdated
Comment thread packages/flutter/test/widgets/routes_test.dart Outdated
Comment thread packages/flutter/test/widgets/routes_test.dart Outdated
Comment thread packages/flutter/test/widgets/routes_test.dart Outdated

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for your contribution!

Since material is still in code freeze, and part of PR change is in widgets/ level. I'm not sure about this case, @dkwingsmt should we separate this PR into 2 PR changes; one PR is only in widgets/ level and can be merged if it is approved and one PR is in material/ library and wait for code freeze done?

Comment thread packages/flutter/lib/src/material/dialog.dart
Comment thread packages/flutter/lib/src/material/dialog.dart

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code change looks good to me! I'll wait for @dkwingsmt 's suggestions whether we should separate this PR or wait for code freeze:)

@dkwingsmt dkwingsmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally LGTM. Thank you.

Yes, I think it'll be necessary to split the changes into two PRs, land the widgets one now, and create another PR in flutter/packages in a few weeks.

Comment thread packages/flutter/lib/src/widgets/routes.dart Outdated
Comment thread packages/flutter/test/widgets/routes_test.dart Outdated
@github-actions github-actions Bot removed the f: material design flutter/packages/flutter/material repository. label Jun 24, 2026
@Mairramer

Mairramer commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Generally LGTM. Thank you.

Yes, I think it'll be necessary to split the changes into two PRs, land the widgets one now, and create another PR in flutter/packages in a few weeks.

I’ll leave only the widget changes in this PR.

Should I create a new issue specifically for the flutter/packages changes?

@QuncCccccc QuncCccccc added the CICD Run CI/CD label Jun 30, 2026
QuncCccccc
QuncCccccc previously approved these changes Jun 30, 2026

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thanks a lot for your contribution! Left one comment in test.

Comment thread packages/flutter/test/widgets/routes_test.dart
@QuncCccccc

Copy link
Copy Markdown
Contributor

Should I create a new issue specifically for the flutter/packages changes?

I think it's fine for now since we are not ready to accept contribution there. We can create a separate PR for material change and later we will move the change over to material_ui.

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks!

@QuncCccccc QuncCccccc added the CICD Run CI/CD label Jul 1, 2026

@dkwingsmt dkwingsmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thank you!

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Jul 20, 2026
@dkwingsmt dkwingsmt added autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD labels Jul 20, 2026
@auto-submit

auto-submit Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/187992, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 20, 2026
@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 21, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 21, 2026
@auto-submit

auto-submit Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/187992, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 22, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jul 22, 2026
Merged via the queue into flutter:master with commit edcf4c8 Jul 22, 2026
37 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 22, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 22, 2026
flutter/flutter@1ac2e82...2a2a79d

2026-07-22 [email protected] Clear cached directional focus history on a non-directional focus request  (flutter/flutter#187957)
2026-07-22 [email protected] ci: Include root pubspec.yaml in pub cache key (flutter/flutter#189826)
2026-07-22 [email protected] Remove codecov badge from README (flutter/flutter#189728)
2026-07-22 [email protected] Clean android engine/embedding tests (flutter/flutter#189276)
2026-07-22 [email protected] Add barrierBuilder support to showDialog and showGeneralDialog (flutter/flutter#187992)
2026-07-22 [email protected] Fix Mockito dynamic agent loading warnings in Robolectric tests (flutter/flutter#189804)
2026-07-22 [email protected] [iOS] Remove dead RasterThreadMerger plumbing from platform views (flutter/flutter#189753)
2026-07-22 [email protected] Add OverlayPortal.overlayChildLayoutBuilder sample (flutter/flutter#188930)
2026-07-22 [email protected] Automate recurring tasks via workflows - localizations (flutter/flutter#189750)
2026-07-21 [email protected] [iOS] Remove dead parameters and no-op overrides (flutter/flutter#189754)
2026-07-21 [email protected] [iOS] Inject DisplayLinkManager into FlutterViewController (flutter/flutter#189764)
2026-07-21 [email protected] Support custom BoxBorder animation in BoxDecoration (flutter/flutter#186348)
2026-07-21 [email protected] Rename CpuArch.x86_64 to CpuArch.x64 (flutter/flutter#189478)
2026-07-21 [email protected] Roll Skia from 569534e9fa59 to 5e183e5aeac5 (3 revisions) (flutter/flutter#189795)
2026-07-21 [email protected] Roll Dart SDK from 3b2f5ad7718d to 1e65011ee004 (4 revisions) (flutter/flutter#189791)
2026-07-21 [email protected] Run delete-bot-branches.yaml on `pull_request_target` instead of `pull_request` so that we can access secrets. (flutter/flutter#189793)
2026-07-21 [email protected] Batch release directory correction (flutter/flutter#189738)
2026-07-21 [email protected] [flutter_test][Test cross imports] Move TestWidgetsApp to flutter_test (flutter/flutter#189435)
2026-07-21 [email protected] Fix null-deref/double-dispose in StretchingOverscrollIndicator (#189589) (flutter/flutter#189667)
2026-07-21 [email protected] Roll Packages from 611899b to 8260a1e (10 revisions) (flutter/flutter#189782)
2026-07-21 [email protected] [iOS] Inject DisplayLinkManager into FlutterMetalLayer (flutter/flutter#189752)
2026-07-21 [email protected] Derive the SkImage size used by ImageEncodingImpeller::ConvertDlImageToSkImage from the size of the underlying texture, not the size of the DlImage (flutter/flutter#189739)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants