An annotation used to generate a private field containing the contents of a JSON file.
The annotation can be applied to any member, but usually it's applied to top-level getter.
In this example, the JSON content of
data.json is populated into a
top-level, final field
_$glossaryDataJsonLiteral in the generated file.
@JsonLiteral('data.json') Map get glossaryData => _$glossaryDataJsonLiteral;
- asConst → bool
trueif the JSON literal should be written as a constant.final
- hashCode → int
The hash code for this object. [...]
- path → String
The relative path from the Dart file with the annotation to the file
containing the source JSON.
- runtimeType → Type
A representation of the runtime type of the object.