Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: This widget has been unmounted #59

Open
1 task done
RTAzis opened this issue Nov 29, 2024 · 0 comments
Open
1 task done

[Bug]: This widget has been unmounted #59

RTAzis opened this issue Nov 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@RTAzis
Copy link

RTAzis commented Nov 29, 2024

Description:

When using a FlutterCarouselController in a parent widget, if the child FlutterCarousel widget is unmounted and startAutoPlay() is called, it leads to an unmounted error. Additionally, checking controller.ready still returns true. The _FlutterCarouselState should check its mounted state before interacting with the controller and properly dispose of it when the widget is unmounted.

Steps to Reproduce:

  1. Create a parent widget with a FlutterCarouselController.
  2. In the child widget, use FlutterCarousel with this controller.
  3. Unmount the child widget while the carousel is running.
  4. Call startAutoPlay() on the controller.
  5. The unmounted error occurs because the child widget is no longer in the widget tree.

Version

^3.1.0

What devices are you seeing the problem on?

Android

OS

Android API 35

Relevant log output

#2      _FlutterCarouselState._getTimer.<anonymous closure> (package:flutter_carousel_widget/src/_flutter_carousel_widget.dart:213:35)
_flutter_carousel_widget.dart:213
      #3      _rootRunUnary (dart:async/zone.dart:1407:47)
zone.dart:1407
      #4      _CustomZone.runUnary (dart:async/zone.dart:1308:19)
zone.dart:1308
      #5      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
zone.dart:1217
      #6      _CustomZone.bindUnaryCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1254:26)
zone.dart:1254
      #7      _rootRunUnary (dart:async/zone.dart:1415:13)
zone.dart:1415
      #8      _CustomZone.runUnary (dart:async/zone.dart:1308:19)
zone.dart:1308
      #9      _CustomZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:1238:26)
zone.dart:1238
      #10     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
timer_impl.dart:398
      #11     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
timer_impl.dart:429
      #12     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
isolate_patch.dart:184

Code of Conduct

  • I agree to follow this project's Code of Conduct
@RTAzis RTAzis added the bug Something isn't working label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants