JsonValue typedef
JsonValue = Object?
A JSON-compatible value type.
Represents any value that can be serialized to JSON:
- String
- int/double (num)
- bool
- null
- Map<String, Object?> (JsonObject)
- List<Object?> (containing JsonValue elements)
Using Object? instead of dynamic provides better type safety:
- Compile-time checks prevent calling non-existent methods
- Forces explicit type checking/casting before use
- IDE provides better autocomplete and error detection
Implementation
typedef JsonValue = Object?;