Warning.fromJson constructor

Warning.fromJson(
  1. Object? j
)

Implementation

factory Warning.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Warning(
    code: switch (json['code']) {
      null => null,
      Object $1 => decodeString($1),
    },
    data: switch (json['data']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Data.fromJson(i)],
      _ => throw const FormatException('"data" is not a list'),
    },
    message: switch (json['message']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}