Skip to content

Commit 5692bf0

Browse files
Added option to blur and added outlineColor and outlineStrokeWidth to customize the outline without having to provide a paint
1 parent 93ea9f5 commit 5692bf0

35 files changed

+1306
-44
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
## [0.0.14] - 2024-12-30
1+
## [0.1.0] - 2024-12-30
22

33
- Added maskShape so you can crop using a different mask than for visualisation (e.g. circle mask for visualisation, but square mask for cropping)
4+
- Added imageFilter and imageFilterBlendMode so you can add filters like blur the image outside the crop area (for example ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0))
45
- Fixed issue with aspectratio < 1 resulting in a to big cropSizeHeight
6+
- [Possibly breaking] Added outlineStrokeWidth and outlineColor to CustomImageCrop to customize the outline of the crop shape, if you provided custom drawPath method, you will need to add these to the method, but you do not need to use them if you don't want to customize the outline from the CustomImageCrop widget
57

68
## [0.0.13] - 2023-10-26
79

example/.metadata

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,9 @@ migration:
1515
- platform: root
1616
create_revision: d9111f64021372856901a1fd5bfbc386cade3318
1717
base_revision: d9111f64021372856901a1fd5bfbc386cade3318
18-
- platform: android
19-
create_revision: d9111f64021372856901a1fd5bfbc386cade3318
20-
base_revision: d9111f64021372856901a1fd5bfbc386cade3318
21-
- platform: ios
22-
create_revision: d9111f64021372856901a1fd5bfbc386cade3318
23-
base_revision: d9111f64021372856901a1fd5bfbc386cade3318
24-
- platform: linux
25-
create_revision: d9111f64021372856901a1fd5bfbc386cade3318
26-
base_revision: d9111f64021372856901a1fd5bfbc386cade3318
2718
- platform: macos
2819
create_revision: d9111f64021372856901a1fd5bfbc386cade3318
2920
base_revision: d9111f64021372856901a1fd5bfbc386cade3318
30-
- platform: web
31-
create_revision: d9111f64021372856901a1fd5bfbc386cade3318
32-
base_revision: d9111f64021372856901a1fd5bfbc386cade3318
33-
- platform: windows
34-
create_revision: d9111f64021372856901a1fd5bfbc386cade3318
35-
base_revision: d9111f64021372856901a1fd5bfbc386cade3318
3621

3722
# User provided section
3823

example/lib/main.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:math';
2+
import 'dart:ui';
23

34
import 'package:custom_image_crop/custom_image_crop.dart';
45
import 'package:example/result_screen.dart';
@@ -101,9 +102,9 @@ class _MyHomePageState extends State<MyHomePage> {
101102
Expanded(
102103
child: CustomImageCrop(
103104
cropController: controller,
104-
// image: const AssetImage('assets/test.png'), // Any Imageprovider will work, try with a NetworkImage for example...
105-
image: const NetworkImage(
106-
'https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png'),
105+
image: const AssetImage(
106+
'assets/test.png'), // Any Imageprovider will work, try with a AssetImage or NetworkImage for example...
107+
// image: const NetworkImage('https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png'),
107108
shape: _currentShape,
108109
ratio: _currentShape == CustomCropShape.Ratio
109110
? Ratio(width: _width, height: _height)
@@ -114,12 +115,9 @@ class _MyHomePageState extends State<MyHomePage> {
114115
borderRadius:
115116
_currentShape == CustomCropShape.Ratio ? _radius : 0,
116117
customProgressIndicator: const CupertinoActivityIndicator(),
118+
outlineColor: Colors.red,
117119
imageFit: _imageFit,
118-
pathPaint: Paint()
119-
..color = Colors.red
120-
..strokeWidth = 4.0
121-
..style = PaintingStyle.stroke
122-
..strokeJoin = StrokeJoin.round,
120+
imageFilter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
123121
),
124122
),
125123
Row(

example/macos/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Flutter-related
2+
**/Flutter/ephemeral/
3+
**/Pods/
4+
5+
# Xcode-related
6+
**/dgph
7+
**/xcuserdata/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Generated file. Do not edit.
3+
//
4+
5+
import FlutterMacOS
6+
import Foundation
7+
8+
9+
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
10+
}

0 commit comments

Comments
 (0)