search static method

List<SearchResult> search(
  1. dynamic jsonData,
  2. String query, {
  3. bool caseSensitive = false,
  4. bool exactMatch = false,
  5. bool useRegex = false,
  6. bool ignoreDiacritics = false,
  7. Set<Type>? allowedTypes,
  8. SearchTarget searchTarget = SearchTarget.both,
  9. Map<String, String>? nestedSearch,
})

Performs a deep search in JSON data for a given query Returns a list of matches with their paths

Implementation

static List<SearchResult> search(
  dynamic jsonData,
  String query, {
  bool caseSensitive = false,
  bool exactMatch = false,
  bool useRegex = false,
  bool ignoreDiacritics = false,
  Set<Type>? allowedTypes,
  SearchTarget searchTarget = SearchTarget.both,
  Map<String, String>? nestedSearch,
}) {
  final results = <SearchResult>[];
  _searchRecursive(
    jsonData,
    query,
    [],
    results,
    caseSensitive: caseSensitive,
    exactMatch: exactMatch,
    useRegex: useRegex,
    ignoreDiacritics: ignoreDiacritics,
    allowedTypes: allowedTypes,
    searchTarget: searchTarget,
    nestedSearch: nestedSearch,
  );
  return results;
}