getWithinName static method

APIRoot? getWithinName(
  1. String part, {
  2. bool lastAsDefault = false,
  3. bool caseSensitive = false,
})

Implementation

static APIRoot? getWithinName(String part,
    {bool lastAsDefault = false, bool caseSensitive = false}) {
  if (!caseSensitive) {
    part = part.toLowerCase();
  }

  return getWhere((apiRoot) {
    var n = caseSensitive ? apiRoot.name : apiRoot.name.toLowerCase();
    return n.contains(part);
  }, lastAsDefault: lastAsDefault);
}