效果图
Flutter基础-label代码如下
import 'package:flutter/material.dart';
// 配置main函数
void main() async {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// 显示欢迎页
WelcomePage();
return new MaterialApp(
title: 'title',
home: RouteProSample( ),
);
}
}
class RouteProSample extends StatefulWidget {
@override
createState() => _RouteProSampleState();
}
class _RouteProSampleState extends State<RouteProSample> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('导航栏标题->label'),
),
body: new Center(
child: new Text (
'我的text',
style: new TextStyle(
fontSize: 20.0,
color: Colors.red,
fontStyle: FontStyle.italic,
),
),
),
);
}
}
系列教程
Flutter入门基础(一)-Label
Flutter入门基础(二)-Button
Flutter入门基础(三)-TextFile登录页
Flutter入门基础(四)-imageview
网友评论