render method
Implementation
void render(Canvas c) {
if (_rectBackgroundDirection != null && _dragging && enableDirection) {
if (spriteBackgroundDirection == null) {
_paintBackground?.let((paintBackground) {
double radiusBackground = _rectBackgroundDirection!.width / 2;
c.drawCircle(
Offset(
_rectBackgroundDirection!.left + radiusBackground,
_rectBackgroundDirection!.top + radiusBackground,
),
radiusBackground,
paintBackground,
);
});
} else {
spriteBackgroundDirection?.renderRect(
c,
_rectBackgroundDirection!,
);
}
}
_rect?.let((rect) {
if (_spriteToRender != null) {
_spriteToRender?.renderRect(
c,
rect,
);
} else {
double radiusAction = rect.width / 2;
c.drawCircle(
Offset(
rect.left + radiusAction,
rect.top + radiusAction,
),
radiusAction,
(isPressed ? _paintActionPressed : _paintAction) ?? Paint(),
);
}
});
}