crop_image_widget 0.2.0 copy "crop_image_widget: ^0.2.0" to clipboard
crop_image_widget: ^0.2.0 copied to clipboard

A Flutter widget for cropping sections of an image provided by an ImageProvider.

Crop Image Widget #

A Flutter widget for cropping sections of an image provided by an ImageProvider.


Key Features #

  • Zero Dependencies: Cropping is implemented using Flutter's standard painting API, ensuring compatibility across all Flutter platforms.
  • Aesthetic Blur Background: Provides a visually pleasing blurred background effect (subjective preference).
  • Minimalistic Interface: Designed for simplicity and ease of use (subjective preference).
  • Highly Customizable: Focused on balancing flexibility and simplicity without overwhelming the API.
  • Rich Feature Set: Offers most of the essential functionalities expected from an image cropper:
    • Resize the crop area by dragging the edges of the grid overlay.
    • Restrict the crop area to a specific aspect ratio.
    • Move and scale the image using gestures.
    • Support for circular crop areas.
    • Note: Currently, image rotation is not supported.

Demo #

Crop Image Widget Demo

Try the web demo (CanvasKit)


Usage Examples #

Examples of Crop Area Settings #

Aspect Ratio Crop Area

CropImage(
  image: _image,
  controller: _aspectRatioController,
  cropArea: CropArea.aspectRatio(16 / 9,
    isEditable: true,
    margin: 0,
  ),
),
Aspect Ratio Crop

Free-Form Crop Area

CropImage(
  image: _image,
  controller: _freeFormController,
  cropArea: CropArea.free(const Size.square(256),
    isEditable: true,
  ),
),
Aspect Ratio Crop

Circle Crop Area

CropImage(
  image: _image,
  controller: _circleController,
  cropArea: CropArea.circle(const Size.square(256),
    isEditable: true,
  ),
),
Aspect Ratio Crop

Limitations #

The html web renderer is not supported.

Credits #

Image used in the demo is by David Foodphototasty on Unsplash.

0
likes
150
points
22
downloads

Publisher

verified publishersummerhammer.dev

Weekly Downloads

A Flutter widget for cropping sections of an image provided by an ImageProvider.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, meta

More

Packages that depend on crop_image_widget