-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fix ButtonStyleButton InkWell shape
#100226
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
Fix ButtonStyleButton InkWell shape
#100226
Conversation
|
@HansMuller |
ButtonStyleButton's InkWell` shapeButtonStyleButton s InkWell shape
ButtonStyleButton s InkWell shapeButtonStyleButton InkWell shape
546a642 to
e681d82
Compare
HansMuller
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.
This looks good. I'd suggest testing both overriding the side parameter and leaving it as the default null.
Something like this (I have not even tried compiling this code):
testWidgets('Ink Response shape matches Material shape', (WidgetTester tester) async {
// This is a regression test for https://github.com/flutter/flutter/issues/91844
Widget buildFrame(BorderSide? side) {
return MaterialApp(
home: Scaffold(
body: Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
side: const BorderSide(color: Color(0xff00ff00), width: 10),
shape: RoundedRectangleBorder(side: side),
),
onPressed: () { },
child: const Text('ElevatedButton'),
),
),
),
);
}
const BorderSide borderSide = BorderSide(width: 10, color: Color(0xff00ff00));
await tester.pumpWidget(buildFrame(borderSide));
expect(
tester.widget<InkWell>(find.byType(InkWell)).customBorder,
const RoundedRectangleBorder(side: borderSide),
);
await tester.pumpWidget(buildFrame(null));
expect(
tester.widget<InkWell>(find.byType(InkWell)).customBorder,
null,
);
});You could write a similar test for OutlinedButton and TextButton. OutlinedButton has a default side of course.
e681d82 to
12561c2
Compare
|
@HansMuller |
HansMuller
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
fixes #91844
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.