• Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

1. Create the Flutter project

After the Flutter configuration is complete, you can create a Flutter project in Android Studio.Click on theCreate New Flutter ProjectAfter that, there are four options:

  • Flutter Application Create a Flutter application project
  • Flutter plugin: This is for Android and iOS plug-in applications (exposed excuses)
  • Flutter Package: Create a Dart component and publish it to pub to provide easy development like some third-party libraries
  • Flutter Module : Generally used for mixed development, embedded in Android and iOS projects!

Enter the project name, project address, and select Next. Project name cannot be named after hump.

0

At this point, the project is created and ready to run.

2. The Dart syntax

2.1 Var, final, and const

  • Var: Declares variables that can be assigned to different types. The value of a declared variable is null if it is not initialized, and can then be assigned to a different type. If the initialization assignment is made then the type of the variable is determined.

  • Final: Declares a variable that can only be assigned once.

You can declare it first and assign it later. But it cannot be used without an assignment after the declaration.

  • Const: Declares a constant. It is assigned when declared, and cannot be changed after declared.

2.2 num

Num: A variable that needs to be assigned after the declaration before it can be used. We can assign an Int or a Double.

Flutter contains the ~/ operator, which is used to round up and convert data types to toDouble() and toInt().

2.3 the string

Strings in Flutter can be created using either single or double quotation marks, and can be concatenated with + and copied with *. Use a[x] to get the character of the corresponding position,

Strings can also use three or double quotes to create multi-line strings, and you can see that double-quoted strings create multi-line strings that are concatenated, while three-quoted strings preserve newlines.

To get outside values inside a Flutter, add ${} to the string.

If you need /n in a string instead of a newline, you can simply add r to the front of the string.