A utility package to read the contents of a GTFS Schedule dataset.
Features
- GTFS Schedule
-
Files
x
agency.txtx
stops.txtx
routes.txtx
trips.txtx
stop_times.txtx
calendar.txtx
calendar_dates.txt
Unsupported files (WIP)
-
Features
x
Load data from any supported file using query parametersx
List services for one or more daysx
Works with streamed datax
List directions for a routex
See next departures from a stop
-
Getting started
Add this package to your Dart/Flutter project :
dart pub add gtfs_bindings
flutter pub add gtfs_bindings
Usage
Schedule
Construct a GTFSDataset
, populate (load in memory) its primary bindings, enjoy.
import 'package:gtfs_bindings/schedule.dart';
import 'package:path_provider/path_provider.dart';
Future<void> main() async {
final dataset = DownloadableDataset(uri); // Place the URL to the dataset here.
await dataset.pipe(tempDir: await getTemporaryDirectory()); // Will download and cache the dataset (do not fill tempDir while on Web).
await dataset.populateList(dataset.primaryBindings); // Will load the main small files into memory for faster access.
}
Additional information
WIP: THIS IS NOT STABLE. The API may change at any instant. Please wait for 1.0.0 to start deeply integrating any function. The actual APIs to query data are stable
Libraries
- schedule
- Support for doing something awesome.
- schedule_fast_seek