ImageSliderPainter class
Custom painter for rendering the ImageSlider track, anchors, borders, and image
This painter handles ALL visual elements of the slider, ensuring perfect alignment since everything uses the same coordinate system.
- Inheritance
-
- Object
- Listenable
- CustomPainter
- ImageSliderPainter
Constructors
-
ImageSliderPainter({required double sliderPosition, required double sliderPercentage, required Color color, required double imageWidth, required Color borderColor, required double strokeWidth, required double anchorWidth, required double borderWidth, required int numImages, required double sliderWidth, required int currentPosition, required Map<
int, Image> allImages, Image? currentImage}) - Creates an ImageSliderPainter with the given configuration
Properties
-
allImages
→ Map<
int, Image> -
All loaded images indexed by position
final
- anchorWidth → double
-
Width of the anchor points along the track
final
- borderColor → Color
-
Color of the slider border
final
- borderWidth → double
-
Width of the border around the slider track
final
- color → Color
-
Color of the slider track and anchors
final
- currentImage → Image?
-
The loaded image to display at the current position
final
- currentPosition → int
-
Current selected position index
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageWidth → double
-
Width (and height) of the draggable image indicator
final
- numImages → int
-
Number of images in the slider
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticsBuilder → SemanticsBuilderCallback?
-
Returns a function that builds semantic information for the picture drawn
by this painter.
no setterinherited
- sliderPercentage → double
-
Current position of the slider as a percentage (0.0 to 1.0)
final
- sliderPosition → double
-
Current position of the slider along the track (in pixels) - center of image
final
- sliderWidth → double
-
Total width of the slider
final
- strokeWidth → double
-
Width of the stroke used to draw the slider track
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be notified when it is time to repaint.
inherited
-
hitTest(
Offset position) → bool? -
Called whenever a hit test is being performed on an object that is using
this custom paint delegate.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paint(
Canvas canvas, Size size) → void -
Called whenever the object needs to paint. The given Canvas has its
coordinate space configured such that the origin is at the top left of the
box. The area of the box is the size of the
sizeargument.override -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies when it is time to repaint.
inherited
-
shouldRebuildSemantics(
covariant CustomPainter oldDelegate) → bool -
Called whenever a new instance of the custom painter delegate class is
provided to the RenderCustomPaint object, or any time that a new
CustomPaint object is created with a new instance of the custom painter
delegate class (which amounts to the same thing, because the latter is
implemented in terms of the former).
inherited
-
shouldRepaint(
covariant ImageSliderPainter oldDelegate) → bool -
Called whenever a new instance of the custom painter delegate class is
provided to the RenderCustomPaint object, or any time that a new
CustomPaint object is created with a new instance of the custom painter
delegate class (which amounts to the same thing, because the latter is
implemented in terms of the former).
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited