In late 2018 Google's Flutter cross-platform development tool reached version 1.0. In this article we ask whether Flutter is suitable for production apps.
About a year ago, Novoda published an article comparing the various mobile cross-platform solutions then on offer. Now Flutter is no longer a beta product, we have decided to take a deeper look at it.
This article covers the following areas: what Flutter is, the Flutter ecosystem, the Dart language, existing apps developed in Flutter, and how much Flutter is affected by the issues that have troubled cross-platform development in the past.
What is Flutter?
Dart is a modern language which allows 'Just In Time' compilation (JIT). This enables Flutter’s killer feature, ‘stateful hot reloading’. During development, Flutter apps can be rebuilt with minor code changes while they are still running. This radically increases the speed of development, and allows designers and developers to pair together to develop UIs in real time.
Flutter provides its own UI libraries for iOS and Android, allowing developers to produce apps which are visually indistinguishable from native ones. This contrasts with older cross-platform solutions such as Xamarin and Cordova, which offer a somewhat sub-standard user experience.
How large is the Flutter ecosystem?
The Dart package manager lists around 2000 Flutter-compatible packages written in the current version of Dart. There are packages implementing SDKs for many common APIs, although naturally the offering is not as complete as for native apps yet. This means that many third party services can be integrated with Flutter already without writing additional code
There is no easily accessible roadmap for the future of Dart on the project Github page, so it is difficult to say whether the next version of the language will also contain changes affecting existing packages. There is a roadmap for Flutter development for 2019, and it’s good to see that the team is prioritising key gaps in functionality, such as the lack of decent support for maps.
There is an active and rapidly growing Flutter community on Stack Overflow:
Dart is also the second most used language at Google internally (source).
The increase in Flutter question views seems to have happened at the expense of React Native and Xamarin, according to this graph (source ):
This suggests that the developer community is in general more excited by Flutter than by other cross-platform solutions, which means it likely to be an easier sell to a development team than React Native or Cordova.
While announcing Flutter 1.0, the Flutter team mentioned the Flutter repository is also one of the most active on Github, and that around 250,000 developers have used the platform.
The Flutter showcase site lists a variety of apps that have been implemented using Flutter. Most are fairly small in scale, and many seem to be developer side projects, although there are a couple of high-profile ones (notably the Chinese retailer Alibaba, and a video streaming app produced by Tencent).
I found the experience of learning Dart straightforward. The syntax of the language is similar to other C based languages, and will offer few surprises to anyone familiar with Java or Swift. There are a few idiosyncrasies and pitfalls, as with any new technology.
Dart provides libraries for unit and UI testing, which means it is easy to produce high-quality, well-tested code in Flutter projects, meaning your Flutter project doesn’t just have to be a throw-away prototype but could form the basis of a production-level app.
While there are not many developers on the market with Dart skills, I don't feel that this is a serious impediment to staffing a Flutter team: the learning curve for the language is so shallow that most developers from a native mobile or web background should be able to pick it up in a few days.
Part of the problem with assessing Flutter at the moment is that not many large apps have been implemented using it. Despite this, several developers have written about their experience building apps in Flutter. This section provides a survey of their findings.
The Hamilton app is a companion for the popular musical about the American Revolution. The agency that developed the app, GoPosse, are very pleased with Flutter, because it allowed them to develop more features for the app than would otherwise have been possible in the time available. They plan to recommend it to future clients. They note that in the rare cases where Flutter doesn't support a native feature, it is easy enough to drop in a native screen (the app has a few camera-based features, but in general doesn't integrate with many device-specific capabilities).
Flutter is also used by the Google AdWords team for both their web and mobile offerings, where it has delivered considerable time savings. However this particularly scenario (Dart being used on multiple platforms) is not a common one outside Google.
Easy Diet Diary
Gary Hunter ported his Easy Diet Diary app to Flutter and wrote an article describing the experience. He found it easier to develop reusable UI components in Flutter than in iOS, and believes Flutter development to be faster than iOS/Android overall. He also had some positive things to say about the responsiveness and culture of the Flutter community.
Tetsuhiro Ueda implemented a large scale app using Flutter. He chose Flutter over React Native and Xamarin, and in his article notes that he found UI development in Flutter to be rapid, but that the platform still has rough edges. Ueda also cites the fact that Flutter is open source as a key advantage - it is always possible to debug the Flutter framework itself, if necessary (and of course, if you have time).
The Chinese company Alibaba recently used Flutter to build some key screens in a mobile app for their Xianyu secondhand trading platform, which has over 50 million users.
In a Google post on pitching Flutter to clients Wm Leler states that Flutter reduced the time Alibaba required to develop new features from a month to two weeks. The Alibaba team have also produced a video on adopting Flutter,
But it appears the path was not completely smooth: in a post on Flutter optimization, they remark:
"In computing, as in much of life, any given method can see a lot of use before its latent flaws reach a decisive impasse. For Alibaba, discovering one such flaw in software development kit Flutter meant the difference between success and failure in the group’s recent work"
The key issue was with capturing high memory images of native screens (such as video frames or screenshots). While Alibaba were able to solve this problem, the fact that they ran into it in the first place highlights the risks a company takes if it chooses to use a relatively young cross-platform framework such as Flutter. The article discusses how to synchronize Flutter bug fixes from the public
master to a forked version of Flutter - also possibly a red flag, since one of the reasons AirBnb cited for dropping React Native is that they had to maintain their own fork of it.
The consensus seems to be that Flutter makes sense if your app doesn't rely too heavily on native capabilities. Developing Flutter apps that will need plugins is possible, but likely won’t be much quicker than writing two native solutions.
Does Flutter offer a solution to previous issues with cross-platform development?
Issues with previous cross-platform solutions.
Native app developers tend to have a highly sceptical view of cross-platform development. This is often partly because they have been burned by it before, and partly because they are sceptical of the underlying technology.
I last worked with a cross-platform technology (Cordova) in 2013, and found that it struggled to deliver on its promises: we spent a great deal of time writing platform specific plugins, effectively negating a lot of the time savings the technology purported to offer.
This is a fairly representative experience: in the annual Stack Overflow developer survey for 2018 Cordova and Xamarin came first and second in the the 'Most Dreaded Frameworks, Libraries, and Tools' category.
More recently, Facebook's React Native has been touted as a cross-platform silver bullet. It gained some traction a year or so ago, with various high-profile companies (AirBnb, Udacity, Walmart) choosing to implement at least part of their apps with it. Unfortunately, its reputation was somewhat tarnished when several of these companies subsequently abandoned the platform, and in the case of AirBnb and Udacity, published blog posts explaining why.
Does Flutter solve these problems?
On the other hand, the fact that Dart is a new language is also a disadvantage. React Native devs have access to the vast library of code provided by the
npm package manager - the Dart equivalent is much smaller.
Nonetheless, Flutter does seem to be a step forward from React Native technically speaking. But it needs to gain more traction before it can be considered a better solution than React Native in all respects.
Most modern cross-platform solutions such as React Native and Flutter can clearly deliver on the promise of rapid UI development; even those companies that have adopted and then discarded React Native acknowledge this. The problem is that this is only part of the story - this is merely the requirement to 'get a foot in the door'. Even relatively 'minor' issues can have a disproportionate effect on development time, especially when the whole team is learning a new technology.
Flutter is currently suitable for prototyping and less complex production projects, but not for large-scale apps, unless you are willing to take on a considerable amount of risk and have the development resources and institutional support to work around the issues you will probably run into.
For most projects, this would likely outweigh the key benefit of using Flutter in the first place, which is to save money and time.
Nevertheless, the first production apps in Flutter are beginning to emerge, and the platform certainly seems to be gaining popularity rapidly, at least in the developer community.
Looking at things from a slightly longer term perspective, the quality of the underlying technology makes it likely that effort put into developing plugin/packages for Flutter/Dart would be worthwhile. I'm cautiously optimistic that it could be used for larger scale projects in the near future, as soon as there is reliable package support for more common APIs in Dart. When exactly this might be is an open question, but I'd suggest taking another look in a year to six months.