我不知道如何将文字包裹在扑朔迷离中

发布于 2025-02-12 04:54:17 字数 316 浏览 1 评论 0原文

我正在尝试创建一个带有图像的共同组件,右侧是介绍。 当引言很长时,组件呈现不佳。

我知道在fixible小部件中,有一种众所周知的包装文本并尝试过的方法。 那不起作用。

我在达台上有一个例子。谁能告诉我如何在没有溢出的情况下显示它?

httpps:///dartpad.dev/?

I am trying to create a common component with an image on the left and an introduction on the right.
When the introduction is long, the component does not render well.

I know there is a commonly known method of wrapping Text in a Flexible Widget and have tried it.
That did not work.

I have an example on dartpad. Can anyone tell me how to get it to display without overflow here?

https://dartpad.dev/?id=ee205a74591b34665c04abecc5012211

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谁把谁当真 2025-02-19 04:54:17

在列中,小部件添加一行。然后,如果添加一个灵活的小部件,文本将在溢出上下降

Column(
  children : [
    Text("some small text here"),
    Row(
      children : [
        Flexible(
          child : Text("Really long text here"),
        )
      ]
    )
  ]
}

In the column widget add a row. Then if you add a flexible widget the text will go down on overflow

Column(
  children : [
    Text("some small text here"),
    Row(
      children : [
        Flexible(
          child : Text("Really long text here"),
        )
      ]
    )
  ]
}
埖埖迣鎅 2025-02-19 04:54:17
 return GestureDetector(
    child: Row(children: [
  // alt image component
  SizedBox(
    height: 100,
    width: 100,
    child: Container(
      color: Colors.red,
    ),
  ),
  // item description
  Expanded(
    child: Column(
      children: [
        Text("user name"),
        Text(
            "user comment text: jump jump jump high jump high jump big jump big jump choo choo choo ya ya ya ri ri ri uh uh uh user comment text: jump jump jump high jump high jump big jump big jump choo choo choo ya ya ya ri ri ri uh uh uh"),
      ],
    ),
  ),
]));
 return GestureDetector(
    child: Row(children: [
  // alt image component
  SizedBox(
    height: 100,
    width: 100,
    child: Container(
      color: Colors.red,
    ),
  ),
  // item description
  Expanded(
    child: Column(
      children: [
        Text("user name"),
        Text(
            "user comment text: jump jump jump high jump high jump big jump big jump choo choo choo ya ya ya ri ri ri uh uh uh user comment text: jump jump jump high jump high jump big jump big jump choo choo choo ya ya ya ri ri ri uh uh uh"),
      ],
    ),
  ),
]));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文