Fix ButtonStyleButton InkWell shape#100226
Merged
HansMuller merged 1 commit intoflutter:masterfrom Jun 7, 2022
Merged
Conversation
Contributor
Author
|
@HansMuller |
ButtonStyleButton's InkWell` shapeButtonStyleButton s InkWell shape
ButtonStyleButton s InkWell shapeButtonStyleButton InkWell shape
546a642 to
e681d82
Compare
HansMuller
reviewed
Jun 2, 2022
Contributor
HansMuller
left a comment
There was a problem hiding this comment.
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
Contributor
Author
|
@HansMuller |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jun 7, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jun 8, 2022
camsim99
pushed a commit
to camsim99/flutter
that referenced
this pull request
Aug 10, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 30, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Aug 30, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #91844
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.