withDifferentPackageCondition method

AccessDetermined withDifferentPackageCondition(
  1. String appId,
  2. Package package,
  3. String packageCondition,
  4. bool value,
)

Implementation

AccessDetermined withDifferentPackageCondition(
    String appId, Package package, String packageCondition, bool value) {
  var newAccesses = {...accesses};
  if (newAccesses[appId] != null) {
    var newPackageConditionsAccess = {
      ...newAccesses[appId]!.packageConditionsAccess
    };
    newPackageConditionsAccess[packageCondition] = value;
    newAccesses[appId] = newAccesses[appId]!
        .copyWith(packageConditionsAccess: newPackageConditionsAccess);

    return withNewAccesses(newAccesses);
  } else {
    return this;
  }
}