getBundleIDSettings method

List<DarwinBundleIDSettings> getBundleIDSettings()

Implementation

List<DarwinBundleIDSettings> getBundleIDSettings() {
  List<DarwinBundleIDSettings> bundleIdSettings = [
    DarwinBundleIDSettings(buildType: kBuildTypeDebug, bundleId: ""),
    DarwinBundleIDSettings(buildType: kBuildTypeProfile, bundleId: ""),
    DarwinBundleIDSettings(buildType: kBuildTypeRelease, bundleId: ""),
  ];
  if (config.bundleId != null) {
    for (var element in bundleIdSettings) {
      element.bundleId = config.bundleId!;
    }
  }

  if (config.bundleIds is Map<String, dynamic>) {
    Map<String, dynamic> map = config.bundleIds as Map<String, dynamic>;
    map.forEach((key, value) {
      bundleIdSettings.add(DarwinBundleIDSettings(buildType: key, bundleId: "$value"));
    });
  }

  bundleIdSettings = bundleIdSettings.where((element) => element.bundleId != "").toList();
  bundleIdSettings = bundleIdSettings.toSet().toList();
  return bundleIdSettings;
}