1、界面输出内容
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
// 方法一
// return new Container(
// decoration: new BoxDecoration(color: Colors.white),
// child: new Center(
// child: new Text(
// 'Hello',
// textDirection: TextDirection.ltr,
// style: new TextStyle(fontSize: 40.0, color: Colors.black87),
// ),
// ),
// );
// 方法二
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: new Scaffold(
appBar: AppBar(
title: Text("Flutter Demo"),
),
body: Center(
child: new Text('Hello World', style: new TextStyle(fontSize: 32.0)),
),
),
);
}
}