fromJson static method

Acquisition? fromJson(
  1. Map<String, dynamic>? json
)

Creates an Acquisition from its JSON representation. If the acquisition can't be parsed, a warning will be logged with warnings.

Implementation

static Acquisition? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  final jsonObject = Map<String, dynamic>.of(json);
  final type = jsonObject.optNullableString('type', remove: true);
  if (type == null) {
    return null;
  }

  return Acquisition(
    type: type,
    children: fromJsonArray(jsonObject.optJsonArray('child', remove: true)),
  );
}