Hit.fromJson constructor

Hit.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Hit.fromJson(Map<String, dynamic> json) {
  return Hit(
    exprs: (json['exprs'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    fields: (json['fields'] as Map<String, dynamic>?)?.map((k, e) => MapEntry(
        k, (e as List).whereNotNull().map((e) => e as String).toList())),
    highlights: (json['highlights'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    id: json['id'] as String?,
  );
}