image_crop
image_crop copied to clipboard
add: rounded crop mask
Corresponds to the rounded crop mask.
Crop.file(
file,
key: cropKey,
aspectRatio: aspect,
shape: Shape.circle, // default is Shape.rectangle
)
There already is BoxShape in flutter/painting.dart
enum BoxShape {
/// An axis-aligned, 2D rectangle. May have rounded corners (described by a
/// [BorderRadius]). The edges of the rectangle will match the edges of the box
/// into which the [Border] or [BoxDecoration] is painted.
///
/// See also:
///
/// * [RoundedRectangleBorder], the equivalent [ShapeBorder].
rectangle,
/// A circle centered in the middle of the box into which the [Border] or
/// [BoxDecoration] is painted. The diameter of the circle is the shortest
/// dimension of the box, either the width or the height, such that the circle
/// touches the edges of the box.
///
/// See also:
///
/// * [CircleBorder], the equivalent [ShapeBorder].
circle,
// Don't add more, instead create a new ShapeBorder.
}
However I'd recommend to use BorderShape to allow setting a rounded rectangle as well.