extractSdkVersion static method

String? extractSdkVersion(
  1. File podfile
)

Extract SDK version if specified

Implementation

static String? extractSdkVersion(File podfile) {
  try {
    final content = podfile.readAsStringSync();
    // Match patterns like: pod 'ULinkSDK', '~> 1.0.0'
    // Escape quotes properly in raw string
    final versionPattern =
        RegExp(r"pod\s+['" "]ULinkSDK['" "],\s*['" "]([^'" "]+)['" "]");
    final versionMatch = versionPattern.firstMatch(content);
    return versionMatch?.group(1);
  } catch (e) {
    return null;
  }
}