getBusStopInformation static method

Future<List<Services>> getBusStopInformation(
  1. String busStopID
)

Implementation

static Future<List<Services>> getBusStopInformation(String busStopID) async {
  final response = await http.get(
    Uri.parse("https://www.rach.codes/api/bustiming?id=${busStopID}"),
    // headers: {"AccountKey": "bkGxFUZWTkSpnymtSGJdJQ=="}
  );
  // print(response.body);
  var x = json.decode(response.body)['data']['services']
  .map((data) => Services.fromJson(data))
  .toList();
  print(x);
  List<Services> streetsList = List<Services>.from(x);
  return streetsList;
}