22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5+ import 'package:unified_analytics/unified_analytics.dart' ;
6+
57import '../base/common.dart' ;
68import '../base/file_system.dart' ;
79import '../base/logger.dart' ;
10+ import '../features.dart' ;
811import '../plugins.dart' ;
912import '../project.dart' ;
1013import 'cocoapods.dart' ;
@@ -21,20 +24,26 @@ class DarwinDependencyManagement {
2124 required CocoaPods cocoapods,
2225 required SwiftPackageManager swiftPackageManager,
2326 required FileSystem fileSystem,
27+ required FeatureFlags featureFlags,
2428 required Logger logger,
29+ required Analytics analytics,
2530 }) : _project = project,
2631 _plugins = plugins,
2732 _cocoapods = cocoapods,
2833 _swiftPackageManager = swiftPackageManager,
2934 _fileSystem = fileSystem,
30- _logger = logger;
35+ _featureFlags = featureFlags,
36+ _logger = logger,
37+ _analytics = analytics;
3138
3239 final FlutterProject _project;
3340 final List <Plugin > _plugins;
3441 final CocoaPods _cocoapods;
3542 final SwiftPackageManager _swiftPackageManager;
3643 final FileSystem _fileSystem;
44+ final FeatureFlags _featureFlags;
3745 final Logger _logger;
46+ final Analytics _analytics;
3847
3948 /// Generates/updates required files and project settings for Darwin
4049 /// Dependency Managers (CocoaPods and Swift Package Manager). Projects may
@@ -87,6 +96,7 @@ class DarwinDependencyManagement {
8796 // whether to run.
8897 useCocoapods = _plugins.isNotEmpty;
8998 }
99+
90100 if (useCocoapods) {
91101 await _cocoapods.setupPodfile (xcodeProject);
92102 }
@@ -95,6 +105,21 @@ class DarwinDependencyManagement {
95105 else if (xcodeProject.podfile.existsSync () && xcodeProject.podfileLock.existsSync ()) {
96106 _cocoapods.addPodsDependencyToFlutterXcconfig (xcodeProject);
97107 }
108+
109+ final Event event = Event .flutterInjectDarwinPlugins (
110+ platform: platform.name,
111+ isModule: _project.isModule,
112+ swiftPackageManagerUsable: xcodeProject.usesSwiftPackageManager,
113+ swiftPackageManagerFeatureEnabled: _featureFlags.isSwiftPackageManagerEnabled,
114+ projectDisabledSwiftPackageManager: _project.manifest.disabledSwiftPackageManager,
115+ projectHasSwiftPackageManagerIntegration:
116+ xcodeProject.flutterPluginSwiftPackageInProjectSettings,
117+ pluginCount: totalCount,
118+ swiftPackageCount: swiftPackageCount,
119+ podCount: podCount,
120+ );
121+
122+ _analytics.send (event);
98123 }
99124
100125 /// Returns count of total number of plugins, number of Swift Package Manager
0 commit comments