Flutter Widget之Text

Widget:https://flutter.io/docs/development/ui/widgets
Text:https://docs.flutter.io/flutter/widgets/Text-class.html

import 'package:flutter/material.dart';

class TextDemoPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => new _TextDemoPageState();
}

class _TextDemoPageState extends State<TextDemoPage> {
  String _name = 'Joe.Ye';

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(title: new Text('Text Page Demo'),),
      body: Center(
        child: Column(
          children: <Widget>[
            Text(
              'Hello, $_name! How are you?',
              textAlign: TextAlign.center,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(fontWeight: FontWeight.bold),
            ),
            const Text.rich(
              TextSpan(
                text: 'Hello', // default text style
                children: <TextSpan>[
                  TextSpan(text: ' beautiful ', style: TextStyle(fontStyle: FontStyle.italic)),
                  TextSpan(text: 'world', style: TextStyle(fontWeight: FontWeight.bold)),
                ],
              ),
            )
          ],
        )
      ),
    );
  }
}
上一篇 Flutter Widget之Column
下一篇 Flutter Widget之Image
目录
文章列表
1 Logstash filter target操作之后remove_field删除子字段
Logstash filter target操作之后remove_field删除子字段
2
Python Selenium关闭浏览器
Python Selenium关闭浏览器
3
Android NDK基础14:Eclipse下NDK开发
Android NDK基础14:Eclipse下NDK开发
4
React Native学习之调用原生方法的步骤
React Native学习之调用原生方法的步骤
5
Vue常用的ES6语法之数据集合map
Vue常用的ES6语法之数据集合map
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。