Skip to content

[Proposal] Add an adaptive constructor for RefreshIndicator widget #119361

@OutdatedGuy

Description

@OutdatedGuy

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

Metadata

Metadata

Labels

c: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions