Json class abstract
A safe json model for wrapping json values
- Implementers
- Annotations
-
- @immutable
Constructors
- Json.boolean(bool value)
-
constfactory
- Json.fromJson(Object? value)
-
Creates a Json from a valid Json value.
throws Exception if
value
could not be coerced into a Jsonfactory -
Json.list(List<
Json> value) -
constfactory
-
Json.map(Map<
String, Json> value) -
constfactory
- Json.none()
-
constfactory
- Json.number(num value)
-
constfactory
- Json.str(String value)
-
constfactory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
{bool shallow = false}) → Object? -
Returns a serializable Json value.
if
shallow
, it will not serialize inner Json values -
toJsonShallow(
) → Object? - Returns the inner json value
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
T> ({required T map(Map< String, Json> ), required T list(List<Json> ), required T number(num), required T boolean(bool), required T str(String), required T none(Null)}) → T - Executes the given callback when [this.value is of the type parameter.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
- graphQLType → GraphQLJsonType
-
The
GraphQLType
associated with Jsonno setter