A client for accessing the TfL API.
Please note that Client for TfL API is unofficial and not endorsed by TfL.
-
Add this package to your application.
dart pub add tfl_api_client
-
Create a variable to store your app key.
final appKey = Platform.environment['APP_KEY'];
-
Obtain an HTTP client using your app key.
final client = clientViaAppKey(appKey);
-
Create an API client using the HTTP client.
final api = TflApiClient(client: client);
-
Fetch data from the TfL API using the API client.
final lines = await api.line.get(['metropolitan']);