Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flutter] Frontend components #106

Open
ianthetechie opened this issue May 8, 2024 · 1 comment
Open

[Flutter] Frontend components #106

ianthetechie opened this issue May 8, 2024 · 1 comment
Labels
android enhancement New feature or request flutter help wanted Help wanted from the community iOS UI/UX Related to the UI/UX (on any platform)

Comments

@ianthetechie
Copy link
Contributor

Basically there are two paths toward a Flutter frontend.

  1. "Flutter native" approach
  2. Wrapping the SwiftUI and Jetpack Compose components from iOS and Android

I'll lay out the pros and cons of each approach here.

Flutter native

We can leverage Flutter MapLibre GL to get MapLibre on all platforms with Flutter bindings that are idiomatic and (ostensibly) easy to optimize for efficiency. There would only be one additional layer of binding between the C++ core and Flutter's state management (which determines redraw timing, much like other modern composable reactive frameworks). In fact, it would even let us support flutter web and (once MapLibre adds macOS support back) desktop through a single library. That'd be pretty cool ;)

The only downside here is that we have to maintain another platform and its UI components.

Wrapping SwiftUI and Compose

We already did a lot of the work for iOS and Android; maybe we can reuse it? It seems like Flutter supports SwiftUI views and Compose.

I do not know how much work this is, or how efficient it is. This is a question we'll need to answer before deciding on a path forward. Specifically:

  • Is it an inordinate amount of work to set up the SwiftUI / Compose bindings?
  • Can Flutter users do their own compositions? It would not be a win IMO unless we can provide a composable Flutter widget that wraps the native views (ex: a Flutter Banner widget which wraps the SwiftUI and Compose views on the respective platforms); composability is a huge selling point of Ferrostar's UI layer.
  • Is it significantly less efficient (CPU and RAM profile) / slower than Flutter MapLibre in a simple test (simulating driving a route ideally)?
@ianthetechie ianthetechie added enhancement New feature or request help wanted Help wanted from the community android iOS UI/UX Related to the UI/UX (on any platform) labels May 8, 2024
@ianthetechie ianthetechie added the prod onboarding blocker Blocks production deployment of a known target user label Jul 17, 2024
@ianthetechie ianthetechie removed the prod onboarding blocker Blocks production deployment of a known target user label Aug 27, 2024
@ianthetechie
Copy link
Contributor Author

Update in case anyone is looking for an update, we have reports from a user in Slack successfully using this with Platform Views (the second approach). So this is not a prod onboarding blocker, but it is still something we'd like to make easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android enhancement New feature or request flutter help wanted Help wanted from the community iOS UI/UX Related to the UI/UX (on any platform)
Projects
Status: No status
Development

No branches or pull requests

1 participant