JsonNode.fromJson constructor

JsonNode.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory JsonNode.fromJson(Map<String, Object?> json) {
  return JsonNode(
    array: json[r'array'] as bool? ?? false,
    bigDecimal: json[r'bigDecimal'] as bool? ?? false,
    bigInteger: json[r'bigInteger'] as bool? ?? false,
    bigIntegerValue: (json[r'bigIntegerValue'] as num?)?.toInt(),
    binary: json[r'binary'] as bool? ?? false,
    binaryValue: (json[r'binaryValue'] as List<Object?>?)
            ?.map((i) => i as String? ?? '')
            .toList() ??
        [],
    boolean: json[r'boolean'] as bool? ?? false,
    booleanValue: json[r'booleanValue'] as bool? ?? false,
    containerNode: json[r'containerNode'] as bool? ?? false,
    decimalValue: json[r'decimalValue'] as num?,
    double$: json[r'double'] as bool? ?? false,
    doubleValue: json[r'doubleValue'] as num?,
    elements: json[r'elements'] as Map<String, Object?>?,
    fieldNames: json[r'fieldNames'] as Map<String, Object?>?,
    fields: json[r'fields'] as Map<String, Object?>?,
    floatingPointNumber: json[r'floatingPointNumber'] as bool? ?? false,
    int$: json[r'int'] as bool? ?? false,
    intValue: (json[r'intValue'] as num?)?.toInt(),
    integralNumber: json[r'integralNumber'] as bool? ?? false,
    long: json[r'long'] as bool? ?? false,
    longValue: (json[r'longValue'] as num?)?.toInt(),
    missingNode: json[r'missingNode'] as bool? ?? false,
    null$: json[r'null'] as bool? ?? false,
    number: json[r'number'] as bool? ?? false,
    numberType: json[r'numberType'] != null
        ? JsonNodeNumberType.fromValue(json[r'numberType']! as String)
        : null,
    numberValue: json[r'numberValue'] as num?,
    object: json[r'object'] as bool? ?? false,
    pojo: json[r'pojo'] as bool? ?? false,
    textValue: json[r'textValue'] as String?,
    textual: json[r'textual'] as bool? ?? false,
    valueAsBoolean: json[r'valueAsBoolean'] as bool? ?? false,
    valueAsDouble: json[r'valueAsDouble'] as num?,
    valueAsInt: (json[r'valueAsInt'] as num?)?.toInt(),
    valueAsLong: (json[r'valueAsLong'] as num?)?.toInt(),
    valueAsText: json[r'valueAsText'] as String?,
    valueNode: json[r'valueNode'] as bool? ?? false,
  );
}