Skip to content

Commit

Permalink
conf: upgrade package image_cropper from 5.0.1 to 8.0.2
Browse files Browse the repository at this point in the history
Fixes #2554
  • Loading branch information
xkaper001 committed Dec 12, 2024
1 parent 7c94742 commit 3bc620a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
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,
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,
CropAspectRatioPreset.original,
],
uiSettings: anyNamed('uiSettings'),
),
).thenAnswer((realInvocation) async => CroppedFile(path));
Expand Down

0 comments on commit 3bc620a

Please sign in to comment.