Flutter—Pros and Cons for Business
Flutter is a fairly young cross-platform mobile framework. From the very beginning, Flutter has been advertised as a toolkit for building natively compiled applications for Android and iOS from single source code (actually Flutter’s possibilities exceeds mobile platforms). Does the idea sound familiar? The slogan “write once, run everywhere” has been around since the 3 main players raised on the market of mobile operating systems: Android, iOS and Windows Phone. The same promise was repeated every time a new cross-platform framework was released—whether it was Xamarin, Iconic, Cordova, or React Native. So do we really need a new framework? Why should we invest time and resources in learning new technology instead of using an established solution?
Flutter significantly reduced the time we needed to develop new features from one month down to two weeks.
Bruce ChenSenior Development Engineer,Alibaba
The whole Flutter ecosystem was created by Google. Even Dart, a programming language used to write Flutter applications. Being fully depending on a single entity always entails some risks. On the one hand, the support of a global giant legitimizes technology and guarantees stable development. On the other hand, abandoning this area by Google would mean a very difficult time for Flutter. It is highly possible that if the other big player did not undertake the maintenance of the technology financially, then Flutter would slowly slip to the margins. Fortunately, this scenario seems to be extremely unlikely because Flutter gained a lot of attention from the developers. One of Google’s teams actively develops and maintains the framework with the participation of an engaged community. During the last Google IO, there were few presentations about Flutter and what is more, the giant from Silicon Valley created a separate conference, dedicated to Flutter.
There is one more interesting thing related to Flutter and Google. In 2016, Google created (without any announcement on their official repository) a new project—Fuchsia. It’s a Mobile Operating system that by default supports Flutter apps. If Fuchsia was released to the market, Flutter would become a cross-platform framework for 3 (!) mobile platforms (Android, iOS, Fuchsia). It would revolutionize mobile app development, but for now, it’s just gossip and guesswork.
It’s quite clear that none of the extremely popular, service-related apps are going to be rewritten in Flutter in the nearest feature. Nevertheless, many great apps are being developed with Flutter, like Philips, Abbey Road Studios, Stadia, Alibaba, Nubank.
Having a popular app written in Flutter would be looking good in your portfolio, however there are many different perspectives of popularity. Is it popular amongst developers? How hard is it to hire a team that is able to write or maintain a Flutter application?
- Dart gained 1.9% in the “Most popular technologies—Programming, Scripting, and Markup Languages” category, which is incomparable to 67.8% gained by JS. But on the same list Kotlin and Swift (the languages used in native mobile platforms) reached ~6.5%.
- Flutter lost with other cross-platform frameworks in the category “Most popular technologies - Other Frameworks, Libraries, and Tools”.
- At the same time, Flutter won in the category “Most Loved, Dreaded, and Wanted Other Frameworks, Libraries, and Tools” with 75% against 62% for React Native.
Compared to other competitors, Flutter is the youngest platform with a lot of hype among mobile developers. It already gained more stars on Github than React Native (93k vs. 87.4k —at the time of writing this article).
I would like to stress the fact that Flutter is a cross-platform framework. Cross-platform means it exceeds mobile platforms and Flutter follows that definition. Thanks to this solution, an app that does not use any specific hardware such as a camera, Bluetooth, etc., could be easily run on any computer with macOS or run as a web page. This opportunity is an immanent feature of the framework so there is no need to introduce any changes into the source code or configuration of the project. Neither Flutter for web nor desktop has been released as a production-ready solution, so starting a project that requires an app to be available both on mobile and web/desktop may come with some risk.
Apart from impressive cross-platform capabilities, Flutter is a mobile-oriented framework that allows you to write an application once and then launch it both on Android and iOS. Flutter uses its own render engine to display an application on a screen which means that the app should look and behave the same, independently from an OS version. On the other hand, Flutter does not use any platform-related, native widgets and UI components. The framework is shipped with a set of widgets following each platform look & feel—e.g. a list of elements or buttons look and behave accordingly to Google and Apple guidelines, still with single source code.
Finally, It is not an exact Flutter feature but in May 2020 AWS announced Dart to be a supported language for writing AWS Lambdas. It could help get Dart more popular.
Google did its homework. Flutter was launched with a highly productive toolchain and environment. Fantastic IDE support (there are official plugins for Android Studio and Visual Studio Code), detailed documentation, a lot of valuable content on Flutter YouTube channels is just a tip of an iceberg.
Code completion works like a charm (at least compared to other cross-platform solutions) and also covers some platform-specific quirks. Flutter is known for a lengthy way of building views that leads to huge structures of nested widgets in the source code. The plugins contain extremely useful refactoring/code generating features that significantly improve speed and efficiency of writing views. They allow developers to focus on the look & feel of the view that is being implemented and the plugins take over a huge part of taking care of proper syntax.
The area of automated tests tends to be crucial in the development process of an application that is supposed to be maintained easily for a long time. From the very beginning, Flutter was shipped with a ready to use and easily configurable unit and functional tests environment. The pattern of writing tests involves solutions known from other languages so any experienced developer does not have to learn a new paradigm of writing tests.
One basic rule of development is to not reinvent the wheel. No one would like to write maps from scratch instead of using Google Maps. No one would like to write analytics or monitoring instead of using Sentry, Crashlitics or Google Analytics. Flutter community and Flutter team itself provided a lot of useful libraries and components so developers could focus on business logic instead of implementing a custom mechanism of secure storing data or BLE connectivity layer.
Of course, it is more likely to find a useful and mature React Native library than a Flutter library (RN has been around way longer). However, the activity of the community and the Flutter team around creating libraries is quite impressive. Flutter Favorite program was launched last year to provide a list of verified and suggested libraries. Last year, pub.dev (the artifactory for Dart and Flutter libraries) was conducting surveys among developers/publishers to tailor service to the needs of the users. The survey took the form of an hour-long telephone conversation. It clearly shows how much they have been committed and engaged in gathering reliable data.
It is hard to provide exact numbers depicting the benefits of Flutter in the context of time to market, development and maintenance cost. There are too many tightly coupled factors influencing the development process. Nevertheless, based on my experience with development of backend monoliths apps, microservices, and Android and React Native applications I feel fairly confident to predict that developing an application with Flutter takes less time and resources than with React Native (assuming that your team has a level of experience in both frameworks).
We found the Flutter development experience to be superior, with better hot reload capabilities, very strong official documentation, and a more stable API.
Alexandre FreireEngineering Manager,Nubank
There are no limitations at all that would be connected strictly to Flutter itself. But there is a bunch of limitations rooted in the cross-platform approach.
Android and iOS are different when it comes to some basic aspects like app restrictions when working in a background, or limitations of hardware related API, like Bluetooth Low Energy. These situations might motivate a decision during the development process to implement a part of the application in a native module. Flutter has a built-in mechanism that allows it to integrate native modules. Fortunately, a lot of common cases like secure storage or BLE support have been already developed by the community.
Another area that could be treated as a limitation is introducing natively looking designs in an app. As I mentioned above, Flutter uses a custom render engine to draw an app on a screen and system (iOS or Android) components are not involved during the process. It means that if a new version of the OS introduces changes to a native widget, it would not be instantly visible on the Flutter app.
There is no simple answer. Basically, if you trust your team and you want to develop an app both on Android and iOS then Flutter is a good choice. If you do not need an application that perfectly recreates every UI detail of a native app but you still need an impressive UI with smooth animations and rich feeling then Flutter is a reliable choice as well.
The platform is equipped with a powerful animation framework, ready to use test frameworks, great documentation and toolchain that enhances developer productivity. You can easily integrate Flutter with native code so even if you need native components, you can still use Flutter. If your app is all about some specific, hardware related feature—like AR, for example— then you should reconsider if perhaps native app development will be more efficient in your case.
On the other hand, Flutter’s advantages don’t justify the decision of rewriting an existing React Native app or forcing an experienced React Native team to switch to Flutter. As you can see, it all depends on your specific project needs. Before you choose the right framework, keep in mind the comfort and preferences of your team—there are many strong opinions regarding React Native vs. Flutter. If you need help with choosing the right approach, get in touch!
Lead Software Engineer