Comments (3)
Reproducible using the code sample provided above.
logs
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building RawGestureDetector(state: RawGestureDetectorState#f5ce9(gestures: [tap])):
OverlayPortalController.show() should not be called during build.
'package:flutter/src/widgets/overlay.dart':
Failed assertion: line 1814 pos 7: 'SchedulerBinding.instance.schedulerPhase != SchedulerPhase.persistentCallbacks'
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.yml
The relevant error-causing widget was:
GestureDetector GestureDetector:file:///Users/nexus/projects/nevercode/ipad/lib/main.dart:41:14
When the exception was thrown, this was the stack:
#2 _OverlayPortalState.show (package:flutter/src/widgets/overlay.dart:1814:7)
overlay.dart:1814
#3 OverlayPortalController.show (package:flutter/src/widgets/overlay.dart:1554:13)
overlay.dart:1554
#4 _MenuAnchorState._open (package:flutter/src/material/menu_anchor.dart:569:24)
menu_anchor.dart:569
#5 MenuController.open (package:flutter/src/material/menu_anchor.dart:680:14)
menu_anchor.dart:680
#6 _InnerMenuAnchorState.didUpdateWidget (package:ipad/main.dart:70:23)
main.dart:70
#7 StatefulElement.update (package:flutter/src/widgets/framework.dart:5789:55)
framework.dart:5789
#8 Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
framework.dart:3941
#9 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
framework.dart:6907
#10 Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
framework.dart:3941
#11 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
framework.dart:6907
#12 Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
framework.dart:3941
#13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
framework.dart:5642
#14 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
framework.dart:5780
flutter doctor -v
[!] Flutter (Channel stable, 3.22.2, on macOS 14.4.1 23E224 darwin-arm64, locale en-GB)
• Flutter version 3.22.2 on channel stable at /Users/nexus/dev/sdks/flutter
! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutters/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter. Consider adding /Users/nexus/dev/sdks/flutter/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutters/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter. Consider adding /Users/nexus/dev/sdks/flutter/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747bfc5 (12 days ago), 2024-06-05 22:15:13 +0200
• Engine revision edd8546116
• Dart version 3.4.3
• DevTools version 2.34.3
• 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/nexus/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Users/nexus/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode-15.3.0.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 2024.1)
• Android Studio at /Users/nexus/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
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.5)
• IntelliJ at /Users/nexus/Applications/IntelliJ IDEA Ultimate.app
• Flutter plugin version 77.2.2
• Dart plugin version 232.10286
[✓] VS Code (version 1.89.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Connected device (5 available)
• Nexus (mobile) • 00008020-001875E83A38002E • ios • iOS 17.5.1 21F90
• Dean’s iPad (mobile) • 00008103-000825C811E3401E • ios • iOS 17.5.1 21F90
• macOS (desktop) • macos • darwin-arm64 • macOS 14.4.1 23E224 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.4.1 23E224 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.62
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
[✓] Flutter (Channel master, 3.23.0-13.0.pre.242, on macOS 14.4.1 23E224 darwin-arm64, locale en-GB)
• Flutter version 3.23.0-13.0.pre.242 on channel master at /Users/nexus/dev/sdks/flutters
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5187cab7bd (2 days ago), 2024-06-14 23:35:34 -0400
• Engine revision 9779c273aa
• Dart version 3.5.0 (build 3.5.0-266.0.dev)
• DevTools version 2.36.0
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/nexus/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Users/nexus/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode-15.3.0.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 2024.1)
• Android Studio at /Users/nexus/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
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.5)
• IntelliJ at /Users/nexus/Applications/IntelliJ IDEA Ultimate.app
• Flutter plugin version 77.2.2
• Dart plugin version 232.10286
[✓] VS Code (version 1.89.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Connected device (5 available)
• Nexus (mobile) • 00008020-001875E83A38002E • ios • iOS 17.5.1 21F90
• Dean’s iPad (mobile) • 00008103-000825C811E3401E • ios • iOS 17.5.1 21F90
• macOS (desktop) • macos • darwin-arm64 • macOS 14.4.1 23E224 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.4.1 23E224 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.62
[✓] Network resources
• All expected network resources are available.
• No issues found!
from flutter.
@davidhicks980
This seems to be working as as expected according to the error message.
You can a build widget during build phase which is triggered by the secondary tap down in the sample
Try updating the open calling in a post frame callback, this is called after the widget finish building.
SchedulerBinding.instance!.addPostFrameCallback((Duration timeStamp) {
if (widget.position != oldWidget.position) {
_menuController.open(position: widget.position);
}
});
from flutter.
Whoops sorry @TahaTesser -- I forgot to come back to this issue! Yeah, I wasn't sure whether it was an actual issue considering this is just the standard behavior of overlays. I did notice that the code for closing the menu contains a check for schedulerphase, so I wasn't sure if it was overlooked for opening or if this is expected behavior.
I also wasn't sure if there should be a "declarative" way of opening the menu. For example, web dialogs have an "open" parameter that will trigger their showing, rather than users having to call a function or otherwise having to wait for a frame. But if it's expected behavior, we can close this issue! Sorry for the trouble.
from flutter.
Related Issues (20)
- Cocoon server deploys seem to be broken HOT 6
- Mac tool_integration_tests_4_4 is prone to timing out
- Windows not working for a LOT of plugins
- Replace some phones attached to mac hosts with mokey's HOT 5
- Consider making `flutter drive` default to using `dart test` as the runner script HOT 1
- [tool][web] Consider setting `COEP` header to `credentialless`
- [engine/framework] opaque platform views.
- Failed to send CA Event for app launch measurements for ca_event_type: 0 event_name: com.apple.app_launch_measurement (New Flutter App - XCode 16 Beta 4)
- Web App stuck on Splash on FB messenger's web view
- [CP] Fix SelectionArea scrolling conflicts
- Failed to acquire RBS assertion 'WebKit Media Playback' (Wonderous + XCode 16 Beta 4)
- [SelectionArea] Selection Text lost when new item inserted to ListView
- Flutter has no adaptation to Android font weights HOT 1
- [Android] Unexpected pixel gap between Appbar and SliverAppbar HOT 1
- ScrollStartNotification and ScrollEndNotification triggered at the same time on a TwoDimensionalGridView HOT 2
- [tool_crash] FileSystemException: Failed to decode data using encoding 'utf-8', null HOT 1
- [Web] SelectionArea Doesn't Respect Text's TextAlign in Web Platfrom
- Flutter web app cannot start after upgrading to flutter 3.22.3
- Check failed: backend != IOSRenderingBackend::kImpeller. Software rendering is incompatible with Impeller. HOT 1
- Crashes when deployed on webserver
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.