flutter - 如何在 flutter 中的行之间写 OR

大家好,我是 Flutter 的新手,我尝试在水平线上编写 OR,如图所示,但我不知道该怎么做,我尝试用谷歌搜索,但没有成功帮助过我 example demonstration

注: OR 居中

最佳答案

试试下面的代码希望对你有帮助。您必须使用这种(-- 或 -- )类型的设计 ExpandedFlexible Widget

去here对于 Expanded Widget 和 here用于灵活小部件

  Padding(
      padding: EdgeInsets.all(8.0),
      child: Row(
        children: [
          Expanded(
            child: Divider(
              color: Colors.black,
              thickness: 1,
            ),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: Text('OR'),
          ),
          Expanded(
            child: Divider(
              color: Colors.black,
              thickness: 1,
            ),
          ),
        ],
      ),
    ),

你的结果屏幕像 ->

https://stackoverflow.com/questions/69153957/

相关文章:

android - 从协程(kotlin)切换到隔离(dart)

laravel - Laravel 中的 getClientOriginalExtension()

c++ - 在 constexpr 分支中使用枚举类值

c# - 如何在 C# 中使用预处理器指令仅在 Windows 10 上执行一些代码?

python - Azure Databricks python 命令显示当前集群配置

c - 栈在使用Pthread的多线程程序中是如何工作的?

python - 如何找到中轴的关节和端点

c# - Parallel.Foreach 和每个产生不同的结果 : Why is my code

java - 为什么 java 编译器不提示 "\s"?

docker - 使用 deps.edn 在容器中安装依赖项