Flutter开发之Dart语言
程序员文章站
2022-05-29 20:24:58
...
import 'package:flutter/material.dart';
void main()=>runApp(myapp());
class myapp extends StatelessWidget{
@override
Widget build(BuildContext context) {
return MaterialApp(
title:'welcome to flutter',
home:Scaffold(
appBar:AppBar(
title: Text('welcome to flutter'),
), //AppBar
body:Center(
child: Text('hello world'),
) //Center
) //Scaffold
); //MaterialApp
}
}
运行结果:
上一篇: Flutter环境搭建Windows