FlutterPainter.builder constructor

const FlutterPainter.builder({
  1. Key? key,
  2. required PainterController controller,
  3. required FlutterPainterBuilderCallback builder,
  4. DrawableCreatedCallback? onDrawableCreated,
  5. DrawableDeletedCallback? onDrawableDeleted,
  6. ValueChanged<ObjectDrawable?>? onSelectedObjectDrawableChanged,
  7. ValueChanged<PainterSettings>? onPainterSettingsChanged,
})

Creates a FlutterPainter with the given controller, builder and optional callbacks.

Using this constructor, the builder will be called any time the controller updates. It is useful if you want to build UI that automatically rebuilds on updates from controller.

Implementation

const FlutterPainter.builder(
    {Key? key,
    required this.controller,
    required FlutterPainterBuilderCallback builder,
    this.onDrawableCreated,
    this.onDrawableDeleted,
    this.onSelectedObjectDrawableChanged,
    this.onPainterSettingsChanged})
    : _builder = builder,
      super(key: key);