gtfs_realtime_bindings 1.0.1 copy "gtfs_realtime_bindings: ^1.0.1" to clipboard
gtfs_realtime_bindings: ^1.0.1 copied to clipboard

Provides Dart classes generated from the GTFS-realtime Protocol Buffer specification.

Dart GTFS-Realtime Language Bindings #

Provides Dart classes generated from the GTFS-realtime Protocol Buffer specification. These classes will allow you to parse a binary Protocol Buffer GTFS-realtime data feed into Dart or Flutter.

Usage #

The following code snippet demonstrates downloading a GTFS-realtime data feed from a particular URL, parsing it as a FeedMessage (the root type of the GTFS-realtime schema).

final url = Uri.parse('URL of your GTFS Realtime feed');
final response = await http.get(url);

if (response.statusCode == 200) {
  final feedMessage = FeedMessage.fromBuffer(response.bodyBytes);

  print('Number of entities: ${feedMessage.entity.length}.');
} else {
  print('Request failed with status: ${response.statusCode}.');
}
1
likes
120
pub points
65%
popularity

Publisher

verified publishervycius.lt

Provides Dart classes generated from the GTFS-realtime Protocol Buffer specification.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

fixnum, protobuf

More

Packages that depend on gtfs_realtime_bindings