You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the showDialog pageBuilder is trying to get the theme it is using the context from showDialog and not the context from the pageBuilder. The issue is that the context from showDialog can be invalid ex. when the application waked from a suspended state.
My suggestion to fix it, is to change:
final ThemeData theme = Theme.of(context, shadowThemeOnly: true);
to
final ThemeData theme = Theme.of(buildContext, shadowThemeOnly: true);
Steps to Reproduce
Call Show dialog, with a textfield as child
Suspend the entire application
Wake up the application
Go to landscape mode and see the application will crash
To investigate we would need a minimal runnable reproduction
as a single file so that we can just copy your code into lib/main.dart of a new project and run to reproduce.
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17763.316], locale da-DK)
• Flutter version 1.0.0 at C:\flutter
• Framework revision 5391447fae (3 months ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at C:\Users\mads\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[√] Android Studio (version 3.3)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[√] VS Code (version 1.31.1)
• VS Code at C:\Users\mads\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 2.23.1
[!] Connected device
• Device ce061606d8c0352e03 is offline.
! Doctor found issues in 1 category.
[✓] Flutter (Channel master, v1.2.3-pre.47, on Mac OS X 10.14.3 18D42, locale en-AT)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
zoechi commentedon Feb 26, 2019
Please add the output of
flutter doctor -v.To investigate we would need a minimal runnable reproduction
as a single file so that we can just copy your code into
lib/main.dartof a new project and run to reproduce.MMonrad commentedon Feb 26, 2019
Here is some code where the issue is:
MMonrad commentedon Feb 26, 2019
And the flutter doctor output:
zoechi commentedon Feb 26, 2019
Could you please try with
devchannelI was not able to reproduce with
MMonrad commentedon Feb 26, 2019
I am still able to reproduce the error on dev channel.
MMonrad commentedon Feb 26, 2019
Here is a screen record of it, it is still on the dev channel
Screen Record.zip
github-actions commentedon Aug 14, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.