isValid property

bool get isValid

Validate this JSON value.

This JSON value is considered valid if it is an atomic value (of type Null, bool, int, double, or String), or it is a composite value (of type List<dynamic> or Map<String, dynamic>. The elements and values of the latter are ignored.

If a recursive validation is required then the static function isDeepValid can be used.

Implementation

bool get isValid =>
    value == null ||
    value is bool ||
    value is int ||
    value is double ||
    value is String ||
    value is List<Json> ||
    value is Map<String, Json>;