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.

example/gtfs_realtime_bindings_example.dart

import 'package:http/http.dart' as http;

import 'package:gtfs_realtime_bindings/gtfs_realtime_bindings.dart';

void main() async {
  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}.');
  }
}
4
likes
140
points
61
downloads

Publisher

verified publishervycius.lt

Weekly Downloads

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

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

fixnum, protobuf

More

Packages that depend on gtfs_realtime_bindings