parseConfig method

Map<String, dynamic> parseConfig(
  1. String content
)

Parse content into the fields this doctor validates.

Reuses GenerateCommand.parseDeeplinkConfig for teamId, bundleId, packageName, fingerprints and paths rather than scanning the file a second time: a doctor that reads the config differently from the generator could pass while the generator produces nothing. domain is added here because the generator never needed it — AASA/assetlinks content does not carry a host — but the platform checks below do.

Implementation

Map<String, dynamic> parseConfig(String content) {
  final config = GenerateCommand().parseDeeplinkConfig(content);

  final domainMatch = RegExp(r"'domain':\s*'([^']*)'").firstMatch(content);
  if (domainMatch != null) {
    config['domain'] = domainMatch.group(1);
  }

  return config;
}