Flutter flutter into the pit of the environment to build

flutter environment to build

System Requirements

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 Android Studio disk space).

  • Tools: Flutter these depend on the following command-line tools.

    If Git for Windows is already installed, make sure you can run the command prompt or PowerShell command git

1, using a mirror

Since the country visit Flutter may sometimes be limited, Flutter official build a temporary image for the Chinese developers, we can be as an environment variable added to the user environment variables:

<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="shell" contenteditable="true" cid="n19" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn</pre>

windows Incorporation: Computer - Properties - Advanced System Settings - Environment variables - User variables were added:

7100414-2b9c51ee0e6640c1.png
image.png

2, get Flutter SDK

Since Flutter will build two platforms Android and IOS release package at the same time, it also depends Flutter Android SDK and iOS SDK, during installation Flutter also need tools to build and install the appropriate platform SDK.

  • flutter official website to download the installation package, the official website address of its latest available: https://flutter.io/sdk-archive/#windows

  • Flutter github project to go download the installation package, address: https://github.com/flutter/flutter/releases .

    1. Zip unzip the installation package to the path you want to install Flutter SDK (such as: C:\src\flutter; pay attention, do not install the flutter to need some high authority, such as a path C:\Program Files\).

    2. In Flutter installation directory flutterto find the next file flutter_console.bat, double-click to run and start the flutter command line , then you can run a command line command Flutter flutter up.

    3. Update flutter environment variable.

      If you want built-in Windows command-line system (and not) run flutter command, you need to add the following to the user environment variables PATH:

      • Go to "Control Panel> User Accounts> User Accounts> Change my environment variables"

      • Is there an entry named "Path" in the "User Variables" under examination:

      • If the entry exists, adding Flutter \ bin full path is used; as a separator.

      • If the entry does not exist, create a new user variable Path, and then the flutter\binfull path as its value.

3, run the command flutter doctor

In Flutter command line to run the following command to see whether the need to install additional dependent, if necessary, install them:

<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="shell" contenteditable="true" cid="n53" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">flutter doctor</pre>

The command to check your environment and display the report in the command line window. Dart SDK has been packaged in a Flutter SDK again, and there is no need for a separate installation Dart. Double-check command line output for additional software may need to install or further tasks to be performed.

The first time you run flutter command (such as flutter doctortime), it will download its own dependencies and compile it yourself. Later it will run much faster. Missing dependency need to install it, and then run the installation flutter doctorcommand to verify that the installation was successful

4, Android settings

Flutter depends on the full amount of Android Studio installed. Android Studio can manage not only depend on the Android platform, SDK version, etc., but it is also one of the recommended Flutter development IDE

  • Android Studio installed
  1. Download and install Android Studio, Download: https://developer.android.com/studio/index.html .

  2. Start Android Studio, and then perform "Android Studio Setup Wizard." This will install the latest Android SDK, Android SDK and Android SDK platform tools to build tools that are needed to Android development with Flutter.

  • Download flutter and dart, downloaded flutter default comes dart, set up the same way they do not flutter path variable dart set.

    file -> setting -> Editor -> plugins flutter search and download and install

7100414-ef703a51c08584ea.png
image.png
file-->setting-->Languages&Frameworks-->Schemas and Dtos-->flutter 设置路径。
7100414-12a9c628ba393b18.png
image.png

Guess you like

Origin blog.csdn.net/weixin_34234823/article/details/90831353