getMacOsBundleId method

Future<String?> getMacOsBundleId()

Implementation

Future<String?> getMacOsBundleId() async {
  List? contentLineByLine = await readFileAsLineByline(
    filePath: macosAppInfoxprojPath,
  );
  if (checkFileExists(contentLineByLine)) {
    logger.w('''
    macOS BundleId could not be changed because,
    The related file could not be found in that path:  $macosAppInfoxprojPath
    ''');
    return null;
  }
  for (var i = 0; i < contentLineByLine!.length; i++) {
    if (contentLineByLine[i].contains('PRODUCT_BUNDLE_IDENTIFIER')) {
      return (contentLineByLine[i] as String).split('=').last.trim();
    }
  }
}