Skip to content

Commit d40ab0c

Browse files
authoredApr 12, 2022
Look for a single module by name (#6098)
1 parent e74192f commit d40ab0c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎flutter-idea/src/io/flutter/utils/FlutterModuleUtils.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -341,21 +341,19 @@ public static boolean convertFromDeprecatedModuleType(@NotNull Project project)
341341
return modulesConverted;
342342
}
343343

344+
// Return true if there is a module with the same name as the project plus the Android suffix.
344345
public static boolean hasAndroidModule(@NotNull Project project) {
345-
boolean isAllMatch = true;
346346
for (PubRoot root : PubRoots.forProject(project)) {
347347
assert root != null;
348348
String name = PubspecYamlUtil.getDartProjectName(root.getPubspec());
349349
String moduleName = name + "_android";
350-
boolean isMatch = false;
351350
for (Module module : FlutterModuleUtils.getModules(project)) {
352351
if (moduleName.equals(module.getName())) {
353-
isMatch = true;
352+
return true;
354353
}
355354
}
356-
isAllMatch = isAllMatch && isMatch;
357355
}
358-
return isAllMatch;
356+
return false;
359357
}
360358

361359
public static boolean isDeprecatedFlutterModuleType(@NotNull Module module) {

0 commit comments

Comments
 (0)
Please sign in to comment.