Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tnc1997/dart-tfl-api-client

Please note that Client for TfL API is unofficial and not endorsed by TfL.
https://github.com/tnc1997/dart-tfl-api-client

client dart tfl-api

Last synced: 20 days ago
JSON representation

Please note that Client for TfL API is unofficial and not endorsed by TfL.

Awesome Lists containing this project

README

        

# Client for TfL API

A client for accessing the TfL API.

Please note that Client for TfL API is unofficial and not endorsed by TfL.

## Getting Started

1. Add this package to your application.

```shell
dart pub add tfl_api_client
```

1. Create a variable to store your app key.

```dart
final appKey = Platform.environment['APP_KEY'];
```

1. Obtain an HTTP client using your app key.

```dart
final client = clientViaAppKey(appKey);
```

1. Create an API client using the HTTP client.

```dart
final api = TflApiClient(client: client);
```

1. Fetch data from the TfL API using the API client.

```dart
final lines = await api.line.get(['metropolitan']);
```