gpt4 book ai didi

flutter - 如何解决 Row 中的 “A RenderFlex overflowed on the right.” 错误?

转载 作者:行者123 更新时间:2023-12-04 03:51:18 25 4
gpt4 key购买 nike

我在 Row 小部件上收到错误消息。
我该如何解决?
enter image description here

Column(
children: [
Padding(
padding: const EdgeInsets.all(20.0),
child: Row( // error is shown on this line
children: [
const Image(
height: 120,
width: 120,
image: NetworkImage(...),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Wrap(
spacing: 5.0,
runSpacing: 5.0,
direction: Axis.vertical,
children: [
Text('Message:'),
Text('Hello world! How are you doing?'),
],
),
)
],
),
),
],
),

A RenderFlex overflowed by 16 pixels on the right.

最佳答案

Expanded顶部的小部件 Padding为你做诀窍

Column(
children: [
Padding(
padding: const EdgeInsets.all(0.0),
child: Row(
// error is shown on this line
children: [
Image(
height: 120,
width: 120,
image: NetworkImage(""),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Wrap(
spacing: 5.0,
runSpacing: 5.0,
direction: Axis.vertical,
children: [
Text('Message:'),
Text(
'Hello world! How are you doing?',),
],
),
))
],
),
),
],
),

关于flutter - 如何解决 Row 中的 “A RenderFlex overflowed on the right.” 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64401912/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com