Skip to content

Commit

Permalink
version up to 2.0.0-dev.4
Browse files Browse the repository at this point in the history
  • Loading branch information
chooyan-eng committed Dec 11, 2024
1 parent 8212d2f commit f6bfd7b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [2.0.0-dev.4] - 2024.12.10
* Add `onImageMoved` callback that notifies image moved when `interactive` is enabled.
* Add `overlayBuilder` argument to `Crop` widget that enables to configure overlay on cropping area.
* Fix a bug that UI goes to loading state when rebuild happens.
* Fix a bug of `InvalidRectError` happening unexpectedly.
* Fix a bug of crashing after disposing `Crop` widget.

## [2.0.0-dev.3] - 2024.12.9
* Change the type of `initialRectBuilder` to `InitialRectBuilder`, and now legacy `initialArea` and `initialSize` are removed and merged into `InitialRectBuilder`.
* Add `InitialRectBuilder.withSizeAndRatio` to configure initial `aspectRatio`.
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,17 @@ Widget build(BuildContext context) {
// withCircleUi: true,
baseColor: Colors.blue.shade900,
maskColor: Colors.white.withAlpha(100),
overlayBuilder: (context, rect) {
return CustomPaint(painter: MyPainter(rect));
},
progressIndicator: const CircularProgressIndicator(),
radius: 20,
onMoved: (newRect) {
// do something with current crop rect.
},
onImageMoved: (newImageRect) {
// do something with current image rect.
},
onStatusChanged: (status) {
// do something with current CropStatus
},
Expand Down Expand Up @@ -164,8 +170,10 @@ Widget build(BuildContext context) {
|withCircleUi|bool|Flag to decide the shape of cropping UI. If `true`, the shape of cropping UI is circle and `aspectRatio` is automatically set `1.0`. Note that this flag does NOT affect to the result of cropping image. If you want cropped images with circle shape, call `CropController.cropCircle` instead of `CropController.crop`.|
|maskColor|Color?|Color of the mask widget which is placed over the cropping editor.|
|baseColor|Color?|Color of the base color of the cropping editor.|
|overlayBuilder|Widget Function(BuildContext, ViewportBasedRect)?|Builder function to build Widget placed over the cropping rect. `rect` of argument is current `ViewportBasedRect` of crop rect.|
|radius|double?|Corner radius of crop rect.|
|onMoved|void Function(Rect)?|Callback called when crop rect is moved regardless of its reasons. `newRect` of argument is current `Rect` of crop rect.|
|onMoved|void Function(ViewportBasedRect)?|Callback called when crop rect is moved regardless of its reasons. `newRect` of argument is current `ViewportBasedRect` of crop rect.|
|onImageMoved|void Function(ViewportBasedRect)?|Callback called when image is moved regardless of its reasons. `newImageRect` of argument is current `ViewportBasedRect` of image.|
|onHistoryChanged|void Function(History)?|Callback called when history of crop rect is changed. This history allows you to undo / redo feature is available or not.|
|onStatusChanged|void Function(CropStatus)?|Callback called when status of Crop is changed.|
|willUpdateScale|bool Function(double)?|Callback called before scale changes on _interactive_ mode. By returning `false` to this callback, updating scale will be canceled.|
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: crop_your_image
description: crop_your_image helps your app to embed Widgets for cropping images.
version: 2.0.0-dev.3
version: 2.0.0-dev.4
homepage: https://github.com/chooyan-eng/crop_your_image
topics:
- crop
Expand Down

0 comments on commit f6bfd7b

Please sign in to comment.