Skip to content

Proposal to add currentIndex to CarouselController and onItemChanged to CarouselView  #169207

Description

@RoberRaf

Use case

Now that CarouselController supports animateToItem ...
However, there's currently no way to determine which item is currently visible. This makes it difficult to decide which index to animate to next

Proposal

  • Add a property to CarouselController (e.g., currentIndex) to expose the index of the currently visible item.

  • Add an onItemChanged callback to the CarouselView widget to notify listeners whenever the active item changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions