替换 lib/main.dart.

简介: 替换 lib/main.dart.

  替换 lib/main.dart.

  删除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'),

  ),

  ),

  );

  }

  }

目录
相关文章
|
Oracle 关系型数据库 Go
【开发工具】解决 Goland 报错:Found several packages [main, xxx] in ...
【开发工具】解决 Goland 报错:Found several packages [main, xxx] in ...
1804 0
【开发工具】解决 Goland 报错:Found several packages [main, xxx] in ...
|
7月前
|
Dart 开发工具
消除Flutter doctor的警告Warning: `dart` on your path resolves to xxx/bin/dart
消除Flutter doctor的警告Warning: `dart` on your path resolves to xxx/bin/dart
143 0
|
9月前
|
Dart 开发工具 C++
Dart第一个程序hello,world
Dart第一个程序hello,world
|
10月前
|
数据采集 Rust Java
Python 为什么没有 main 函数?为什么我不推荐写 main 函数?
Python 为什么没有 main 函数?为什么我不推荐写 main 函数?
63 0
【Log4cpp】项目日志Log4cpp的简单使用
【Log4cpp】项目日志Log4cpp的简单使用
|
IDE Go 开发工具
Go源码里为什么可以直接用internal包里的func?
Go源码里为什么可以直接用internal包里的func?
101 0
|
存储 Linux 计算机视觉
CMake库打包以及支持find_package(二)
CMake库打包以及支持find_package(二)
345 0
|
测试技术 Linux
CMake库打包以及支持find_package(一)
CMake库打包以及支持find_package(一)
251 0
|
C++
Clion配置单个project下可以运行多个CPP文件的main函数
Clion配置单个project下可以运行多个CPP文件的main函数
1536 0
Go初始化函数make和new有什么区别?
Go初始化函数make和new有什么区别?

热门文章

最新文章