渲染溢出问题

来源:6-7 卡片组件封装与优化

AKIRA晓

2023-12-06

我这里模拟器用 iphone14 pro报一个渲染错误

A RenderFlex overflowed by 23 pixels on the right.

The relevant error-causing widget was:
Row Row:file:///Users/mac/Desktop/screenas/lib/widget/video_card.dart:64:22
The overflowing RenderFlex has an orientation of Axis.horizontal.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

但是我这边64行只是一个row

child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_iconText(Icons.ondemand_video,videoModel.view),
_iconText(Icons.favorite_border,videoModel.favorite),
_iconText(null,videoModel.duration),
],
),

不知道问题出在哪里
padding和height都和源码一样

写回答

1回答

AKIRA晓

提问者

2023-12-06

感觉好像是fadeimage 的高度过低引起的 我调试到了160的高度发现不会报错了

FadeInImage.memoryNetwork(
   height: 160,
   placeholder: kTransparentImage,
   image: videoModel.cover,
   fit: BoxFit.cover,),

0
2
AKIRA晓
回复
CrazyCodeBoy
ok 明白了
2023-12-07
共2条回复

Flutter高级进阶实战-仿哔哩哔哩-掌握Flutter高阶技能

一次性掌握Flutter高阶技能+商业级复杂项目架构设计与开发方案

1774 学习 · 892 问题

查看课程