Cross-platform mobile apps with Flutter

If you are developing mobile apps using cross-platform development tools like React Native, Phonegap or Xamarin, you now have a new option for cross-platform development — Flutter.

Overview

Google launched Flutter SDK (Software Development Kit) for easier cross-platform app development. Flutter SDK can be used to develop apps that give native UI experience for both Android and iOS platforms. To write apps using Flutter, you will have to use Dart programming language. Dart is a programming language that is developed and maintained by Google. Dart is an object-oriented language which can optionally compile into JavaScript. It supports a wide range of programming constructs like interfaces, classes, collections and generics.

Features of Dart :

  • Dart support Ahead Of Time compilation (AOT). This improves app performance and startup time.
  • Dart also support Just In Time compilation (JIT). This allows for hot reloads of Flutter app.
  • Dart compiles to ARM and x86 code. This means Dart-based mobile apps run natively on iOS, Android. Dart code can also be compiled into JavaScript for web apps.

How does it work

Instead of utilizing web view or relying on the device’s OEM widgets, Flutter renders every view component using its own high-performance rendering engine. This allows building applications with native-like performance characteristics. The engine’s C/C++ code is compiled with NDK on Android and LLVM on iOS. Any Dart code is AOT-compiled to native code during compilation.

Flutter app is composed of Widgets (Stateless or Stateful). These Widgets are rendered onto a Skia canvas and sent to the platform. The platform shows the canvas and sends events back.

Platform

Flutter provides platform specific shell. Dart VM is hosted inside this shell and provides access to the native platform APIs. The shell also provides communication to the relevant IMEs (e.g. Keyboard) and the systems application lifecycle events.

Engine

The engine’s C and C++ code is compiled with Android’s NDK or iOS’s LLVM. The Dart code (both the SDK and the App code) is ahead-of-time (AOT) compiled into native ARM library. This library is included in “runner” Android/IOS project, and combined into .apk or .ipa. When launched, the app loads the Flutter Library. Any rendering, input or event handling is delegated to the compiled Flutter and app code.

Framework

The Flutter framework contains everything you need to develop an app. Flutter apps look like native iOS or Android application, simply by using the right themes. Cupertino is a theme for iOS, and Material is a theme for Android.

Flutter updates the UI at 60fps mostly using GPU. Widgets written in Dart are compiled to native widgets that are directly connected to Native SDK. There is no need for middle layers like bridge in Phonegap. Flutter directly renders widgets on Skia canvas within its engine running on the native platform.

Conclusion

Google’s Flutter makes the app development process easier. People who used to develop cross-platform apps should give it a try.

Thanks for reading. If you enjoyed this article, feel free to hit that clap button 👏 to help others find it.

This article is a part of the series of articles related to mobile technology. If you are looking for a Mobile app development team to build your solution, please contact us at info@47billion.com.