前边,我们已经学会了Flutter的创建和运行,还有热重载,下面,我们将会创建一个新的Flutter,之后,所有的教程都会基于这个项目进行,以此来熟悉Flutter的方方面面,已经掌握这个流程的可以直接跳过,开始进行下一步的学习
实现步骤
1.创建新的项目
2.填写项目基本信息,点击下一步完成项目的创建

3.删除lib / main.dart中的所有代码,然后替换为下面的代码,它将在屏幕的中心显示“Hello World”.
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 World'),
),
),
);
}
}
4.运行程序,检查是否存在问题![运行程序,检查是否存在问题]

网友评论