Skip to content

Conversation

@TahaTesser
Copy link
Member

fixes #91844

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@TahaTesser
Copy link
Member Author

@HansMuller
Since button_style_button.dart is an abstract class, doesn't have its own test class, I included this test in one of the buttons.
Please let me know it should be moved somewhere else or we could create new test class for this?

@TahaTesser TahaTesser requested a review from HansMuller March 16, 2022 15:58
@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Mar 16, 2022
@TahaTesser TahaTesser changed the title Fix ButtonStyleButton's InkWell` shape Fix ButtonStyleButton s InkWell shape Mar 16, 2022
@TahaTesser TahaTesser changed the title Fix ButtonStyleButton s InkWell shape Fix ButtonStyleButton InkWell shape Mar 16, 2022
@TahaTesser TahaTesser force-pushed the button_style_button_ink_shape branch from 546a642 to e681d82 Compare April 8, 2022 17:38
Copy link
Contributor

@HansMuller HansMuller left a 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.

@TahaTesser TahaTesser force-pushed the button_style_button_ink_shape branch from e681d82 to 12561c2 Compare June 7, 2022 09:15
@TahaTesser
Copy link
Member Author

@HansMuller
Thanks so much for the review, I've updated the PR.

@TahaTesser TahaTesser requested a review from HansMuller June 7, 2022 13:48
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM

@HansMuller HansMuller merged commit 78a0111 into flutter:master 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/packages that referenced this pull request Jun 7, 2022
@TahaTesser TahaTesser deleted the button_style_button_ink_shape branch June 8, 2022 06:44
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inkwell Shape Differ from Parent Material Shape in ButtonStyleButton

2 participants