UdaraWanasinghe / flutter-carousel-slider

A customizable carousel slider for Flutter. Supports infinite sliding, custom indicators, and custom animations with many pre-built indicators and animations.
MIT License
29 stars 17 forks source link

Widgets are being disposed during animation when using StackTransform #24

Open dvagala opened 1 year ago

dvagala commented 1 year ago

As the title says, the child widgets of the carousel are being disposed. This leads to a problem if you have some async logic when initiating the state of the widget. For example in my scenario, I'm fetching image from database and this leads to flashing.

See the gif

RPReplay_Final1687607983 (1)

CarouselSlider.builder(
    slideTransform: StackTransform(),
    itemCount: viewModel.projects.length,
    slideBuilder: (index) => InspirationDetailView(
      project: viewModel.projects[index],
    ),
  ),