First, build the Flutter development environment

Because Flutter builds distributions for both Android and ios platforms, flutter relies on both the Android and ios SDK. To install Flutter, you need to install the corresponding build tools and SDK. First introduce some respectively to build Windows and macOS under the development environment;

Build the Flutter development environment on Windows:

To install and run Flutter, your development environment must meet the following minimum requirements;

Operating system: Windows 7 or later (64-bit)

Disk space: 400 MB (not including disk space for Android Studio).

Tools: Flutter relies on the following command-line tools.

Git for Windows (Git command line tool)Copy the code

If you have Git for Windows installed, make sure you can run Git commands from a command prompt or PowerShell

IO/sdK-archive to download the latest available installation package of Flutter.

Note that the channel version of Flutter is subject to change. Please refer to the Website of Flutter. In addition, you may need to climb the wall to get the list of Flutter packages or download the Flutter packages in Mainland China. Readers can also go to the Flutter Github project to download the Flutter packages at github.com/flutter/flu… .

2. Decompress the installation package zip to the path where you want to install the Flutter SDK (e.g. C:\ SRC \ Flutter; Note that do not install flutter into a path that requires some high permissions such as C:\Program Files\).

3. Go to the Flutter file in the Flutter installation directory and double-click flutter_console.bat to start the Flutter command. Then you can run the Flutter command on the Flutter command line.

Updating environment variables

Add the following environment variables to user PATH if you want to run the flutter command on Windows instead of its own command line:

Go to Control Panel > User Accounts > User Accounts > Change My Environment Variables

Check for an entry named “Path” under “User Variables” : if this entry exists, append the full Path of flutter\bin to the user variable. If the entry does not exist, create a new user variable Path and take the full Path of flutter\bin as its value.

Restart Windows to apply this change.

Run the flutter doctor command

Run the following command on the Flutter command line to see if any other dependencies need to be installed. If so, install them:

flutter doctor

This command examines your environment and displays the report in a command line window. Dart SDK is already packaged with the Flutter SDK. There is no need to install Dart separately. Scrutinize the command line output for additional software that might need to be installed or further tasks that might need to be performed.

The Android Settings

Flutter relies on a full installation of Android Studio. Android Studio not only manages Android platform dependencies, SDK versions, etc., but it is also one of the recommended ides for Flutter development (of course, you can also use other editors or ides, which we will discuss later).

Install the Android Studio

1. Download and install the Android Studio, download address: developer.android.com/studio/inde… .

2. Start Android Studio and run the Android Studio Installation Wizard. This will install the latest Android SDK, Android SDK platform tools, and Android SDK build tools that are required for Android development with Flutter.

Build the Flutter development environment on macOS

You can test both Android and iOS devices under masOS.

System requirements

To install and run Flutter, your development environment must meet the following minimum requirements:

Operating system: macOS (64-bit)

Disk space: 700 MB (not including Xcode or Android Studio disk space).

Tools: Flutter relies on the following command line tools: bash, mkdir, rm, git, curl, unzip, which

Access to Flutter the SDK

1. Download the latest available flutter installation package from the flutter website.

Note that the channel version of Flutter is subject to change. Please refer to the Website of Flutter. In addition, you may need to climb the wall to get the list of Flutter packages or download the Flutter packages in Mainland China. Readers can also go to the Flutter Github project to download the Flutter packages at github.com/flutter/flu… .

2. Decompress the installation package to a directory you want to install, for example:

CD ~ / development unzip ~ / Downloads/flutter_macos_v0. 5.1 beta. Zip

3. Add flutter tools to your path:

export PATH=pwd/flutter/bin:$PATH

Updating environment variables

Adding a Flutter to your PATH allows you to run the Flutter command in any terminal session.

The steps to permanently modify this variable for all terminal sessions are computer system-specific. Typically, you add commands to set environment variables to the file you execute when you open a new window. For example,

1. Make sure that the directory of your Flutter SDK is labeled “FLUTTER_INSTALL_PATH”, which you will use in Step 3.

2. Open or create $HOME/.bash_profile. The file path and filename may be different on your computer.

