Skip to content

Commit

Permalink
[deep link]Update the logic to check both androidVariants and iosBuil…
Browse files Browse the repository at this point in the history
…dOptions to decide if a repo is a flutter project. (#8338)

* Update select_project_view.dart

Update select_project_view.dart

Update the logic about if the repo is a flutter project or not.

* resolve comments
  • Loading branch information
hangyujin authored Sep 30, 2024
1 parent f1117d3 commit 11bb202
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,6 @@ class _SelectProjectViewState extends State<SelectProjectView>
if (!mounted) {
return;
}
if (androidVariants.isEmpty) {
ga.select(
gac.deeplink,
gac.AnalyzeFlutterProject.flutterInvalidAndroidProjectSelected.name,
);
await showNonFlutterProjectDialog();
}
XcodeBuildOptions iosBuildOptions = XcodeBuildOptions.empty;
if (FeatureFlags.deepLinkIosCheck) {
iosBuildOptions = await _requestiOSBuildOptions(directory);
Expand All @@ -141,6 +134,15 @@ class _SelectProjectViewState extends State<SelectProjectView>
gac.AnalyzeFlutterProject.flutterProjectSelected.name,
);
}

if (androidVariants.isEmpty && iosBuildOptions.configurations.isEmpty) {
ga.select(
gac.deeplink,
gac.AnalyzeFlutterProject.flutterInvalidProjectSelected.name,
);
await showNonFlutterProjectDialog();
return;
}
controller.selectedProject.value = FlutterProject(
path: directory,
androidVariants: androidVariants,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ enum AnalyzeFlutterProject {
/// An invalid flutter project has been selected.
///
/// This can be a result of the user didn't select a Flutter project or
/// their Android sub project threw error when parsing.
flutterInvalidAndroidProjectSelected,
/// their Android and iOS sub project both threw error when parsing.
flutterInvalidProjectSelected,

/// Used for recording the time spent in loading Android variants.
loadVariants,
Expand Down

0 comments on commit 11bb202

Please sign in to comment.