Flutter is Google’s open source cross-platform mobile development framework. Build high-performance, beautiful applications for iOS and Android with one set of code. It is also the development platform for Google’s upcoming Fuchsia operating system. In addition, its architecture can be introduced to other platforms via a custom Flutter engine.

Flutter characteristics

Flutter attempts to make mobile development friendlier by providing developers with an application framework and a portable runtime engine. The framework builds on the Skia graphics library and provides the actual rendering of parts, not just the packaging of native controls.

Flutter can be developed across platforms with the same flexibility as the Web, but at the same time provides smooth performance. The widget library and open source widgets that come with Flutter make it a feature-rich platform. In short, Flutter is the closest thing to the ideal platform for mobile developers to use for cross-platform development, with almost no compromise in flexibility and performance.

Dart

Flutter is developed using the Dart language developed by Google. Google gave the following reasons for choosing Dart to develop Flutter:

  1. The Dart runtime and compiler support a combination of two key features of Flutter:
  • Rapid JIT-based development cycles that allow shape changes and stateful thermal overloading using the language of types;
  • And an AOT compiler that generates efficient ARM code that can be started quickly and has predictable production deployment performance.
  1. Developer productivity. One of Flutter’s main value propositions is that it saves engineering resources by letting developers create apps for iOS and Android using the same code base. Using an efficient language can further speed up the development cycle and make Flutter more attractive. This is very important for both our Framework team and our developers. Most of Flutter functionality is implemented using Dart, so we need to be efficient at 100,000 lines of code without sacrificing the readability of the framework and widgets.
  2. Object oriented. We could use a non-object-oriented language, but that would mean reworking several difficult issues. In addition, most developers have experience with object-oriented development, so it is easier to learn how to develop with Flutter.
  3. Predictable, high performance. With Flutter, we want to enable developers to quickly create a fluid user experience. To do this, we need to be able to run a lot of code in each animation frame. This means that we need a language that provides both high performance and predictable performance without periodic pauses that result in frame loss.
  4. Fast memory allocation. The Flutter framework uses functional streams, which rely heavily on the underlying memory allocator. It is important to handle small, short-term memory allocations efficiently, so Flutter cannot work effectively in languages that lack this functionality.

Flutter schedule

  • Flutter (originally codenamed Sky) was demonstrated at the Dart Developer Summit in April 2015
  • In November 2015, Sky renamed Flutter
  • Flutter Beta 1 was officially announced at Mobile World Congress 2018 in February 2018
  • In April 2018, Flutter Beta 2 was officially announced
  • Flutter Beta 3 was officially announced on Google I/O in May 2018. In June 2018, Flutter Preview 1 was released
  • In September 2018, Flutter Preview 2 was released
  • In December 2018, The official Version 1.0 of Flutter was released

Flutter

Flutter is divided into Framework and Engine. We developed our App based on the Framework running on Engine. Each module is introduced as follows:

Framework

Material

Flutter provides a rich set of Material Widgets to help you build applications that follow Material Design.

Cupertino

Flutter also offers a rich set of Cupertino(iOS) -style widgets

Widgets

The Flutter Widget is built with a modern responsive framework and is said to be inspired by React. The main job of a Widget is to implement a build function that builds itself. A widget usually consists of lower-level widgets. The Flutter framework builds these widgets in turn until the lowest child widgets, usually the RenderObject, are built, which calculates and describes the widget’s geometry.

Rendering

The Flutter Widgets library uses the RenderObject hierarchy to implement its layout and draw back ends. You can use custom RenderBox classes in your application to handle specific effects. But most of the time, you just use the RenderObject hierarchy to debug layout issues.

If you develop your library or application directly on the Rendering library, you need to BindingBase it. The default Widgets already have a Flutter complete binding. You can also create your own binding using RenderingFlutterBinding. At a minimum, you need to import ServicesBinding, GestureBinding, SchedulerBinding, PaintingBinding, and RendererBinding.

Animation

The Flutter animation library provides two animation types, tween and physics-based.

  1. Tween animation is short for “between the two”. In Tween, you define the start and end points, the time line, and the curve that defines the time and speed of the transformation. The framework then calculates how to transition from the start point to the end point.
  2. In physics-based animation, motion is simulated as behavior similar to the real world. For example, when you throw a ball, where it lands depends on how fast it is thrown, how heavy it is, and how far it is from the ground. Similarly, a ball attached to a spring is dropped (and bounced) in a different way than a ball attached to a string.

Painting

The library contains the Drawing API for the Flutter engine for more specialized purposes, such as drawing scaled images, interpolating between shadows, drawing borders around boxes, etc.

Gestures

Gesture provides Gesture recognition functionality, including a touch event class definition and a variety of built-in Gesture recognizers.

Engine

The Flutter engine is fully implemented in C++ and provides the Dart runtime and typeset engine (libtxt) and drawing engine Skia. SKia is a 2D drawing engine library that can directly transfer data to GPU for drawing through OpenGL or Vulkan. Chrome and Android both use Skia as a drawing engine. Skia provides a very friendly API and provides friendly and efficient performance in graphics conversion, text rendering, and bitmap rendering. Skia is cross-platform, so it can be embedded into the iOS SDK of Flutter without having to explore iOS closed source Core Graphics/Core Animation.