File tree Expand file tree Collapse file tree 2 files changed +46
-1
lines changed
Expand file tree Collapse file tree 2 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ class _ButtonStyleState extends State<ButtonStyleButton> with MaterialStateMixin
367367 splashFactory: resolvedSplashFactory,
368368 overlayColor: overlayColor,
369369 highlightColor: Colors .transparent,
370- customBorder: resolvedShape,
370+ customBorder: resolvedShape. copyWith (side : resolvedSide) ,
371371 child: IconTheme .merge (
372372 data: IconThemeData (color: resolvedForegroundColor),
373373 child: Padding (
Original file line number Diff line number Diff line change @@ -1554,6 +1554,51 @@ void main() {
15541554
15551555 expect (RendererBinding .instance.mouseTracker.debugDeviceActiveCursor (1 ), SystemMouseCursors .basic);
15561556 });
1557+
1558+ testWidgets ('Ink Response shape matches Material shape' , (WidgetTester tester) async {
1559+ // This is a regression test for https://github.com/flutter/flutter/issues/91844
1560+
1561+ Widget buildFrame ({BorderSide ? side}) {
1562+ return MaterialApp (
1563+ home: Scaffold (
1564+ body: Center (
1565+ child: ElevatedButton (
1566+ style: ElevatedButton .styleFrom (
1567+ side: side,
1568+ shape: const RoundedRectangleBorder (
1569+ side: BorderSide (
1570+ color: Color (0xff0000ff ),
1571+ width: 0 ,
1572+ ),
1573+ ),
1574+ ),
1575+ onPressed: () { },
1576+ child: const Text ('ElevatedButton' ),
1577+ ),
1578+ ),
1579+ ),
1580+ );
1581+ }
1582+
1583+ const BorderSide borderSide = BorderSide (width: 10 , color: Color (0xff00ff00 ));
1584+ await tester.pumpWidget (buildFrame (side: borderSide));
1585+ expect (
1586+ tester.widget <InkWell >(find.byType (InkWell )).customBorder,
1587+ const RoundedRectangleBorder (side: borderSide),
1588+ );
1589+
1590+ await tester.pumpWidget (buildFrame ());
1591+ await tester.pumpAndSettle ();
1592+ expect (
1593+ tester.widget <InkWell >(find.byType (InkWell )).customBorder,
1594+ const RoundedRectangleBorder (
1595+ side: BorderSide (
1596+ color: Color (0xff0000ff ),
1597+ width: 0.0 ,
1598+ ),
1599+ ),
1600+ );
1601+ });
15571602}
15581603
15591604TextStyle _iconStyle (WidgetTester tester, IconData icon) {
You can’t perform that action at this time.
0 commit comments