0

Is there a way that I can use OpenTripPlanner in Flutter? I'm able to set it up locally on my laptop with GTFS but I don't know how to implement it in Flutter.

For context, I'm building a public transport journey planner app.

Your help will be greatly appreciated.

Many thanks.

Boxxy
  • 1
  • The only way I see it doing in its current state is using the `Java` or `Kotlin` interop with Flutter. Take a look for example here -> https://docs.flutter.dev/development/platform-integration/platform-channels?tab=android-channel-java-tab – mutantkeyboard Jan 08 '22 at 21:33
  • You should not try to integrate OTP into your app, since the graph files can get very large and you would have to update the app itself every time there is an update to the transit schedules. The correct way to do this is to run an OTP server that you maintain and have your app make queries to it. – danielhep Jul 13 '23 at 19:13

1 Answers1

0

OpenTripPlanner provides a web client and API. For Flutter you might be able to use a WebView like an iframe and embed the OpenTripPlanner web front-end.

Alternatively you'd have to create your own mapping front-end with Dart and fetch the appropriate OpenTripPlanner API end points. (A lot more work though).

http://dev.opentripplanner.org/apidoc/2.0.0/resource_IndexAPI.html

cwoods
  • 101
  • 1
  • 2