专业的编程技术博客社区

网站首页 > 博客文章 正文

Flutter app 创建运行(flutter开发环境搭建)

baijin 2024-08-11 13:39:03 博客文章 16 ℃ 0 评论

flutter 配置开发运行环境检测

flutter doctor

Flutter应用程序

  • 创建flutter app
  • 运行flutter app
flutter create projectname  ------projectname(项目名称)
cd projectname
flutter run

lib/main.dart自动生成默认文件

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'),
        ),
      ),
    );
  }
}

这样初步的项目app就创建成功了。

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表