Skip to content
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

conf: Upgrade package image_cropper from 5.0.1 to 8.0.2 #2664

Closed
12 changes: 8 additions & 4 deletions lib/services/image_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ class ImageService {
try {
final CroppedFile? croppedImage = await _imageCropper.cropImage(
sourcePath: imageFile.path,
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.original,
],
uiSettings: [
AndroidUiSettings(
toolbarTitle: 'Crop Image',
Expand All @@ -42,9 +38,17 @@ class ImageService {
cropGridColor: Colors.white,
initAspectRatio: CropAspectRatioPreset.original,
lockAspectRatio: false,
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.original,
],
),
IOSUiSettings(
minimumAspectRatio: 1.0,
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.original,
],
),
],
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies:
graphql_flutter: ^5.1.2
hive: ^2.2.3
http: ^1.2.2
image_cropper: ^5.0.1
image_cropper: ^8.0.2
image_picker: ^1.1.2
intl: ^0.19.0
json_annotation: ^4.7.0
Expand Down
8 changes: 0 additions & 8 deletions test/service_tests/image_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ void main() {
when(
mockImageCropper.cropImage(
sourcePath: "test",
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.original,
],
uiSettings: anyNamed('uiSettings'),
),
).thenAnswer((realInvocation) async => croppedFile);
Expand All @@ -65,10 +61,6 @@ void main() {
when(
mockImageCropper.cropImage(
sourcePath: "test",
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.original,
],
uiSettings: anyNamed('uiSettings'),
),
).thenThrow(Exception());
Expand Down
8 changes: 0 additions & 8 deletions test/service_tests/multi_media_pick_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ void main() {
when(
mockImageCropper.cropImage(
sourcePath: "test",
aspectRatioPresets: [
CropAspectRatioPreset.square,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. You have removed testing features.
  2. We need to codebase to be stable and this defeats the purpose
  3. Please make the tests valid

CropAspectRatioPreset.original,
],
uiSettings: anyNamed('uiSettings'),
),
).thenAnswer((realInvocation) async => CroppedFile(path));
Expand All @@ -65,10 +61,6 @@ void main() {
when(
mockImageCropper.cropImage(
sourcePath: "test",
aspectRatioPresets: [
CropAspectRatioPreset.square,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. You have removed testing features.
  2. We need to codebase to be stable and this defeats the purpose
  3. Please make the tests valid

CropAspectRatioPreset.original,
],
uiSettings: anyNamed('uiSettings'),
),
).thenAnswer((realInvocation) async => CroppedFile(path));
Expand Down
Loading