Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure Flutter development environment and run hello world on real machine

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about how to install and configure the Flutter development environment and how to run hello world on the real machine. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.

Download and install Git

Click to download Cit.

After downloading, extract it and select the installation directory

Configure environment variables

(it automatically configures the cmd path. You need to configure the bin directory here)

Verify installation

Win+R-"cmd input git

Display a lot of content, even if it is installed.

Download and install Flutter

Click to download Flutter.

After downloading, extract it and select the installation directory

Configure environment variables

Configure Mirror

PUB_HOSTED_URL= https://pub.flutter-io.cn

FLUTTER_STORAGE_BASE_URL= https://storage.flutter-io.cn

Configure the bin path for flutter

Verify installation

Win+R-"cmd input flutter-- version

Display the version information of flutter and install it.

Then enter flutter doctor

Automatically detect and display the installation information. You need to wait a little while here.

Report an error to fill in the pit

Error: The Flutter directory is not a clone of the GitHub project.

The flutter tool requires Git in order to operate properly

To set up Flutter, run the following command:

Solution: delete the downloaded installation package, open cmd in the directory you want to install, and type:

Git clone-b beta https://github.com/flutter/flutter.git

It will download and install automatically. Remember to change the configuration of the environment variables.

Input: flutter-- version

Download and install Android Studio

There are many installation tutorials for Android Studio, so I won't repeat them here.

Pay attention to setting the environment variable of Android SDK

Install the Flutter plug-in

Open Android Studio-> file-> Settings-> Plugins

Search flutter

Click install on the right, and click OK or Apply below to install

It automatically installs the dart plug-in

After the installation is complete, Flutter and Dart appear in the settings

Select the bin directory to Flutter on the right

The version information of Flutter will appear

Create a new Flutter project

Click Flutter Application

Click next

Click finish

This creates a Flutter project, and the directory structure looks like this

Change the warehouse address to Aliyun's maven warehouse

Google ()

To be replaced by:

Maven {url 'https://maven.aliyun.com/repository/google'}

The code for Flutter is written in the lib directory, now write a hello world

Select all and delete all the code of main.dart in the lib directory

Paste the following code into main.dart in the lib directory

Import 'package:flutter/material.dart';void main () = > runApp (new MyApp ()); class MyApp extends StatelessWidget {@ override Widget build (BuildContext context) {return new MaterialApp (title:' Welcome to Flutter', home: new Scaffold (appBar: new AppBar (title: new Text ('Welcome to Flutter'),), body: new Center (child: new Text (' hello worldview')) ,),);}}

Run the first Flutter project

Due to the poor performance of my computer, I can only run Android programs on my real computer.

The real machine runs the Flutter program.

Just installed and configured the Flutter development environment yesterday, record it.

After reading the above, do you have any further understanding of how to install and configure the Flutter development environment and how to run hello world on a real machine? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report