2021-08-28 04:35:58 +03:00
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
import 'package:http/http.dart' as http;
|
|
|
|
import 'package:info_tren/api/common.dart';
|
2022-10-31 01:25:45 +01:00
|
|
|
import 'package:info_tren/models.dart';
|
2021-08-28 04:35:58 +03:00
|
|
|
|
|
|
|
Future<StationData> getStationData(String stationName) async {
|
2022-08-05 01:52:08 +03:00
|
|
|
final response = await http.get(Uri.https(authority, 'v3/stations/$stationName'));
|
2021-08-28 04:35:58 +03:00
|
|
|
return StationData.fromJson(jsonDecode(response.body));
|
2022-08-05 01:52:08 +03:00
|
|
|
}
|