Skip to content

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

Closed

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

Activity

  1. moffatman commented on Jan 27, 2023

    @moffatman
    Contributor

    We have CupertinoSliverRefreshControl already. But you're right that there's no adaptive switching.

  2. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Jan 30, 2023
  3. huycozy commented on Jan 30, 2023

    @huycozy
    Member

    Updating the title corresponding to the proposal for a new adaptive constructor (not specific on iOS)

  4. changed the title [-]iOS style loading in RefreshIndicator widget[/-] [+][Proposal] Add an adaptive constructor for RefreshIndicator widget[/+] on Jan 30, 2023
  5. OutdatedGuy commented on Mar 1, 2023

    @OutdatedGuy
    ContributorAuthor

    Awesome ❤️, thanks for the feature @MitchellGoodwin

  6. added
    r: fixedIssue is closed as already fixed in a newer version
    on Mar 1, 2023
  7. github-actions commented on Mar 15, 2023

    @github-actions

    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.

  8. locked as resolved and limited conversation to collaborators on Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

c: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesr: 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