Lined Notebook

[Flutter] CustomPaint repaint 문제

by JungWook_

CustomPaint로 Colormap을 만들고 있는데 스크롤하거나 AppDrawer를 호출하면 다시 그리는 문제를 발견했습니다.

CustomPainter에서 그리는 내용이 적을 때는 문제가 없었는데 내용이 많아지니 끊김이 발생해서 사용하기 힘들정도입니다.

해당 문제는 RepaintBoundary를 사용하면 해결 됩니다.

RepaintBoundary(
	child: CustomPaint(
    	painter: CustomPainter(),
        isComplex: true,
        willChagne: false,
    ),
)

위 코드처럼 사용하면 다시 그리지 않습니다.

블로그의 정보

hongmono

JungWook_

활동하기