casesOfAll method

List<ContractCase> casesOfAll()

The cases of the apps with as many modules as one app can have, one for every combination of providers of the roles that take at most one and have several.

Each has the provider of the combination of those roles, the first registered provider of every other role that takes one, every provider of a role that takes many, and every other module that fits: neither it nor a module it depends on provides a role that takes one and has another provider in the app, and each has a variant for the provider of the role of its variants. A combination whose provider does not fit has no case.

Implementation

List<ContractCase> casesOfAll() => [
      for (final picked in _picksOf([
        for (final role in registry.roles)
          if (!role.cardinality.allowsMany) role,
      ]))
        if (_caseOfAll(picked) case final contractCase?) contractCase,
    ];