Flutter 18像素抖动溢出
RenderFlex溢出了18个像素 你好,我是新来的。我正在做一些项目与颤振,我有一些问题,这个小部件,当我添加一个平面按钮,我得到了权利溢出18像素。你能帮我吗 我的代码:Flutter 18像素抖动溢出,flutter,dart,Flutter,Dart,RenderFlex溢出了18个像素 你好,我是新来的。我正在做一些项目与颤振,我有一些问题,这个小部件,当我添加一个平面按钮,我得到了权利溢出18像素。你能帮我吗 我的代码: Widget _drawFooter() { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( // m
Widget _drawFooter() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FlatButton(
onPressed: () {},
child: Text(
'10 COMMENTS',
style: _hashTagStyle,
),
),
Row(
children: [
IconButton(
icon: Icon(Icons.favorite),
onPressed: () {},
color: Colors.grey.shade400,
),
Text('Open'),
],
),
],
),
Expanded(
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
onPressed: () {},
child: Text(
'SHARE',
style: _hashTagStyle,
),
),
FlatButton(
onPressed: () {},
child: Text(
'OPEN',
style: _hashTagStyle,
),
),
/* FlatButton(
onPressed: () {},
child: Text(
'Open',
style: _hashTagStyle,
),
),*/
// Text('Open'),
],
),
),
],
);
}
}
这是屏幕截图错误:
将
行
替换为换行
Expanded(
child: Wrap(
direction: Axis.horizontal,
alignment: WrapAlignment.spaceEvenly,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
onPressed: () {},
child: Text(
'SHARE',
),
),
FlatButton(
onPressed: () {},
child: Text(
'OPEN',
),
),
// Text('Open'),
],
),
),
尝试SingleChildScrollView并使用SizedBox共享空间:
Widget _drawFooter() {
return SingleChildScrollView(child:
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FlatButton(
onPressed: () {},
child: Text(
'10 COMMENTS',
style: _hashTagStyle,
),
),
SizedBox(width: 20),
IconButton(
icon: Icon(Icons.favorite),
onPressed: () {},
color: Colors.grey.shade400,
),
SizedBox(width: 10),
Text('Open'),
SizedBox(width: 20),
FlatButton(
onPressed: () {},
child: Text(
'SHARE',
style: _hashTagStyle,
),
),
SizedBox(width: 30),
FlatButton(
onPressed: () {},
child: Text(
'OPEN',
style: _hashTagStyle,
),
),
/* FlatButton(
onPressed: () {},
child: Text(
'Open',
style: _hashTagStyle,
),
),*/
// Text('Open'),
],
),
],
),
);
}
将
行
替换为换行