3. Add the following paths:

export PATH=[FLUTTER_INSTALL_PATH]/flutter/bin:$PATH

For example, if the author’s Flutter installation directory is “~/code/flutter_dir”, the code is:

export PATH=~/code/flutter_dir/flutter/bin:$PATH

4. Run source $HOME/. Bash_profile to refresh the current terminal window.

Note: if you are using a ZSH terminal, ~/.bash_profile will not be loaded when the terminal starts. The solution is to modify ~/.zshrc to add: source ~/.bash_profile

5. Verify that flutter/bin is already in PATH:

echo $PATH

Install Xcode

To develop Flutter applications for iOS, you need Xcode 9.0 or later:

1. Install Xcode 9.0 or later (download from the link or from the App Store).

2. Configure the Xcode command line tools to use the newly installed version of Xcode sudo Xcode – select – switch/Applications/Xcode. The app/Contents/Developer for most situations, This is the correct path when you want to use the latest version of Xcode. If you need to use a different version, specify the corresponding path.

3. Ensure that the Xcode license agreement is agreed by opening Xcode once or by using the command sudo xcodebuild-license.

Using Xcode, you can run the Flutter application on an iOS device or emulator.

Install the Android Studio

Just like Windows, to build and run Flutter applications on Android devices, you need to install Android Studio first. You can download and install Android Studio first.

Upgrade Flutter

Flutter SDK branch

There are several branches of the Flutter SDK, including Beta, dev, and Master. The beta branch is the stable branch (there may also be new stable branches after a new stable version is released, such as 1.0.0). Dev and Master are the development branches. You can run the Flutter Channel to view all branches. If I run the flutter channel locally, the result is as follows:

Branches with an “*” sign are the branches tracked by your local Flutter SDK. To switch branches, you can use the Flutter Channel beta or the Flutter Channel Master. But you can also trace the master branch so you can see the latest changes, but that’s much less stable.

Upgrade the Flutter SDK and dependencies

To upgrade the flutter SDK, simply run the flutter upgrade command

This command will update both the Flutter SDK and your Flutter project dependencies. If you only want to update the project dependencies (excluding the Flutter SDK), you can use the following command:

1) Flutter packages get all dependencies of the project.

2) Flutter Packages Upgrade gets the latest version of all dependencies of the project.

IDE configuration and use

A Flutter application can theoretically be built using any text editor and command-line tool. However, Flutter officials recommend using either Android Studio or VS Code for a better development experience. Flutter provides code completion, syntax highlighting, widget editing assistance, runtime and debugging support via the IDE and the plugin, which can greatly improve your development efficiency. Here’s how to configure and use Android Studio and VS Code, respectively. (The latest installments are available on the Android Studio and VS Code websites.

Android Studio configuration and use

Since Android Studio is based on IntelliJ IDEA, readers can also use IntelliJ IDEA.

Install the Flutter and Dart plug-ins

Two plug-ins need to be installed:

1). The Flutter plugin supports the Flutter development workflow (running, debugging, thermal overloading, etc.).

2).Dart plug-in: provides code analysis (validation, code completion, etc.).

Installation steps:

1). Start Android Studio.

2). Open the plug-in Preferences (macOS: Preferences>Plugins, Windows: File>Settings>Plugins).

3). Select Browse Repositories… Select the Flutter plugin and click Install.

4). The plug-in takes effect after restarting Android Studio.

Next, let’s create a Flutter project with Android Studio, run it, and experience a “hot reload”.

1). Choose File>New Flutter Project.

2). Select Flutter Application as the Project type and click Next.

3). Enter a project name (such as MyApp) and click Next.

4) click Finish.

5). Wait for Android Studio to install the SDK and create the project.

The above commands create a Flutter project called MyApp that contains a simple demo application using Material components.

In the project directory, the code for your application is located in lib/main.dart.

Create a new Flutter project named “first_flutter_app”. Once created, you’ll get a Demo of the counter application.

In this counter example, the number in the center of the screen increases by 1 each time you click the hover button with the “➕” sign in the lower right corner.

If have a mistake, return hope everybody big guy correct!!