本以为shouldRepaint方法返回false就不会触发了,结果还是会。
@override
bool shouldRepaint(CustomPainter oldDelegate) {
return false;
}
结果发现需要在CustomPaint外面用RepaintBoundary包装一层。
这下就不会每帧都触发了,开森哦!!
本以为shouldRepaint方法返回false就不会触发了,结果还是会。
@override
bool shouldRepaint(CustomPainter oldDelegate) {
return false;
}
结果发现需要在CustomPaint外面用RepaintBoundary包装一层。
这下就不会每帧都触发了,开森哦!!