appKey property

String? get appKey

The modules of the app with their variants, and the values that the case gives the options of the roles, each as --<name>=<value> in the order of the names, which tell apart the apps of different cases, or null if the case did not resolve.

It has what the case asks for, not what the roles chose, so a harness that does not render tells the apps apart too.

Implementation

String? get appKey {
  final resolution = this.resolution;
  if (resolution == null) return null;
  final modules = [
    for (final module in resolution.modules)
      '${module.id}(${module.variant ?? ''})',
  ]..sort();
  final options = [
    for (final MapEntry(:key, :value) in contractCase.roleOptions.entries)
      if (value != null) '--$key=$value',
  ]..sort();
  return [modules.join(','), ...options].join(' ');
}