-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properties: blur;blurColor;outlineColor; #20
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR, overal looks good, but the non-optional outlineColor
makes this a breaking change while it doesn't have to be. If you can fix that, it will be a welcome addition.
@@ -8,6 +8,7 @@ An Image cropper that is customizable | |||
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) | |||
|
|||
<img src="https://github.com/icapps/flutter-custom-image-crop/blob/main/example/screenshots/customimagecrop.gif?raw=true" alt="customcropcircle" height="320"/> <img src="https://github.com/icapps/flutter-custom-image-crop/blob/main/example/screenshots/customcropsquare.png?raw=true" alt="customcropsquare" height="320"/> <img src="https://github.com/icapps/flutter-custom-image-crop/blob/main/example/screenshots/customcropcircle.png?raw=true" alt="customcropcircle" height="320"/> | |||
<img src="https://github.com/MoeJaber/flutter-custom-image-crop/blob/main/example/screenshots/customimagecropblur.jpg?raw=true" alt="customcropcircle" height="320"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe already point to https://github.com/icapps/... so we don't loose the image in the future
@@ -5,6 +5,7 @@ class DottedCropPathPainter extends CustomPainter { | |||
static const _dashWidth = 10.0; | |||
static const _dashSpace = 5.0; | |||
static const _strokeWidth = 4.0; | |||
Color outlineColor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be final. I would also make this optional with Colors.white as fallback
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; | |||
/// Draw a solid path around the given path | |||
class SolidCropPathPainter extends CustomPainter { | |||
static const _strokeWidth = 4.0; | |||
Color outlineColor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be final. I would also make this optional with Colors.white as fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not use white, but transparant because it would break/update all current implementation to an outline implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation uses white
final _paint = Paint()
..color = Colors.white
....
void paint(Canvas canvas, Size size) {
_paint.color = outlineColor;
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forget what I said here :D
@@ -11,14 +12,17 @@ class SolidCropPathPainter extends CustomPainter { | |||
..strokeJoin = StrokeJoin.round; | |||
|
|||
/// Draw a solid path around the given path | |||
SolidCropPathPainter(this._path); | |||
SolidCropPathPainter(this._path, this.outlineColor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this so we know what the Color means and it's not required or breaking
SolidCropPathPainter(this._path, {this.outlineColor = Colors.white,});
final Color? blurColor; | ||
|
||
/// Sets the color of the outline of the crop selection area | ||
Color? outlineColor = Colors.white; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final and not nullable, but default Colors.white
@@ -12,6 +12,7 @@ dependencies: | |||
sdk: flutter | |||
gesture_x_detector: ^1.0.0 | |||
vector_math: ^2.1.0 | |||
blur: ^3.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this package? Isn't it possible to blur with flutter directly?
@@ -8,6 +8,7 @@ An Image cropper that is customizable | |||
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) | |||
|
|||
<img src="https://github.com/icapps/flutter-custom-image-crop/blob/main/example/screenshots/customimagecrop.gif?raw=true" alt="customcropcircle" height="320"/> <img src="https://github.com/icapps/flutter-custom-image-crop/blob/main/example/screenshots/customcropsquare.png?raw=true" alt="customcropsquare" height="320"/> <img src="https://github.com/icapps/flutter-custom-image-crop/blob/main/example/screenshots/customcropcircle.png?raw=true" alt="customcropcircle" height="320"/> | |||
<img src="https://github.com/MoeJaber/flutter-custom-image-crop/blob/main/example/screenshots/customimagecropblur.jpg?raw=true" alt="customcropcircle" height="320"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already link to icapps.
@@ -15,6 +15,7 @@ class MyApp extends StatelessWidget { | |||
@override | |||
Widget build(BuildContext context) { | |||
return MaterialApp( | |||
debugShowCheckedModeBanner: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; | |||
/// Draw a solid path around the given path | |||
class SolidCropPathPainter extends CustomPainter { | |||
static const _strokeWidth = 4.0; | |||
Color outlineColor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not use white, but transparant because it would break/update all current implementation to an outline implementation
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; | |||
/// Draw a solid path around the given path | |||
class SolidCropPathPainter extends CustomPainter { | |||
static const _strokeWidth = 4.0; | |||
Color outlineColor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think we should make the width configurable directly
Any update on this? |
No description provided.