buildPainter method
Builds a new painter every time the page offset changes
Implementation
@override
IndicatorPainter buildPainter(int count, double offset) {
assert(
offset.ceil() < count,
'SwapEffect does not support infinite looping.',
);
return SwapPainter(count: count, offset: offset, effect: this);
}