After reading yet another piece on “Why We Switched To/From CrossPlatform/Native”, I decided that it was time to examine the state of cross platform app development for myself and not rely on the opinions of others, as their reasons for landing on their chosen solutions vary.
After watching the talks at this year’s Google I/O and Apple’s WWDC, it’s clear that the development puck in mobile is moving toward declarative UI with reactive state management. Much like Swift and AutoLayout, despite my initial feelings about these technologies, I’ve had to reconcile them against the reality of their increased presence. I believe that cross-platform development is no different. It’s simply a matter of the form that I find most palatable.
What about SwiftUI?
While my original intent was to build a SwiftUI app in time for the release of iOS 13 but I ran into too many issues early on to make that viable. However, these approaches are not mutually exclusive and maintaining development “purity” is far less important to me than putting solutions into people’s hands. Done is better than perfect after all. For now, I think a side-by-side comparison of the respective approaches of SwiftUI/Combine versus Flutter will provide enough some insight into where each each is in terms of maturity and utility. There may still be cases where the SwiftUI/Combine approach would make the most sense.
I’ve decided to proceed with a few of my existing iOS apps as a base to provide a point for comparison, each with escalating complexity.
A transit schedule app, for the Goldsboro-Wayne Transit Authority in Goldsboro, North Carolina, this is the simplest of my current apps. The goal here is to finally provide the long intended Android version to complement the iOS version that shipped in 2018. There are 3 screens of content that will provide a solid foundation using Flutter for:
- connecting to Firebase to provide bus route data (JSON)
- displaying provide route and estimated bus locations on a map
- simple UI animations and transitions
I’m bringing my very first mobile app back from the grave. The current iteration is being built natively on iOS in Swift but I’d like if I can move faster with a cross-platform approach (factoring in the learning curve). The original version of the app was as simple as GWTA but the latest incarnation in more complex and will provide a nice testbed beyond the basics so that I can see what Flutter/Dart is capable of, specifically:
- how to implement business logic in Dart versus Swift
- advanced UI animations and transitions
- shared user data (e.g. leaderboards and song lists) in Firebase
My expense tracking app for digital nomads will provide an opportunity to investigate state management in Flutter, as there are various screens throughout the app that are affected by changes to expenses. The newest version is almost ready to ship on iOS and getting a comparable Android version built will take some effort. On the positive side, I will be forced to ship smaller, more frequent updates in order to reach parity. From there, I will evaluate whether I should port the iOS version over to Flutter.
I have no idea where I’m going to land on the cross-platform vs. native debate but I imagine that like all things in development, the age old answer of “it depends” will still apply.