IPainter class abstract
Abstract base class for implementing custom painters used in ICanvas.
IPainter handles painting, animation controllers, and repaint management. Extend this class to create animated or interactive canvas effects.
Properties
-
animations
→ List<
Animation< double> > -
List of active Animations, primarily used for double interpolations.
final
- center ↔ Offset
-
The center point of the canvas.
getter/setter pair
-
controllers
→ List<
AnimationController> -
List of active AnimationControllers used by this painter.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ double
-
The current height of the canvas.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldRepaint → bool
-
Whether the painter should repaint on every frame.
no setter
- width ↔ double
-
The current width of the canvas.
getter/setter pair
Methods
-
createAnimation<
T> ({required TickerProvider vsync, required AnimationController controller, required Tween< T> tween, VoidCallback? listener}) → Animation<T> - Creates and manages a tween-based Animation from a given controller.
-
createController(
{required TickerProvider vsync, required Duration duration, bool repeat = true, bool reverse = false, VoidCallback? listener}) → AnimationController - Creates and manages an AnimationController.
-
dispose(
) → void - Disposes all animation controllers and clears associated data.
-
initialize(
{required double width, required double height, required Offset center, required TickerProvider vsync, required ValueNotifier< bool> repaintNotifier, required bool isFirstInilize}) → void - Initializes the painter with canvas dimensions and setup information.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onInit(
TickerProvider vsync) → void - Override this method to perform setup such as creating animations.
-
render(
Canvas canvas, Size size) → void - Renders the custom drawing logic on the given Canvas and Size.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
) → void - Triggers a repaint by toggling the repaint notifier.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited