Universal Native Apps with Flutter

Flutter Provides A Compelling Alternative To True Native Development

Introduction

Flutter is one of the newer frameworks for developing cross-platform mobile applications. In its 5 years of existence, it has grown into a mature, full-featured development kit that rivals and, for the most part, exceeds others that have been around the same time or longer, such as React Native and Xamarin. Flutter has a large user base and has grown in popularity substantially. According to Google Trends, it finally broke away from React Native as a search term in early 2020.

“Native” vs. Native

It is important to understand the distinction of the multiple uses of the word "native" when it comes to mobile development.

  1. "Native" has a native look and feel
  2. Native compiles to native code

Most modern SDKs for mobile development will provide some sort of look-and-feel that matches the native OS (iOS or Android). However, most SDKs such as React Native and Xamarin rely on some sort of virtual machine (for tasks such as parsing JavaScript, managing garbage collection, etc.). Flutter not only supports a native look-and-feel, but it also compiles Dart down to native code. For standard applications, this may not provide a huge performance boost, but depending on the complexity of the application, it can be quite substantial and very close to native performance, especially with CPU-intensive tasks.

Declarative vs. Imperative

Flutter, similar to React Native, makes use of declarative as opposed to imperative programming. If you're used to the more imperative style of programming (coming from a non-web background such as Swift, Objective-C, or Java in Android), this might be a bit of a "jump" for you. In simplest terms, think of imperative programming as the HOW I want the program to do something and declarative as the WHAT I want it to do.

The nice thing about declarative-based syntax, especially for UI development, is that there is a clear separation of concerns with how you want to interact with the user (both input and output) vs. what you want the application to do.

Dart

For those used to languages like Swift, Java, and C#, Dart should be a pretty familiar language. Some advantages of using Dart are...

  1. Compiles to native code (on ARM and x86) and Javascript.
  2. Provides a VM during development to allow for fast hot reloading.
  3. Syntax is geared toward fast UI development (similar to ECMAScript 6 in many ways)

Dart (and Flutter for that matter) provide a BSD-3 Clause licensing model. In a nutshell, it means you can use/modify/sell the code, but you have to give credit to the original copyright holder of that code somewhere.

Toolchain

Flutter has SDKs and toolchains that run on Windows, macOS, and Linux. If you are deploying apps to iOS, you must have a Mac with XCode installed. It is highly recommended that you go through the Getting Started section contained in Flutter's documentation to get acquainted with how things work.

Most of the tools that you use revolve around the "flutter" command-line tool. This includes package management, scaffolding, creating builds, etc. The two primary editors you can use are Visual Studio Code and Android Studio. I prefer Visual Studio Code, but both are pretty well supported for Flutter development.

Flutter's documentation is very good, especially if you're coming from other environments such as Swift (iOS), React Native, Android and Xamarin.

Ecosystem

Dart (and by extension, Flutter) has its own package management system. If you have used npm or yarn, this should be relatively familiar to you. As of this writing, Flutter has a thriving ecosystem with over 12,000 packages.

Conclusion

Given the popularity and support behind Flutter, it is a fine choice for most applications that need to be developed for both iOS and Android. In fact, there is even some experimental support for targeting macOS and web as well. So, while true native development is still the best option (if you want the richest experience on a given platform), Flutter definitely provides a compelling alternative that should reduce development time substantially as opposed to having to support multiple codebases.

Introducing the JBS Quick Launch Lab!

FREE 1/2 Day Assessment

Quantify what it will take to implement your next big idea! Our intensive 1/2 day session will deliver tangible timelines, costs, high-level requirements, and recommend architectures that will work best, and all for FREE. Let JBS show you why over 20 years of experience matters.
Yes, I'd Like A FREE Assessment