Flutter is a relatively new platform for mobile developers. Similar to Microsoft Xamarin or React Native (or less known Scade) it allows to develop apps both for Android and iOS. But it is also a platform which Google wants to use in its future projects like Fuchsia. In this post I’d like to share with you an iOS developer's take on Flutter.
Google is pushing a lot to develop the Flutter framework. Sice 2017, this mobile framework has been getting more and more features. Similar to Xamarin or React Native, it allows to build mobile apps from the same code written in Dart. Flutter has its own philosophy (Widgets), supports external plugins and will be very likely used in future Google projects, just like the already mentioned Fuchsia.
Google's support and long term development make Flutter a great tool for mobile developers. This is why I had decided to look closer at this framework. After a few months of getting accustomed to Flutter, I’d like to share some thoughts about its pros and cons. Let’s start with the best features.
Unlike Xcode (but this will soon change with Xcode 13), Flutter allows for fast app reloading. You can do this on both real device and Simulator. This feature is a gamechanger in terms of everyday work. Flutter enables you to almost live-check the developed changes.
SwiftUI-like layout design
It’s clear that Apple copied SwiftUI from React Native and other modern platforms. Thanks to its declarative syntax, Flutter helps mobile developers create views fast and in a stable way. Similarly to ReactNative, views can be easily reused in many controllers. No AutoLayouts, no constraints - just simplicity and pure code.
Differently than Xcode, Flutter is focused on smaller parts called widgets. These elements can be used not only as replacements for MVC controllers, but also as working and reusable parts. This means that for example ListView used in one part of the app can be easily reused as a part of another view.
The fact that Google stands behind Flutter makes this project quite reliable. I suppose that the company from Mountain View will make it the core element of Fuchsia in the future.
Easy to learn
For Android developers, Flutter is piece of cake. For iOS devs - maybe not harder, but a little different than Xcode. Although after some time you’ll appreciate features like hot reload or layout design. And Dart is maybe not Swift, but still easy to learn and use.
Android-like, not iOS like
Well, yes, Flutter has something called Cupertino Widgets. These iOS-style elements have to be replaced for lack of native iOS design. Flutter is by default suited for universal apps. It means that default views and widgets will be prepared for Android, not iOS. If you want to get iOS-like effect, you must use Cupertino Widgets or create them on your own.
This is a common problem of new frameworks. And also those frameworks that support more than one mobile platform. Some features that are available „out of the box” in Xcode, need to be implemented on your own in Flutter or by using external plugins.
Right now, Flutter supports only mobile platforms. This is not a big deal, but you must know that there is no macOS support. Xcode will have it soon - thanks to the Catalyst project. Maybe in some future Google will add support for desktop solutions.
Dart != Swift
Although Dart isn’t hard to learn, it has many differences that can be uneasy to grasp for Swift developers. In my personal opinion, there are more similarities between Dart and Java than Dart and modern languages (like Swift or Kotlin). What was inconvenient for me was the lack of structs, extensions and optionals. For more details check this article.
In my opinion as an iOS developer, using the Flutter framework can be a good idea - at least if you know your project and are aware of its advantages and downsides. Right now, I’m starting to move one of my Swift-based apps to Flutter and I do it very carefully. I hope to share some thoughts with you about this particular case very soon!
At Prograils, we stay on top of mobile development trends. Thinking about a mobile application? Let us know, we will get back to you!