ZdsBorderClipper class
A custom clipper that allows you to clip with different offsets on each side.
This ZdsBorderClipper
class extends CustomClipper<Path>
and
can be used to create a custom Path for a ClipPath
widget with distinct border clip lengths.
All the four sides (parameters: top
, bottom
, left
, right
) have to be provided upon creating an object.
These parameters represent the offsets from the corresponding sides.
If any of the insets (parameters) change, the clipping area will be recalculated.
Example
ZdsBorderClipper clipper = ZdsBorderClipper(
top: 10,
bottom: 10,
left: 10,
right: 10,
);
ClipPath(
clipper: clipper,
child: YourChildWidget(),
);
- Inheritance
-
- Object
- Listenable
- CustomClipper<
Path> - ZdsBorderClipper
- Annotations
Constructors
- ZdsBorderClipper({required double top, required double bottom, required double left, required double right})
-
Constructor for ZdsBorderClipper.
const
Properties
- bottom → double
-
Bottom border clip length.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- left → double
-
Left border clip length.
final
- right → double
-
Right border clip length.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- top → double
-
Top border clip length.
final
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) → Path -
Create a new path using the parameters provided in the constructor.
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 CustomClipper< Path> oldClipper) → bool -
Reclip only if any of the inset parameters have changed.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited