• Why You Should Give Flutter Some of Your Attention
  • By Bruce Bigirwenkya
  • The Nuggets translation Project
  • Permanent link to this article: github.com/xitu/gold-m…
  • Translator: DateBro
  • Proofread by: Swants

A new way to develop cross-platform mobile applications

What is a Flutter

Flutter is a fully open source mobile APP SDK developed by Google to help developers develop high-quality native interfaces on iOS and Android in a short period of time.

Flutter has just released release preview 1

Why Flutter?

Understanding why Flutter was chosen requires an understanding of its purpose and development history within each platform.

Who is the target user of Flutter

  • Developers who want to build high-performance user interfaces.
  • Web application developers who don’t want to learn the various native platform languages but want to get into the mobile application development layer.
  • Companies that want to attract more users at once.
  • Designers who want application design to align with their vision.

history

Native application development is always distinct from cross-platform development, with its pros and cons.

Cross-platform apps are very attractive. Nevertheless, it continues to evolve, eventually filling the void in the native application development space. Mobile development is also generally young (less than a decade).

This article details the history of view technologies used in mobile development.

The first cross-platform framework uses Web technology and displays a Web view

Before Apple released the iOS SDK, they encouraged third-party developers to build Web apps for the iPhone, so building cross-platform apps with Web technology was an obvious step.

Reactive programming is a programming paradigm that emphasizes asynchronous data flow and event data flow. It has been increasingly used in user interface development for animation and other rendering requirements.

Reactive Web frameworks like ReactJS use reactive programming techniques to simplify building Web views.

Technical classification is based on compilation mechanism and view type

“Bridge”

Traditionally, building cross-platform applications has been a performance penalty because they run in different domains. The application is developed in JavaScript but the interface is completely native. Variables in different domains cannot access each other. Variable and data interactions between different domains must be done through Bridges.

For example, if you debug React Native in Chrome, this means the application will run in two different domains (desktop and mobile). These domains are connected through websockets.

React Native optimizations attempt to keep data exchanges to a minimum at runtime by “bridging.” Eventually, the operation in each environment is smooth but the latency of the exchange across the bridge increases.

Flutter relies on static compilation of the Dart language to solve this problem. This means that the “bridge” is no longer needed at run time because the program is compiled into native code.

component

Window components are elements that control and influence the view and interface of an application. Everything in Flutter is composed. This makes it more self-contained, reusable, and extensible.

layout

Traditional layouts rely on multiple style rules defined in different CSS files. These rules apply to tags, and thus can create multiple possible interactions and contradictions for the rules that are applied. CSS3 has about 375 rules. Regardless of possible inconsistencies in the rules, the probability of a layout is usually order N squared.

Flutter’s redesigned layout is more efficient and intuitive. The layout information is specified separately by the component at modeling time. Not only does this make it easier for developers looking at the code to understand what’s happening, but it also means that the window component doesn’t have the overhead of dealing with rules that might not apply to it.

The Flutter team provides many layout components that they feel work well with. Flutter also has many optimizations around layout, such as caching only when it is necessary to generate large components.

Dart

Dart was used by the Flutter team for several reasons:

  • Statically compiled Dart is statically compiled. The Dart VM can build native ARM code for the platform you are developing. This means that the program is much faster than an application compiled while the program is executing using an just-in-time compiler.
  • Dynamic compilation: Dart also compiles on the fly. Flutter takes advantage of this development capability to shorten the development cycle. Features like hot overloading are possible because applications can easily compile updates, making it easier to test and iterate over products.
  • Strongly typed: Dart is a strongly typed language. If you’ve used Java or C#, there are several reasons that making the transition to Dart is ideal. One of them is that Dart looks familiar, and it’s type-safe, so you don’t have to sacrifice the integrity of your program.
  • Server-side potential: Dart is great for a lot of things, including running on a server. Dart on the server is gaining traction. Given the possibility of a unified code base, using it in Flutter is a good example.

You can learn more about the Dart language used on Flutter here.

The structure of the Flutter

The structure of Flutter application

Potential on Fuchsia

Can be used on Fuchsia. Fuchsia is a new open source operating system, now being developed by Google, that is generating quite a bit of attention in the tech geek community. Unlike Android and other popular operating systems, it is based on a microkernel called Zircon. Flutter has been used with Armadillo to test the development of Fuchsia’s user interface.

Current deficiencies

The perceived shortcomings are based on past developer experience. This section is only used to highlight the importance and solutions of the Flutter project. A testament to the speed at which the Flutter team has grown.

You can check out this article to learn about the challenges native mobile developers face when testing driving the Flutter. Some of the issues they highlighted were very controversial in my opinion, such as the lack of OpenGL support, allowing Flutter to use Skia and supporting OpenGL as one of its back ends.

Due to the recent release of Flutter, other possible challenges you may face include:

  • A low-level implementation of animation. This has been a challenge in the past for people who needed to lower their level to create the animation they wanted.
  • Data manipulation libraries are still missing. Flutter initially focused on visual rendering. If you’re someone who relies heavily on off-the-shelf community modules and components, you may be struggling with scarce data manipulation libraries. However, I personally feel that the field is steadily maturing, and Flutter provides a lot of advice on building applications and paves the way for people to build libraries to align their products with best conventions.

Introduction to Flutter

Go to Flutter. IO to learn how to get started with Flutter. You also check out the resources section at the bottom.

In summary, getting started with Flutter involves downloading the SDK and configuring the path to use it. Installing the necessary plug-ins in the editor you use is a necessary next step.


You may encounter dependency loss issues on Mac OS, which can be resolved by running PIP Install Six.

Another problem you may encounter when trying to run Flutter Upgrade is merge conflicts. This happens if you’ve tested the Flutter example bundled with the SDK. In this case, before run a Flutter upgrade command into the Flutter SDK folder, storage changed files (git add. | git stash) is very useful.

Some resources

  • Rohan Taneja provides a fairly detailed set of links to precious resources in this article.
  • Fluttery is a collection of tutorials, challenges, and modes for those who want to get started with Flutter.
  • Flutter Studio is also an excellent resource for those who want to simplify the development process.

I’m happy to try it. If you are, please let me know! ❤ ️ 🚀

If you find any mistakes in your translation or other areas that need to be improved, you are welcome to the Nuggets Translation Program to revise and PR your translation, and you can also get the corresponding reward points. The permanent link to this article at the beginning of this article is the MarkDown link to this article on GitHub.


The Nuggets Translation Project is a community that translates quality Internet technical articles from English sharing articles on nuggets. The content covers Android, iOS, front-end, back-end, blockchain, products, design, artificial intelligence and other fields. If you want to see more high-quality translation, please continue to pay attention to the Translation plan of Digging Gold, the official Weibo, Zhihu column.