fix cupertino refresh control style (#79842)
This commit is contained in:
parent
a2f67720ef
commit
3dbe7f23c5
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user