FilterAppliedImage constructor
FilterAppliedImage({})
Creates a FilterAppliedImage widget.
Implementation
FilterAppliedImage({
super.key,
required this.image,
required this.filter,
this.fit,
this.onProcess,
this.opacity = 1,
}) {
if (onProcess != null) {
if (filter.filters.isEmpty) {
onProcess!(image);
return;
}
final ImageEditorOption option = ImageEditorOption();
option.addOption(ColorOption(matrix: filter.matrix));
ImageEditor.editImage(
image: image,
imageEditorOption: option,
).then((result) {
if (result != null) {
onProcess!(result);
}
}).catchError((err, stack) {});
}
}