JsonTag class Null safety

The json tag. It generates a JavaScript object by converting the given Dart expression into a JSON object.

[:json name=expression /]

It generates

<script id="name" type="text/plain">jsonEncode(expression)</script>

And, you can retrieve it in Dart with:

var data = jsonDecode(document.query("#data").innerHtml)
Inheritance

Constructors

JsonTag()

Properties

hasClosing bool
Whether this tag requires a closing tag, such as [/if].
read-only, override
hasContent bool
Whether this tag generates any content to the response's output. [...]
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
name String
The tag name.
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

begin(TagContext tc, String data) → void
Called when the beginning of a tag is encountered.
override
end(TagContext context) → void
Called when the ending of a tag is encountered.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited