Unverified Commit 78a0111c authored by Taha Tesser's avatar Taha Tesser Committed by GitHub

Fix `ButtonStyleButton` ink well shape. (#100226)

parent be0c1bd0
......@@ -367,7 +367,7 @@ class _ButtonStyleState extends State<ButtonStyleButton> with MaterialStateMixin
splashFactory: resolvedSplashFactory,
overlayColor: overlayColor,
highlightColor: Colors.transparent,
customBorder: resolvedShape,
customBorder: resolvedShape.copyWith(side: resolvedSide),
child: IconTheme.merge(
data: IconThemeData(color: resolvedForegroundColor),
child: Padding(
......
......@@ -1554,6 +1554,51 @@ void main() {
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
});
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: side,
shape: const RoundedRectangleBorder(
side: BorderSide(
color: Color(0xff0000ff),
width: 0,
),
),
),
onPressed: () { },
child: const Text('ElevatedButton'),
),
),
),
);
}
const BorderSide borderSide = BorderSide(width: 10, color: Color(0xff00ff00));
await tester.pumpWidget(buildFrame(side: borderSide));
expect(
tester.widget<InkWell>(find.byType(InkWell)).customBorder,
const RoundedRectangleBorder(side: borderSide),
);
await tester.pumpWidget(buildFrame());
await tester.pumpAndSettle();
expect(
tester.widget<InkWell>(find.byType(InkWell)).customBorder,
const RoundedRectangleBorder(
side: BorderSide(
color: Color(0xff0000ff),
width: 0.0,
),
),
);
});
}
TextStyle _iconStyle(WidgetTester tester, IconData icon) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment