ModelSource class

Constructors

ModelSource({String? engine, String? favicon, String? snippet, String? title, String? url})
Returns a new ModelSource instance.

Properties

engine ↔ String?
Engine is the search backend the hit came from: bing, ddg, mojeek or brave. Omitted when the backend did not name itself. Results are merged across backends, so two sources in one answer can carry different engines.
getter/setter pair
favicon ↔ String?
Favicon is a 64px icon URL derived from the host for the client to render beside the citation. It is Google's s2 service, not something we host or fetched — an empty host yields the empty string.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
snippet ↔ String?
Snippet is the engine's summary of the page, clipped to 600 runes. THIS IS WHAT THE CLIENT SHOWS. What the model reads is the fetched page, which is far larger and deliberately never on the wire.
getter/setter pair
title ↔ String?
Title is the page title the engine reported, stripped of the bracketed furniture engines staple on ("PDF", "(Official Site)"). It falls back to the www-stripped host when the engine gave none, so it is never empty and is safe to use as link text.
getter/setter pair
url ↔ String?
URL is the page, absolute, exactly as the engine gave it. It is also the dedupe key — one source per URL, and at most hostCap per host — and what a markdown citation in the answer is checked against, so a link in the prose always matches a URL here.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → ModelSource?
Returns a new ModelSource instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<ModelSource>
mapFromJson(dynamic json) → Map<String, ModelSource>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<ModelSource>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.