Refactor Xcode instance lookup (#10763)
Use a top-level getter in mac.dart rather than a static instance getter
and a top-level getter in ios_workflow.dart. Makes this code consistent
with how we do context lookups elsewhere.
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart
index 5e2337a..a646650 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -35,6 +35,8 @@
IMobileDevice get iMobileDevice => context.putIfAbsent(IMobileDevice, () => const IMobileDevice());
+Xcode get xcode => context.putIfAbsent(Xcode, () => new Xcode());
+
class PythonModule {
const PythonModule(this.name);
@@ -120,9 +122,6 @@
}
}
- /// Returns [Xcode] active in the current app context.
- static Xcode get instance => context.putIfAbsent(Xcode, () => new Xcode());
-
bool get isInstalledAndMeetsVersionCheck => isInstalled && xcodeVersionSatisfactory;
String _xcodeSelectPath;