文本对齐不能与RichText一起正常使用

时间:2019-03-05 13:37:02

标签: dart flutter richtext

我正在使用$(document).ready(function () { $('.table-driver').DataTable({ "processing": true, "serverSide": true, "autoWidth": false, "ajax": "{{route('users.show')}}", "columns": [ { "data": "name", name: "name" }, { "data": "rate", rate: "rate" }, { "data": "age", age: "age" }, { "data": "status", status: "status" }, {"data":"action", action: "action", sort: false} ], dom: 'Bfrtip', buttons: [ 'print' ] }); }); ,在此 当使用任何样式为RichText的文本范围时,文本对齐不能与RichText一起正常工作

decoration: TextDecoration.underline
RichText(
          softWrap: true,
          textAlign: TextAlign.justify,
          text: TextSpan(
            style: TextStyle(
              color: Colors.black,
              fontWeight: FontWeight.w500,
              fontSize: 16.0,
            ),
            children: getSpan(),
          ),
        )

See the restul

2 个答案:

答案 0 :(得分:0)

设置为textAlign时,看起来像TextAlign.justify属性的讨厌效果。

RichText(
          softWrap: true,
          //textAlign: TextAlign.justify,
          text: TextSpan(
            style: TextStyle(
              color: Colors.black,
              fontWeight: FontWeight.w500,
              fontSize: 16.0,
            ),
            children: getSpan(),
          ),
        )

已更新至19/03/19

bug现已修复,目前(21/03/19)在主抖动通道中可用:

flutter channel master

答案 1 :(得分:-1)

Text('Jean lives in massachusettes with her loving husband and two childrens',
     textAlign: TextAlign.center)