initialize method
void
initialize({
- required double width,
- required double height,
- required Offset center,
- required TickerProvider vsync,
- required ValueNotifier<
bool> repaintNotifier, - required bool isFirstInilize,
Initializes the painter with canvas dimensions and setup information.
width,height: Canvas dimensionscenter: Center of the canvasvsync: A TickerProvider used for animationsrepaintNotifier: Notifier to trigger UI repaintisFirstInilize: Indicates if this is the first time being initialized
Implementation
void initialize({
required double width,
required double height,
required Offset center,
required TickerProvider vsync,
required ValueNotifier<bool> repaintNotifier,
required bool isFirstInilize,
}) {
this.width = width;
this.height = height;
this.center = center;
_repaintNotifier = repaintNotifier;
if (isFirstInilize) onInit(vsync);
}