diff --git a/flutter-idea/src/io/flutter/devtools/DevToolsUrl.java b/flutter-idea/src/io/flutter/devtools/DevToolsUrl.java index 489caa56f..2c8abd45d 100644 --- a/flutter-idea/src/io/flutter/devtools/DevToolsUrl.java +++ b/flutter-idea/src/io/flutter/devtools/DevToolsUrl.java @@ -29,6 +29,7 @@ public class DevToolsUrl { private final FlutterSdkUtil sdkUtil; private final boolean canUseDevToolsPathUrl; + private final boolean canUseMultiEmbed; public final DevToolsIdeFeature ideFeature; @@ -147,12 +148,13 @@ private DevToolsUrl(Builder builder) { if (builder.workspaceCache != null && builder.workspaceCache.isBazel()) { this.canUseDevToolsPathUrl = true; - } - else if (flutterSdkVersion != null) { + this.canUseMultiEmbed = true; + } else if (flutterSdkVersion != null) { this.canUseDevToolsPathUrl = flutterSdkVersion.canUseDevToolsPathUrls(); - } - else { + this.canUseMultiEmbed = flutterSdkVersion.canUseDevToolsMultiEmbed(); + } else { this.canUseDevToolsPathUrl = false; + this.canUseMultiEmbed = false; } } @@ -172,7 +174,7 @@ public String getUrlString() { params.add("theme=" + (isBright ? "light" : "dark")); } if (embed) { - params.add("embed=true"); + params.add(this.canUseMultiEmbed ? "embedMode=one" : "embed=true"); } if (fontSize != null) { params.add("fontSize=" + fontSize); diff --git a/flutter-idea/src/io/flutter/sdk/FlutterSdkVersion.java b/flutter-idea/src/io/flutter/sdk/FlutterSdkVersion.java index ef081d2f8..0bcda58b0 100644 --- a/flutter-idea/src/io/flutter/sdk/FlutterSdkVersion.java +++ b/flutter-idea/src/io/flutter/sdk/FlutterSdkVersion.java @@ -111,6 +111,9 @@ public class FlutterSdkVersion implements Comparable { @NotNull private static final FlutterSdkVersion MIN_SUPPORTS_DEEP_LINKS_TOOL = new FlutterSdkVersion("3.19.0"); + @NotNull + private static final FlutterSdkVersion MIN_SUPPORTS_DEVTOOLS_MULTI_EMBED = new FlutterSdkVersion("3.23.0-0.1.pre"); + @Nullable private final Version version; @Nullable @@ -280,6 +283,10 @@ public boolean canUseDeepLinksTool() { return version != null && this.compareTo(MIN_SUPPORTS_DEEP_LINKS_TOOL) >= 0; } + public boolean canUseDevToolsMultiEmbed() { + return version != null && this.compareTo(MIN_SUPPORTS_DEVTOOLS_MULTI_EMBED) >= 0; + } + public boolean isValid() { return version != null; }