@@ -37,6 +37,7 @@ public class DevToolsUrl {
3737 private final boolean canUseMultiEmbed ;
3838
3939 public final DevToolsIdeFeature ideFeature ;
40+ private final String ideName ;
4041
4142 @ NotNull private final DevToolsUtils devToolsUtils ;
4243
@@ -53,6 +54,7 @@ public static class Builder {
5354 private @ Nullable FlutterSdkVersion flutterSdkVersion ;
5455 private WorkspaceCache workspaceCache ;
5556 private DevToolsIdeFeature ideFeature ;
57+ private String ideName ;
5658
5759 private DevToolsUtils devToolsUtils ;
5860
@@ -133,6 +135,12 @@ public Builder setFlutterSdkUtil(FlutterSdkUtil flutterSdkUtil) {
133135 return this ;
134136 }
135137
138+ @ NotNull
139+ public Builder setIdeName (String ideName ) {
140+ this .ideName = ideName ;
141+ return this ;
142+ }
143+
136144 @ NotNull
137145 public DevToolsUrl build () {
138146 if (devToolsUtils == null ) {
@@ -164,6 +172,7 @@ private DevToolsUrl(Builder builder) {
164172 this .flutterSdkVersion = builder .flutterSdkVersion ;
165173 this .ideFeature = builder .ideFeature ;
166174 this .sdkUtil = builder .flutterSdkUtil ;
175+ this .ideName = builder .ideName != null ? builder .ideName : getIdeName ();
167176
168177 if (builder .workspaceCache != null && builder .workspaceCache .isBazel ()) {
169178 this .canUseMultiEmbed = true ;
@@ -182,9 +191,10 @@ public String getUrlString() {
182191 final List <String > params = new ArrayList <>();
183192
184193 String ideValue = sdkUtil .getFlutterHostEnvValue ();
185- params .add ("ide=" + (ideValue == null ? UNKNOWN_INTELLIJ_NAME : ideValue ));
194+ String ideParamValue = ideValue == null ? UNKNOWN_INTELLIJ_NAME : ideValue ;
195+ params .add ("ide=" + URLEncoder .encode (ideParamValue , StandardCharsets .UTF_8 ));
186196 params .add ("dashTool=intellij-plugins" );
187- params .add ("dashIdeName=" + URLEncoder .encode (getIdeName () , StandardCharsets .UTF_8 ));
197+ params .add ("dashIdeName=" + URLEncoder .encode (this . ideName , StandardCharsets .UTF_8 ));
188198 if (colorHexCode != null ) {
189199 params .add ("backgroundColor=" + colorHexCode );
190200 }
0 commit comments