Flutter基础—常用控件之文本

Flutter基础—常用控件之文本,第1张

概述Text控件即容器,是一个常用的控件,下面的实例有7个不同样式的文本控件: import 'package:flutter/material.dart';class ContainerDemo extends StatelessWidget { @override Widget build(BuildContext context) { return new Scaffold(

Text控件即容器,是一个常用的控件,下面的实例有7个不同样式的文本控件:

import 'package:Flutter/material.dart';class ContainerDemo extends StatelessWidget {  @overrIDe  Widget build(BuildContext context) {    return new Scaffold(      appbar: new Appbar(        Title: new Text('文本控件'),),body: new Column(        children: <Widget>[          new Text(            '红色+黑色删除线+25号',style: new TextStyle(              color: const color(0xffff0000),decoration: Textdecoration.lineThrough,decorationcolor: const color(0xff000000),FontSize: 25.0,new Text(            '橙色+下划线+24号',style: new TextStyle(              color: const color(0xffff9900),decoration: Textdecoration.underline,FontSize: 24.0,new Text(            '虚线上划线+23号+倾斜',style: new TextStyle(              decoration: Textdecoration.overline,decorationStyle: TextdecorationStyle.dashed,FontSize: 23.0,FontStyle: FontStyle.italic,new Text(            'serif字体+24号',style: new TextStyle(              FontFamily: 'serif',FontSize: 26.0,new Text(            'monospace字体+24号+加粗',style: new TextStyle(              FontFamily: 'monospace',FontWeight: FontWeight.bold,new Text(            '天蓝色+25号+2行跨度',style: new TextStyle(              color: const color(0xff4a86e8),height: 2.0,new Text(            '24号+2个字母间隔',style: new TextStyle(              FontSize: 24.0,letterSpacing: 2.0,]      ),);  }}voID main() {  runApp(    new MaterialApp(      Title: 'Flutter教程',home: new ContainerDemo(),);}

总结

以上是内存溢出为你收集整理的Flutter基础—常用控件之文本全部内容,希望文章能够帮你解决Flutter基础—常用控件之文本所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1002699.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存