-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[Reland] Fix SegmentedButton clipping when drawing segments (#149739)
#150090
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
Conversation
fixes [`SegmentedButton` doesn't clip properly when one of the segments has `ColorFiltered`](#144990) ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @OverRide Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Center( child: SegmentedButton<int>( segments: const <ButtonSegment<int>>[ ButtonSegment<int>( value: 0, label: ColorFiltered( colorFilter: ColorFilter.mode(Colors.amber, BlendMode.colorBurn), child: Text('Option 1'), ), ), ButtonSegment<int>( value: 1, label: Text('Option 2'), ), ], onSelectionChanged: (Set<int> selected) {}, selected: const <int>{0}, ), ), ), ); } } ``` </details> ### Before  ### After 
QuncCccccc
left a comment
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! Thanks for the reland:)
Thanks for the review! (As always) |
|
auto label is removed for flutter/flutter/150090, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
The failures should come from the change to clip the divider between buttons. Can't really see any differences so the change should be acceptable. Just marked the Google testing status as expected behaviors! |
Appreciate it! |
flutter/flutter@b1f9d71...01db23b 2024-06-13 engine-flutter-autoroll@skia.org Roll Flutter Engine from c7fcbfce608f to 4cb3025d3abf (28 revisions) (flutter/flutter#150199) 2024-06-13 dkwingsmt@users.noreply.github.com Revert "[CupertinoActionSheet] Add sliding tap gesture" (flutter/flutter#150147) 2024-06-13 hans.muller@gmail.com RawScrollbar: don't listen for drag gestures when scrolling is not possible (flutter/flutter#149925) 2024-06-13 katelovett@google.com Update testowners (flutter/flutter#150141) 2024-06-12 109111084+yaakovschectman@users.noreply.github.com Revert "Reland 2: [CupertinoActionSheet] Match colors to native" (flutter/flutter#150142) 2024-06-12 dkwingsmt@users.noreply.github.com Reland 2: [CupertinoActionSheet] Match colors to native (flutter/flutter#150129) 2024-06-12 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.6 to 4.1.7 (flutter/flutter#150132) 2024-06-12 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.25.8 to 3.25.9 (flutter/flutter#150133) 2024-06-12 15619084+vashworth@users.noreply.github.com Improve build time when using SwiftPM (flutter/flutter#150052) 2024-06-12 gspencergoog@users.noreply.github.com Reland: Request focus if accessibility focus is given to a Focus widget (#142942) (flutter/flutter#149840) 2024-06-12 52160996+FMorschel@users.noreply.github.com Update WidgetStatesController docs (flutter/flutter#150081) 2024-06-12 tessertaha@gmail.com [Reland] Fix `SegmentedButton` clipping when drawing segments (#149739) (flutter/flutter#150090) 2024-06-12 nate.w5687@gmail.com Fix markdown hyperlinks in the style guide (flutter/flutter#150071) 2024-06-12 magder@google.com Update packages desktop PR triage link lables (flutter/flutter#150124) 2024-06-12 victorsanniay@gmail.com Add mouse cursor property to `CupertinoRadio` (flutter/flutter#149681) 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 bmparr@google.com,rmistry@google.com,stuartmorgan@google.com 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
…r#149739) (flutter#150090) Relands flutter#149739 which was reverted due to flutter#149851 --- fixes [`SegmentedButton` doesn't clip properly when one of the segments has `ColorFiltered`](flutter#144990) ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @OverRide Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Center( child: SegmentedButton<int>( segments: const <ButtonSegment<int>>[ ButtonSegment<int>( value: 0, label: ColorFiltered( colorFilter: ColorFilter.mode(Colors.amber, BlendMode.colorBurn), child: Text('Option 1'), ), ), ButtonSegment<int>( value: 1, label: Text('Option 2'), ), ], onSelectionChanged: (Set<int> selected) {}, selected: const <int>{0}, ), ), ), ); } } ``` </details> ### Before  ### After  *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
…r#149739) (flutter#150090) Relands flutter#149739 which was reverted due to flutter#149851 --- fixes [`SegmentedButton` doesn't clip properly when one of the segments has `ColorFiltered`](flutter#144990) ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @OverRide Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Center( child: SegmentedButton<int>( segments: const <ButtonSegment<int>>[ ButtonSegment<int>( value: 0, label: ColorFiltered( colorFilter: ColorFilter.mode(Colors.amber, BlendMode.colorBurn), child: Text('Option 1'), ), ), ButtonSegment<int>( value: 1, label: Text('Option 2'), ), ], onSelectionChanged: (Set<int> selected) {}, selected: const <int>{0}, ), ), ), ); } } ``` </details> ### Before  ### After  *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
Relands #149739 which was reverted due to #149851
fixes
SegmentedButtondoesn't clip properly when one of the segments hasColorFilteredCode sample
expand to view the code sample
Before
After
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.