-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
"setState() or markNeedsBuild() called during build" error combining DraggableScrollableSheet with FloatingActionButton #146736
Comments
Thanks for the report. Reproduced the issue on Flutter master channel as well. flutter doctor -v (stable and master)[✓] Flutter (Channel stable, 3.19.5, on macOS 14.1 23B74 darwin-x64, locale en-VN)
• Flutter version 3.19.5 on channel stable at /Users/huynq/Documents/GitHub/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 300451adae (8 days ago), 2024-03-27 21:54:07 -0500
• Engine revision e76c956498
• Dart version 3.3.3
• DevTools version 2.31.1
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /Applications/Android Studio.app/
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
[✓] VS Code (version 1.87.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.84.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 14.1 23B74 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.106
[✓] Network resources
• All expected network resources are available.
• No issues found! [!] Flutter (Channel master, 3.22.0-10.0.pre, on macOS 14.1 23B74 darwin-x64, locale en-VN)
• Flutter version 3.22.0-10.0.pre on channel master at /Users/huynq/Documents/GitHub/flutter_master
! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 1002ce4b03 (12 hours ago), 2024-04-14 20:29:43 +0530
• Engine revision 1a13c7d1f4
• Dart version 3.5.0 (build 3.5.0-47.0.dev)
• DevTools version 2.34.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode15.3.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /Applications/Android Studio.app/
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
[✓] VS Code (version 1.88.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.86.0
[✓] Connected device (3 available)
• RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 11 (API 30)
• macOS (desktop) • macos • darwin-x64 • macOS 14.1 23B74 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.123
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category. |
I have a very similar issue. On debug, it is not a massive issue, it causes a slight weird behaviour, but normal working is quickly restored on the next scroll event. However, on release, it causes a massive issue, as the controller appears to stop sending events properly to somewhere where they are required. Unlike this issue, the FAB remains stuck to where it is supposed to be. It's other widgets that rely on the controller for positioning that break. Additionally, it appears to occur when scrolling quickly (maybe there's frames being skipped which causes the issue?), and occurs when the sheet meets its Screenrecorder-2024-05-21-22-17-13-377.mp4Error Log
Happy to add some code, but unlikely to be able to have enough time to produce an MRE any time soon, as it's decently complex internally - and I'm pretty sure it's unrelated to what I'm doing, and instead an issue with the DSS looking at the log. Is this a seperate issue? Or a different manifestation of the same one? Happy to file a new report if necessary. But would like this looked into! |
The issue at #146736 (comment) occurs regardless as to whether there is a FAB. The error does have the same callstack. But, I also stick something to the position of the sheet (as visible in the video) by using |
Here's an MRE that proves the issue occurs regardless of whether a |
Steps to reproduce
I have a Scaffold with a
bottomNavigationBar
modifying a_pageIndex
state variable.For
pageIndex == 1
:bottomSheet
sheet set to a widget containing aDraggableScrollableSheet
, with a button that when clicked, uses theDraggableScrollableController.animateTo()
method to expand the bottom sheet.floatingActionButton
set.To reproduce (running in the iOS simulator):
Expected results
It switches back to Page 0, the bottom sheet and floating action button disappear, and there are no errors in the terminal.
Actual results
Visually it works fine, but there is the following error in the debug console (which appear to be originating in the framework):
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: