gtfs_bindings 0.1.0
gtfs_bindings: ^0.1.0 copied to clipboard
A wrapper package around GTFS Schedule datasets.
example/gtfs_bindings_example.dart
import 'dart:io';
import 'package:gtfs_bindings/schedule.dart';
Future<void> main() async {
// https://eu.ftp.opendatasoft.com/stif/GTFS/IDFM-gtfs.zip - Île de France
// https://exs.tcar.cityway.fr/gtfs.aspx?key=OPENDATA&operatorCode=ASTUCE - Astuce
final dataset = DownloadableDataset(
Uri.parse(
'https://exs.tcar.cityway.fr/gtfs.aspx?key=OPENDATA&operatorCode=ASTUCE',
),
);
await dataset.pipe(
tempDir: Directory('/tmp'),
); // Preferably use path_provider's getTemporaryDirectory
await dataset.populateList(dataset.bindings);
print('${await dataset.routes.count()} routes were counted');
}