【问题标题】:Is there a way to create custom style for underline in text?有没有办法为文本中的下划线创建自定义样式?
【发布时间】:2023-01-03 01:49:50
【问题描述】:

我想创建自定义样式的下划线,如下所示。我可以看到一些内置的测试装饰样式(粗体、虚线、双线和波浪形),想要如下所示。有没有办法在 flutter 中实现这种样式?

【问题讨论】:

    标签: flutter


    【解决方案1】:

    欢迎来到 Flutter 的世界,在这里您可以组合不同的小部件树以获得您想要的结果。

    结果:

    代码

    IntrinsicWidth(
          child: Column(
            children: [
              Text(
                "Expenses",
                style: TextStyle(color: Colors.white, fontSize: 30),
              ),
              SizedBox(
                height: 5,
                child: Row(
                  children: [
                    Expanded(
                      flex: 3,
                      child: Container(
                        color: Colors.white,
                      ),
                    ),
                    SizedBox(
                      width: 5,
                    ),
                    Expanded(
                      flex: 2,
                      child: Container(
                        color: Colors.white,
                      ),
                    ),
                    SizedBox(
                      width: 8,
                    ),
                    Expanded(
                      flex: 1,
                      child: Container(
                        color: Colors.white,
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-04
      • 2016-09-13
      • 2016-08-25
      • 1970-01-01
      • 2021-10-05
      • 2019-08-22
      相关资源
      最近更新 更多