Day 11 — Flutter: A Tool for Rapid Prototyping?

Charles Bond
henngeblog

--

Flutter is a cross-platform development tool for Android and IOS. Since its first major release in 2018, Flutter has had a reasonable amount of growth as a platform, with nearly 40% of cross-platform developers reporting using flutter in 2020. While cross-platform tools of this nature tend to become a bit unwieldy with high performance and highly complicated tasks, they can help teams cope with constrained resources early in a product lifecycle. In this article, we will briefly go over some ease of learning, the look and feel of apps, and the reusability of the product to see how useful a tool Flutter can be as a starting point for a resource-constrained project.

Ease of Learning

Flutter is primarily driven by Dart, and for developers already in the mobile space, Dart may look very familiar. Though it is clearly a very different language, it has a very familiar syntax for basic language operations like loops and class structure as well as advanced features like futures and reactive and flow-based programming. This part at least should help developers working on business logic parts of the code removed from the UI layer.

Past the basic familiarity though, there are quite a lot of big differences. UI layout on flutter looks nothing like UI layouts on Android or IOS and can take some time to get used to. The code tends to look more “crowded” as UI components, theming and assignment code can often be mashed together. It’s also important to note that the basic UI component called the “widget” and has little to no similarity to the Activity/Fragment system of Android or ViewController frameworks. This does mean that even experienced Android or iOS developers will have to learn an entirely new UI framework as part of learning how to write an app in Flutter. On the plus side though, it does somewhat relieve the need for new developers to learn about the UI frameworks of each platform separately (at least initially).

Android(left) and Flutter(right) “glue code” compared
Android layout xml (left) and Flutter UI code (right) from autogenerated projects compared

One last point on the platform is the level of library maturity. Since the platform is quite new, there is not yet the level of standardization in 3rd party libraries that currently exist in iOS and Android. There are a lot of libraries out there for popular use cases like data storage, web access, and state management but industry standards are still forming and there are a lot of libraries that are quite new and in unsafe beta forms. This means that writing any complex application may require a lot of extra research or perhaps even extra code to get things that an experienced developer can write quite quickly on one of the existing platforms.

From an ease of learning perspective, Flutter does have the advantage of familiar coding patterns, but has a completely alien UI framework for existing developers and has a somewhat immature 3rd party library ecosystem.

Look and Feel

One of the biggest features of Flutter is its ability to readily generate a unified UI design across platforms. This feature not only produces a unified appearance but also usually identical behavior patterns of the app which can be difficult to achieve when two separate apps are developed on different platforms. Consistency between apps can help with branding since separate apps may not always look the same and may have lags between updates where new branding is represented in one app while not showing in another. Its also helpful with the reduction of workload of marketing materials, app screenshots are virtually identical and can be shared across promotional materials. Even from a tech support angle, it’s quite helpful to have a fully unified UI in this way as help instructions to users don’t have to be quite as customized for each platform. These are just a few of the reasons why the identical UI shared across platforms that Flutter provides can be desirable to a project, especially when resources are constrained and the app needs to get to market relatively quickly.

Reusability

The final thing to consider when using Flutter as a platform is the ability to reuse code down the line as the project matures. Since the platform is still relatively new, it's highly likely that the state of the art 3rd party libraries will change quite a bit in the next few years, this may lead to a need to re-write the Flutter code multiple times if the project stays in the original codebase. There is also the drawback that by the nature of targeting multiple platforms, Flutter can’t really fully support the latest features of each OS as they come out. As is the case with many cross-platform languages, Flutter does offer the ability to pass through functionality to the individual platforms in their native languages, but this kind of code is usually the most troublesome to maintain in a cross-platform project as it is not only different for each platform, may require constant updating but also requires the developers of the project to learn more about the Android and iOS platform than they may have needed to know to start writing Flutter. Similarly, the code produced by a compiled flutter project does not produce native Android or iOS if decompiled, so it’s not really reusable code if the project shifts gears to write fully native apps in Swift or Kotlin later in the development cycle. Do to these reasons, its fairly likely that a project that starts in Flutter may need significant rewrites over time, especially if the project has a lot of need to use the latest OS features or access features that are outside of the standard Flutter APIs.

Conclusions

Flutter has a familiar code feel for users of modern mobile programming languages, but it’s also pretty radically different on the UI front and as a young language new users may struggle to pick good 3rd party libraries. The unified look and feel that results from Flutter’s cross-platform tools make design, marketing, and user support less complicated and generally reduces unexpected differences between the iOS and Android versions of the app. The code produced may be more difficult to maintain though, especially with more complicated projects and where the latest OS features are necessary. Taking all of these things into account, it seems that Flutter can provide a reasonable path for fewer developers to produce a single, relatively simple app to get to market quickly while reducing costs, so long as needed to do significant or even complete rewrites for later versions. From this perspective, Flutter could be a reasonable language to use for rapid prototyping for the mobile platforms on teams where there are not enough experienced developers to handle both platforms.

This article is part of the HENNGE Advent Calendar 2020. An Advent calendar is a special calendar used for counting down the days till Christmas. HENNGE Advent Calendar 2020 presents one article by one HENNGE member per day for 25 days until Christmas, 2020.

--

--

Charles Bond
henngeblog

A Software developer from the Pacific Northwest region of the US who has been working in the Android space since 2010. Joined HENNGE in May 2020.