Fix CupertinoActivityIndicator radius (#41892)
This commit is contained in:
@@ -105,11 +105,11 @@ class _CupertinoActivityIndicatorPainter extends CustomPainter {
|
||||
double radius,
|
||||
}) : tickFundamentalRRect = RRect.fromLTRBXY(
|
||||
-radius,
|
||||
1.0 * radius / _kDefaultIndicatorRadius,
|
||||
radius / _kDefaultIndicatorRadius,
|
||||
-radius / 2.0,
|
||||
-1.0 * radius / _kDefaultIndicatorRadius,
|
||||
1.0,
|
||||
1.0,
|
||||
-radius / _kDefaultIndicatorRadius,
|
||||
radius / _kDefaultIndicatorRadius,
|
||||
radius / _kDefaultIndicatorRadius,
|
||||
),
|
||||
super(repaint: position);
|
||||
|
||||
|
||||
@@ -45,6 +45,18 @@ void main() {
|
||||
|
||||
expect(find.byType(CupertinoActivityIndicator), paints..rrect(color: const Color(0x99EBEBF5)));
|
||||
});
|
||||
|
||||
// Regression test for https://github.com/flutter/flutter/issues/41345.
|
||||
testWidgets('has the correct corner radius', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const CupertinoActivityIndicator(animating: false, radius: 100),
|
||||
);
|
||||
|
||||
expect(
|
||||
find.byType(CupertinoActivityIndicator),
|
||||
paints..rrect(rrect: const RRect.fromLTRBXY(-100, 10, -50, -10, 10, 10)),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget buildCupertinoActivityIndicator([ bool animating ]) {
|
||||
|
||||
Reference in New Issue
Block a user