initialize method

void initialize({
  1. required double width,
  2. required double height,
  3. required Offset center,
  4. required TickerProvider vsync,
  5. required ValueNotifier<bool> repaintNotifier,
  6. required bool isFirstInilize,
})

Initializes the painter with canvas dimensions and setup information.

  • width, height: Canvas dimensions
  • center: Center of the canvas
  • vsync: A TickerProvider used for animations
  • repaintNotifier: Notifier to trigger UI repaint
  • isFirstInilize: 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);
}