stadiamaps / stadiamaps/ferrostar

[Flutter] Frontend components

Open
#106 1 comment 0 reactions 0 assignees View on GitHub
android enhancement flutter help wanted iOS UI/UX
Dominant language
Kotlin
Stars
419
Forks
81
Avg merge
6d 1h
Merged PRs (30d)
7

Description

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](https://github.com/maplibre/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](https://medium.com/@afridi.khondakar/bridging-the-gap-integrating-native-swiftui-views-in-flutter-4c81828598ba) and [Compose](https://stackoverflow.com/questions/76207369/is-it-possible-to-use-jetpack-compose-in-a-flutter-application).

**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)?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing iOS SwiftUI and Android Jetpack Compose components, then compare them with Flutter MapLibre GL. Document the binding effort, composability, and CPU/RAM behavior in a driving-route test; done means the evidence supports a decided Flutter approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
flutter
Domain
frontend, mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.