The words written at the beginning of the article

As a programmer, you should always pay attention to the new technology in the industry. If you don’t learn it for a while, you will fall behind. Technology updates at a fast pace, and to keep up with the development of The Times, we should always pay attention to technology trends and keep learning. This also directly and indirectly causes programmers to lose their hair early.

There are iOS, Android and WP on the mobile end, Windows, Linux and MacOS on the desktop end, and Web end. The mobile end, desktop end and Web end are collectively called the big front end. Each segment of the big front-end uses different languages, frameworks and technologies. Jumping between these segments requires learning a lot of new technologies, which directly leads to the narrowing of employment, and the technology of each segment is constantly updated. A programmer who wants to live must keep learning.

The ideal situation is to have one language and one technology to do all of the big front-end development work, which is the desire of both the company and the employees. Therefore, the cross-platform development technology of large front-end is bound to be a general trend, a set of code, multi-terminal operation.

Flutter is a cross-platform technology developed by Google for large front-end application development. Dart is the development language used for Flutter. Kotlin is the official language for application development on the Android platform, and can also be developed in Java and C/C++. Today, we’ll look at how to develop an Android application using Flutter+Dart.

Build up Flutter development environment

Visit the Website of Flutter to download the SDK installation package and configure the environment variables. A lot of techniques are generally a few steps, step by step. SDK official download address

Flutter installation page:

The following uses the Linux platform as an example:

  1. Download the SDK storage.googleapis.com/flutter_inf…
  2. Unzip to a specific directory
$The tar xf flutter_linux_v1. 12.13 + hotfix. 8 - stable. Tar. Xz
Copy the code
  1. Add the environment variable PATH
# flutter
export PATH=$PATH:${HOME}/workspace/flutter/flutter/bin
Copy the code
  1. Download the binaries you need for development (in advance)
$ flutter precache
Copy the code

$ flutter doctor
Copy the code

The Dart to the SDK installation

There are three steps to installing the Dart SDK: download the SDK package from the official website, unzip it to the specified directory, and add environment variables. Dart official website

Integrated development tool installation

Flutter supports integrated development environments including Android Studio, IntelliJ, and Visual Studio Code. The official development environment is Android Studio. Visual Studio Code is a lightweight IDE, and this article uses VS Code to demonstrate it.

First of all to Microsoft’s official website to download: code.visualstudio.com/docs/?dv=wi…

To summarize: Install the Flutter SDK, install the Dart SDK, install VS Code, install the Android SDK.

Android application creation

Creating an application (VS Code)

  1. Select View -> Command Palette
  2. Enter flutter and select Flutter: New Project
  3. Input project name
  4. Create or select a parent dir for the new project
  5. Wait until the project is created.

The project list is as follows. In addition to Android, there are mobile apps for iOS. The program is in the lib/main.dart file. Try modifying some strings to see how it works.

Run the application

Press F5 to run the application. I used an Android TV emulator and wrote as follows:

The following is the printed information of the terminal:

The follow-up study

Flutter. Dev/docs/get – st…