value property

dynamic value

Implementation

dynamic get value => _value;
void value=(dynamic newValue)

Implementation

set value(dynamic newValue) {
  final unwrappedValue = _unwrap(newValue);
  if (unwrappedValue is String) {
    _type = Type.string;
    _rawString = unwrappedValue;
  } else if (unwrappedValue is int || unwrappedValue is num) {
    _type = Type.number;
    _rawNum = unwrappedValue;
  } else if (unwrappedValue is List) {
    _type = Type.list;
    _rawList = unwrappedValue;
  } else if (unwrappedValue is bool) {
    _type = Type.bool;
    _rawBool = unwrappedValue;
  } else if (unwrappedValue is Map) {
    _type = Type.map;
    _rawMap = Map.from(unwrappedValue);
  } else {
    _type = Type.unknown;
    error = _JSONNilReason('${unwrappedValue.toString()}');
  }
  _value = unwrappedValue;
  if (unwrappedValue == null) {
    _type = Type.nil;
    error = _JSONNilReason.nullObject();
  }
}