Unverified Commit 3dbe7f23 authored by c1yde3's avatar c1yde3 Committed by GitHub

fix cupertino refresh control style (#79842)

parent a2f67720
......@@ -420,7 +420,7 @@ class CupertinoSliverRefreshControl extends StatefulWidget {
double refreshTriggerPullDistance,
double refreshIndicatorExtent,
) {
final double percentageComplete = pulledExtent / refreshTriggerPullDistance;
final double percentageComplete = (pulledExtent / refreshTriggerPullDistance).clamp(0.0, 1.0);
// Place the indicator at the top of the sliver that opens up. Note that we're using
// a Stack/Positioned widget because the CupertinoActivityIndicator does some internal
......
......@@ -1322,6 +1322,26 @@ void main() {
);
expect(tester.widget<CupertinoActivityIndicator>(find.byType(CupertinoActivityIndicator)).progress, 100.0 / 100.0);
});
testWidgets('indicator should not become larger when overscrolled', (WidgetTester tester) async {
// test for https://github.com/flutter/flutter/issues/79841
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: Builder(
builder: (BuildContext context) {
return CupertinoSliverRefreshControl.buildRefreshIndicator(
context,
RefreshIndicatorMode.done,
120, 100, 10,
);
},
),
),
);
expect(tester.widget<CupertinoActivityIndicator>(find.byType(CupertinoActivityIndicator)).radius, 14.0);
});
}
group('UI tests long list', uiTestGroup);
......
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