CustomPaint + Animation 사용시 동작 안할 때

flunge·2022년 1월 25일
0

Flutter

목록 보기
11/13

CustomPaint안에서 Animation객체를 사용해야하는데 위와 같이 화면 변화가 없다가 setState처럼 build가 다시 호출 됐을 때야 화면이 변경되는 경우

class Temp extends CustomPainter{
  final Animation<double> animation;
  ...

  Temp({
    required this.animation, 
    ...
  }) 
    : super(repaint: animation);  // <- 이부분

생성자에서 부모 클래스의 repaint에 값을 줬는지 확인해보자

0개의 댓글