您的当前位置:首页正文

Flutter入门基础(一)-Label

来源:要发发知识网

效果图

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

系列教程