flutter
flutter copied to clipboard
iOS style loading in RefreshIndicator widget
Use case
Normally people use the RefreshIndicator widget in their apps when building for both android and ios.
Currently, it only shows the material style CircularProgressIndicator. It would be nice to have one with the iOS/Cupertino style loading too in the RefreshIndicator widget.
Proposal
To have a constructor called adaptive to show the loading style based on the platform.
Like:
const RefreshIndicator.adaptive({
super.key,
required this.child,
this.displacement = 40.0,
this.edgeOffset = 0.0,
required this.onRefresh,
this.backgroundColor,
this.notificationPredicate = defaultScrollNotificationPredicate,
this.semanticsLabel,
this.semanticsValue,
this.strokeWidth = RefreshProgressIndicator.defaultStrokeWidth,
this.triggerMode = RefreshIndicatorTriggerMode.onEdge,
} : _indicatorType = _ActivityIndicatorType.adaptive;
And this constructor will now use the CircularProgressIndicator.adaptive widget to show the loading.
Reference: https://github.com/flutter/flutter/blob/4dbb573ff0635f711341307d1bc49a052af3b41b/packages/flutter/lib/src/material/refresh_indicator.dart#L118-#L142
We have CupertinoSliverRefreshControl already. But you're right that there's no adaptive switching.
Updating the title corresponding to the proposal for a new adaptive constructor (not specific on iOS)
Awesome ❤️, thanks for the feature @MitchellGoodwin
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.