繁体   English   中英

如何在 flutter obx 中居中标题

[英]How to center title in flutter obx

我正在使用 get 的 obx() ,如下面的代码。

但我希望标题居中。

但我什至不能使用“对齐”,所以我很好奇如何对齐它。

 title:
        Obx(
    () => Text.rich(
    
      TextSpan(
        
        text:
        "${_questionController.questionNumber.value}. ",
    
        style: TextStyle(fontSize: 15, color: Colors.blue),
    
        children: [
          TextSpan(
            text:  '${Questiontitle[widget.index]}',
            style: TextStyle(fontSize: 15, color: Colors.blue),
          ),
    
        ],
      ),
    ),
    ),

使用 Center 或 Align 包裹标题并将 alignment 设置为 Alignment.center。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM