RouteAsPath.fromJson constructor

RouteAsPath.fromJson(
  1. Object? j
)

Implementation

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