Status.fromJson constructor

Status.fromJson(
  1. Object? j
)

Implementation

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