Skip to content

Commit

Permalink
Add filterQuality (#108) (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
abichinger authored Dec 11, 2024
1 parent 6982e8e commit 20c3dd8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/src/widget/crop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ class Crop extends StatelessWidget {
/// builder to place a widget inside the cropping area
final OverlayBuilder? overlayBuilder;

/// The rendering quality of the image
final FilterQuality filterQuality;

Crop({
super.key,
required this.image,
Expand Down Expand Up @@ -167,6 +170,7 @@ class Crop extends StatelessWidget {
ImageParser? imageParser,
this.scrollZoomSensitivity = 0.05,
this.overlayBuilder,
this.filterQuality = FilterQuality.medium,
}) : assert((initialSize ?? 1.0) <= 1.0,
'initialSize must be less than 1.0, or null meaning not specified.'),
this.imageParser = imageParser ?? defaultImageParser;
Expand Down Expand Up @@ -207,6 +211,7 @@ class Crop extends StatelessWidget {
formatDetector: formatDetector,
imageParser: imageParser,
overlayBuilder: overlayBuilder,
filterQuality: filterQuality,
),
);
},
Expand Down Expand Up @@ -240,6 +245,7 @@ class _CropEditor extends StatefulWidget {
final ImageParser imageParser;
final double scrollZoomSensitivity;
final OverlayBuilder? overlayBuilder;
final FilterQuality filterQuality;

const _CropEditor({
super.key,
Expand Down Expand Up @@ -268,6 +274,7 @@ class _CropEditor extends StatefulWidget {
required this.imageParser,
required this.scrollZoomSensitivity,
this.overlayBuilder,
required this.filterQuality,
});

@override
Expand Down Expand Up @@ -571,6 +578,7 @@ class _CropEditorState extends State<_CropEditor> {
width: _readyState.imageRect.width,
height: _readyState.imageRect.height,
fit: BoxFit.contain,
filterQuality: widget.filterQuality,
),
),
],
Expand Down

0 comments on commit 20c3dd8

Please sign in to comment.