September 2019
Beginner
512 pages
12h 52m
English
This is an important method, especially for the Flutter engine. This is what it looks like:
bool shouldRepaint ( covariant CustomPainter oldDelegate)
It receives just the oldDelegate argument, which corresponds to the last delegate (this CustomPainter class instance) that was responsible for painting onto CustomPaint. Whenever it returns false, then the paint call might be optimized away (this does not mean the paint will not be called). We should compare the old and current delegate to see whether any data related to the paint is different, and then return true in this case.
Read now
Unlock full access