cropImage static method
Future
cropImage({
- required BuildContext context,
- required Uint8List imageBytes,
- required dynamic onImageDoneListener(
- dynamic
- VoidCallback? onImageStartLoading,
- VoidCallback? onImageEndLoading,
- CropAspectRatio? selectedImageRatio,
- bool visibleOtherAspectRatios = true,
- double squareBorderWidth = 2,
- List<
CropAspectRatio> ? customAspectRatios, - Color squareCircleColor = Colors.orange,
- double squareCircleSize = 30,
- Color defaultTextColor = Colors.black,
- Color selectedTextColor = Colors.orange,
- Color colorForWhiteSpace = Colors.white,
- int encodingQuality = 100,
- String? workerPath,
- bool isConstrain = true,
- bool makeDarkerOutside = true,
- EdgeInsets? imageEdgeInsets = const EdgeInsets.all(10),
- OutputImageFormat outputImageFormat = OutputImageFormat.jpg,
- Key? key,
Implementation
static Future<dynamic> cropImage(
{required BuildContext context,
required Uint8List imageBytes,
required Function(dynamic) onImageDoneListener,
VoidCallback? onImageStartLoading,
VoidCallback? onImageEndLoading,
CropAspectRatio? selectedImageRatio,
bool visibleOtherAspectRatios = true,
double squareBorderWidth = 2,
List<CropAspectRatio>? customAspectRatios,
Color squareCircleColor = Colors.orange,
double squareCircleSize = 30,
Color defaultTextColor = Colors.black,
Color selectedTextColor = Colors.orange,
Color colorForWhiteSpace = Colors.white,
int encodingQuality = 100,
String? workerPath,
bool isConstrain = true,
bool makeDarkerOutside = true,
EdgeInsets? imageEdgeInsets = const EdgeInsets.all(10),
bool rootNavigator = false,
OutputImageFormat outputImageFormat = OutputImageFormat.jpg,
Key? key}) {
/// Here, we are pushing a image cropping2 screen.
return Navigator.of(context, rootNavigator: rootNavigator).push(
MaterialPageRoute(
builder: (_context) => ImageCroppingScreen(
_context,
imageBytes,
onImageStartLoading,
onImageEndLoading,
onImageDoneListener,
colorForWhiteSpace,
customAspectRatios: customAspectRatios,
selectedImageRatio: selectedImageRatio,
visibleOtherAspectRatios: visibleOtherAspectRatios,
squareCircleColor: squareCircleColor,
squareBorderWidth: squareBorderWidth,
squareCircleSize: squareCircleSize,
defaultTextColor: defaultTextColor,
selectedTextColor: selectedTextColor,
encodingQuality: encodingQuality,
workerPath: workerPath,
isConstrain: isConstrain,
makeDarkerOutside: makeDarkerOutside,
imageEdgeInsets: imageEdgeInsets,
outputImageFormat: outputImageFormat,
),
),
);
}