module property

  1. @override
ModuleInterface module
override

Implementation

@override
ModuleInterface get module {
  final modules = [
    (_canWearEcg12, wearEcg12.module),
    (_canCardioClick, cardioClick.module),
    (_canWearCardioT, wearCardioT.module),
    (_canCustom, custom?.module)
  ];
  final sorted = priority.indexed.toList()..sort((a, b) => b.$2 - a.$2);
  final selected = sorted
      .map((e) => modules[e.$1].$1 ? modules[e.$1].$2 : null)
      .firstOrNull;

  if (selected != null) return selected;
  return scanner;
}
void module=(ModuleInterface _module)
inherited

Implementation

late ModuleInterface module = createModule();