findPackageSwift static method

File? findPackageSwift(
  1. String projectPath,
  2. ProjectType projectType
)

Find Package.swift for iOS projects

Implementation

static File? findPackageSwift(String projectPath, ProjectType projectType) {
  if (projectType == ProjectType.ios || projectType == ProjectType.flutter) {
    final dir = Directory(projectPath);
    final files = dir.listSync(recursive: true).whereType<File>();
    for (final file in files) {
      if (file.path.endsWith('Package.swift')) {
        return file;
      }
    }
  }
  return null;
}