Closed minjinDelable closed 1 year ago
i am flutter web develop i use this version 'flutter_carousel_widget: ^2.0.2' my flutter version 3.7.12
I'm getting this error too. To reproduce:
set CarouselOptions.viewportFraction to be calculated based on screen width, and resize the screen. You'll get this error.
This FlutterCarousel widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.
The widget on which setState() or markNeedsBuild() was called was: FlutterCarousel
dependencies: [ScrollConfiguration]
state: FlutterCarouselState#5d7bd
The widget which was currently being built when the offending call was made was: NotificationListener<ScrollNotification>
When the exception was thrown, this was the stack
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49 throw_
packages/flutter/src/widgets/framework.dart 4651:9 <fn>
packages/flutter/src/widgets/framework.dart 4662:14 markNeedsBuild
packages/flutter/src/widgets/framework.dart 1159:5 setState
packages/flutter_carousel_widget/src/_flutter_carousel_widget.dart 86:7 <fn>
2
packages/flutter/src/foundation/change_notifier.dart 403:24 notifyListeners
packages/flutter/src/widgets/scroll_position.dart 965:11 notifyListeners
packages/flutter/src/widgets/scroll_position.dart 384:5 forcePixels
packages/flutter/src/widgets/page_view.dart 364:7 set viewportFraction```
It probably needs a post-frame callback to fix it?
i find error log log here
i don`t use setState
but this package useful setState
how delete error log ?
I don't want it.