-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolef: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
Hello there,
The issues I addressed is in this line: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/dialog.dart#L705
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
Logs
Metadata
Metadata
Assignees
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolef: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight