The WidgetPlugin interface represents a plugin that can be used with a widget. It provides a set of lifecycle methods that can be implemented to hook into different stages of a widget's lifecycle.

interface WidgetPlugin {
    addition: Record<string, ((...params) => any)>;
    beforeDraw: ((widget, canvas) => void);
    beforeInitializing: ((widget, ck) => void);
    onDraw: ((widget, canvas) => void);
    onInitializing: ((widget, ck) => void);
    pre: ((widget, ck, PropertyChanged) => void);
}

Properties

addition: Record<string, ((...params) => any)>

Additional methods that can be defined for the widget plugin.

Type declaration

    • (...params): any
    • Parameters

      • Rest ...params: any[] | undefined[]

      Returns any

beforeDraw: ((widget, canvas) => void)

Called before a widget is drawn.

Type declaration

    • (widget, canvas): void
    • Parameters

      • widget: Widget

        The widget to be drawn.

      • canvas: Canvas

        The canvas on which the widget will be drawn.

      Returns void

beforeInitializing: ((widget, ck) => void)

Called before a widget is initialized.

Type declaration

    • (widget, ck): void
    • Parameters

      • widget: Widget

        The widget to be initialized.

      • ck: CanvasKit

        The CanvasKit instance.

      Returns void

onDraw: ((widget, canvas) => void)

Called after a widget is drawn.

Type declaration

    • (widget, canvas): void
    • Parameters

      • widget: Widget

        The widget that has been drawn.

      • canvas: Canvas

        The canvas on which the widget was drawn.

      Returns void

onInitializing: ((widget, ck) => void)

Called after a widget is initialized.

Type declaration

    • (widget, ck): void
    • Parameters

      • widget: Widget

        The widget that has been initialized.

      • ck: CanvasKit

        The CanvasKit instance.

      Returns void

pre: ((widget, ck, PropertyChanged) => void)

Called before a widget's properties are updated.

Type declaration

    • (widget, ck, PropertyChanged): void
    • Parameters

      • widget: Widget

        The widget whose properties are being updated.

      • ck: CanvasKit

        The CanvasKit instance.

      • PropertyChanged: string

        The name of the property that has changed.

      Returns void