getLine static method

Future<RouteLine> getLine(
  1. String lineCode
)

Implementation

static Future<RouteLine> getLine(String lineCode) async {
  Uri url =
      Uri.parse("https://ws.tib.org/sictmws-rest/lines/ctmr4/$lineCode");
  try {
    Uint8List responseBytes =
        await httpClient.get(url).then((value) => value.bodyBytes);
    return RouteLine.fromJson(json.decode(utf8.decode(responseBytes)));
  } on FormatException {
    throw FormatException("Something went wrong.");
  }
}