RectClipper class
A custom clipper that clips a rectangular region based on the provided direction and clip factor.
The RectClipper is used to clip a rectangular region within a widget. The clipping can be controlled by specifying the direction and clipFactor.
The direction determines the direction of clipping and can be either SliderDirection.horizontal or SliderDirection.vertical. For the horizontal direction, the clipping width is calculated as the product of the widget's width and the clipFactor. For the vertical direction, the clipping height is calculated as the product of the widget's height and the clipFactor.
The clipFactor specifies the fraction of the widget's size that should be clipped. It should be a value between 0.0 and 1.0, where 0.0 indicates no clipping and 1.0 indicates full clipping.
- Inheritance
-
- Object
- Listenable
- CustomClipper<
Rect> - RectClipper
Constructors
- RectClipper({required SliderDirection direction, required double clipFactor})
-
Creates a RectClipper with the specified direction and clip factor.
const
Properties
- clipFactor → double
-
The fraction of the widget's size to be clipped.
final
- direction → SliderDirection
-
The direction in which the clipping should occur.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be notified when it is time to reclip.
inherited
-
getApproximateClipRect(
Size size) → Rect -
Returns an approximation of the clip returned by getClip, as
an axis-aligned Rect. This is used by the semantics layer to
determine whether widgets should be excluded.
inherited
-
getClip(
Size size) → Rect -
Returns a description of the clip given that the render object being
clipped is of the given size.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies when it is time to reclip.
inherited
-
shouldReclip(
covariant RectClipper oldClipper) → bool -
Called whenever a new instance of the custom clipper delegate class is
provided to the clip object, or any time that a new clip object is created
with a new instance of the custom clipper 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