flutter 系统组件学习一 Text组件

2020-01-06  本文已影响0人  崇德兴仁

前言

开发中最常用的组件就是text组件,对应ios里面的就是UILabel控件了

使用方法

Text(
              'You have pushed the button this many ave pushed the button this manyave pushed the button this manyave pushed the button this manyave pushed the button this manytimes:',
              textAlign: TextAlign.end,
              textDirection: TextDirection.ltr,
              maxLines:2,
              softWrap: true,                  
              overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
              style: TextStyle(
                // color: Colors.red,
                // backgroundColor: Colors.blue,
                fontSize: 30.0,
                fontWeight: FontWeight.w900,
                fontStyle: FontStyle.italic,
                letterSpacing: 2, // 字母间距
                wordSpacing: 4,   // 单词间距
                height:2, // 行间距倍数
                foreground: Paint()..color = Colors.blue,
                decoration:TextDecoration.combine(
                  [TextDecoration.underline,
                  TextDecoration.overline,
                  TextDecoration.lineThrough]
                ),
                decorationColor:Colors.red,
                decorationStyle: TextDecorationStyle.dotted,
                decorationThickness:1.0, 
              ),
            ),

运行的效果如下:


屏幕快照 2020-01-06 下午4.18.46.png
上一篇下一篇

猜你喜欢

热点阅读