Fix ButtonStyleButton ink well shape. (#100226)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user