水平分隔线在Flutter的中间有文本? [英] Horizontal divider with text in the middle in Flutter?

查看:891
本文介绍了水平分隔线在Flutter的中间有文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Flutter中是否有内置的小部件来创建中间带有文本的分隔线?任何有关如何操作的指南?像这样:(水平线中间的或"文本)

Is there a built in widget in Flutter to create a divider with text in the middle? Any guide on how to do it? Like this: (the "OR" text in the middle of horizontal line)

这是我要实现的屏幕截图

推荐答案

您可以尝试使用小部件.

You can try to use the Row widget.

Row(
    children: <Widget>[
        Expanded(
            child: Divider()
        ),       

        Text("OR"),        

        Expanded(
            child: Divider()
        ),
    ]
)

这篇关于水平分隔线在Flutter的中间有文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