Skip to content

BLOG

Why we prefer Flutter for cross-platform development:
How it minimises drawbacks and maximises advantages

What is Flutter?

Flutter is a software development kit for building cross-platform applications targeting iOS, Android, Web and Desktop.
It uses Dart, a programming language that supports all modern features one would expect in 2020.

How does Flutter work?

Traditionally, the way other cross-platform solutions handle UI elements is by having you define what type of element you want and where you want it, and then they place the platform’s native control there. Illustrated below is how React Native does this:
reactive_way

This leads to your app looking different on every platform. And every difference is a possible source of bugs.

Instead, Flutter has its own UI elements that it draws on every platform in the same way using the platform’s canvas (a UI element that allows custom drawing). This makes the app look and behave exactly the same on every platform, thus giving your app its own look ‘n feel.

flutter_way

Accessing native resources (such as you device’s camera or Bluetooth) is similarly simple.

Flutter provides a standardized way to communicate with native code, this means that anything that native code can do, can be incorporated into your Flutter app.

flutter_native

Advantages over other cross-platform solutions

Performance
Flutter’s performance is very close to native, as illustrated by the following experiment.

100 iterations of mathematical calculations regarding the number Pi were executed in different languages. As there are different types of performance, two CPU-intensive algorithms were used:

  • Gauss–Legendre algorithm
  • Borwein’s algorithm

The time it took to complete the entire task was measured in milliseconds (ms). Lower is better.

flutter_graph_android
flutter_graph_ios

As you can see, Flutter scores very well on the performance front. This leads to your app feeling snappier and more responsive. Additionally this will decrease your app’s battery usage.

Look and feel (adaptive layout)
Since you use your own widgets (or Flutter’s built in ones), they will be styled the same way and behave the same way on every platform. A consistent look and feel for an app is important. But, in case you’d still like to adhere to the platform’s look and feel, Flutter gives you the possibility to create a platform-specific UI using widgets made to emulate the current platform’s controls. This means you can have a separate UI for iOS, Android, Windows, …
On top of that, Flutter provides many layout tools that allow your GUI to fluidly adapt to a device’s screen size and orientation.

This way your app can make smart use of additional screen space when running on a tablet instead of a phone for example.

Easy to develop with
Flutter provides the developers with some cool features that really speed things up.

The first and arguably the most impressive feature is their ‘hot reload’. This means that you can run the Flutter app on your device, change the code and see those changes reflected immediately on your device. No more minutes-long wait for everything to be compiled and copied over.

Secondly, the profiler is pretty in-depth and clear. This helps developers to identify (performance) problems easier, leading to faster, more stable apps that use less resources.

flutter_devtools