If the image is not self-explanatory enough, here’s what it means.
I am the lamb.
Lamb Bobby is stuck between a rock (Flutter) and a rock (React Native)
Lamb Bobby is trying to figure out what Lamb Bobby wants to do.
Lamb Bobby has figured it out and is writing a blog post.
Hybrid apps have always been on my radar. Early on it was Ionic, then it became React Native, and currently, it’s Flutter.
what is a hybrid app
There’s a decent amount to unpack there, but this lamb won’t go too much into it. I’ll just give a few bullet points and you can take it from there.
- iOS and Android apps share the same codebase
- Always some sort of method loading / injecting web code (HTML, CSS, JS) into mobile
- Considerably slower than native code
I can pretty confidently state that Ionic and React Native are two of the most widely used hybrid app frameworks. I only have had personal experience with React Native so I do have a bit more knowledge about it.
In short, Ionic is built on top of Cordova which basically spins up a WebView that renders the JS that you write, almost like a web app. In my opinion, it’s very close to a Progressive Web App but better when it comes to compatibility and performance.
Speaking of performance, because you are writing web code to be rendered on a mobile phone, there will always be performance issues, especially with lower-end devices.
React Native has gotten a lot of traction in the past few years, mostly because of its performance compared to other hybrid frameworks and it’s a lower barrier of entry for current React and Web developers.
Here’s a great article that goes into how React Native actually works: https://hackernoon.com/understanding-react-native-bridge-concept-e9526066ddb8.
Flutter is relatively new compared to Ionic and React Native. It is also less adopted than the aforementioned frameworks.
Flutter popped up in my news feed right after 1.5 was announced at Google I/O in May. I mostly caught my eye because it was newer and I like new things :D.
Flutter, like Ionic and React Native is pitched as a cross-platform hybrid framework. Web is also mentioned as well as mobile, but I have other thoughts on mobile and web sharing a codebase…
Dart supports both Ahead-of-Time (AOT) compiling to native code which makes the combination of Dart and Flutter very fast. However, Dart also has Just-in-Time compiling which allows for fast development time with Flutter’s stateful hot-reload.
Here’s some sample code to compare Typescript with Dart.
Here’s the same code written in Dart
what is right for me
However, after doing some initial discovery and research, I ended up not using React Native. So I guess I’m not between a rock and a hard place anymore.
To make this section more informative, I’ll come up with a few reasons why Flutter is the way to go for a hybrid app.
very, very fast
Theming is very important when it comes to a hybrid app. Android and iOS design spec, icons, UI elements are very different. In order to follow the platform design rules, the “theme” of the app should be different on each platform.
Flutter makes it very easy.
Flutter has pretty decent documentation for being a younger framework. I have been able to find everything on flutter’s documentation.
All documentation can be found here: https://flutter.dev/docs
Firebase is Google’s Backend-as-a-Service platform. From what I’ve read, it’s really good even at scale. For my project, I’ll probably be using Firebase so the easy integration was a big plus for me. There setup instructions are pretty minimal and keeping in the Google ecosystem definitely helps.
I believe flutter is on track to be a very dominating framework when it comes to hybrid apps, it might even be bigger than React Native in the mobile world.
Flutter provides a near-native experience for the user but with the benefits of being cross-platform. However, because the need to learn a new language along with a framework, the learning curve is quite large and potentially difficult for engineers to learn and get going.
I’m very excited about learning Flutter and Dart, be looking out for deep dives into Flutter and Dart from me soon.