-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Add barrierColor property to showCupertinoDialog #166911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add barrierColor property to showCupertinoDialog #166911
Conversation
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
Hi, thanks for you contribution! Can you add a unit test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
autosubmit label was removed for flutter/flutter/166911, because - The status or check suite Linux analyze has failed. Please fix the issues identified (or deflake) before re-applying this label. |
@@ -1422,7 +1423,7 @@ Future<T?> showCupertinoDialog<T>({ | |||
context: context, | |||
barrierDismissible: barrierDismissible, | |||
barrierLabel: barrierLabel, | |||
barrierColor: CupertinoDynamicColor.resolve(kCupertinoModalBarrierColor, context), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this should be barrierColor ?? CupertinoDynamicColor.resolve(kCupertinoModalBarrierColor, context)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be because CupertinoDialogRoute
's barrierColor
defaults to the same value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be because CupertinoDialogRoute's barrierColor defaults to the same value.
Yes, that’s the reason it was removed.
The analyzer is failing due to format errors, which can be fixed by running |
autosubmit label was removed for flutter/flutter/166911, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
implimented #166910
2025-04-11.0.06.35.mov
How to Verify
showCupertinoDialog<void>( context: context, + barrierColor: CupertinoColors.activeOrange.withValues(alpha: 0.5), builder: (BuildContext context) => CupertinoAlertDialog( title: const Text('Alert'), content: const Text('Proceed with destructive action?'), actions: <CupertinoDialogAction>[ CupertinoDialogAction( /// This parameter indicates this action is the default, /// and turns the action's text to bold text. isDefaultAction: true, onPressed: () { Navigator.pop(context); }, child: const Text('No'), ), CupertinoDialogAction( /// This parameter indicates the action would perform /// a destructive action such as deletion, and turns /// the action's text color to red. isDestructiveAction: true, onPressed: () { Navigator.pop(context); }, child: const Text('Yes'), ), ], ), );
examples/api/lib/cupertino/dialog/cupertino_alert_dialog.0.dart
after addingbarrierColor: CupertinoColors.activeOrange.withValues(alpha: 0.5),
.Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.