Skip to content

Commit d7d0b0a

Browse files
authored
[fix] open the FlutterModuleBuilder error dialog on the EDT (#8259)
`FlutterModuleBuilder` settings validation happens off the `EDT`, which is great for performance but it means we need to take an extra step when wanting to display dialogs. Fixes: #8243 --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent 6a7750d commit d7d0b0a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

flutter-idea/src/io/flutter/module/FlutterModuleBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ private static VirtualFile findEmbeddedModuleFile(@NotNull VirtualFile baseDir,
258258
public boolean validate(@Nullable Project current, @NotNull Project dest) {
259259
final String settingsValidation = validateSettings(getAdditionalSettings());
260260
if (settingsValidation != null) {
261-
Messages.showErrorDialog(settingsValidation, "Error");
261+
OpenApiUtils.safeInvokeLater(() -> {
262+
Messages.showErrorDialog(settingsValidation, "Error");
263+
});
262264
try {
263265
Files.deleteIfExists(Path.of(dest.getBasePath()));
264266
}

0 commit comments

Comments
 (0)