doSearch method

List<UcumConcept> doSearch(
  1. UcumModel model,
  2. ConceptKind? kind,
  3. String text,
  4. bool isRegex,
)

Implementation

List<UcumConcept> doSearch(
    UcumModel model, ConceptKind? kind, String text, bool isRegex) {
  final List<UcumConcept> concepts = <UcumConcept>[];
  if (kind == null || kind == ConceptKind.prefix) {
    searchPrefixes(concepts, model.prefixes, text, isRegex);
  }
  if (kind == null || kind == ConceptKind.baseUnit) {
    searchUnits(concepts, model.baseUnits, text, isRegex);
  }
  if (kind == null || kind == ConceptKind.unit) {
    searchUnits(concepts, model.definedUnits, text, isRegex);
  }
  return concepts;
}