EasyImageEditor use for add any kind of widget over the background image or color and move that widget, resize, rotate.
1) change editor background color. 2) add any widget as background in editor. 3) add any widget over the editor. 4) move, resize, flip, zoom and rotate added widget. 5) update added widget with another widget. 6) allow undo and redo. 7) allow single and multiple selection. 8) allow change border color and remove icon. 9) remove added widget. 10) handle all action manually
First, add easy_image_editor
as a dependency in your pubspec.yaml file.
then add this line in your file import 'package:easy_image_editor/easy_image_editor.dart';
import 'package:easy_image_editor/easy_image_editor.dart';
class _MyHomePageState extends State<MyHomePage> {
late EasyImageEditorController _easyImageEditorController;
...
@override
void initState() {
super.initState();
...
}
...
@override
Widget build(BuildContext context) {
return Scaffold(
...
body: EditorView(
onInitialize: (controller) {
setState(() {
_easyImageEditorController = controller;
});
},
),
...
);
}
...
}
for more detail and usage see /example/lib/main.dart
1) borderColor
use for set border color of widget default value Colors.black
.
2) removeIcon
set remove icon of widget default value Icon(Icons.cancel)
.
3) onViewTouch
this event call when widget touch.
4) onViewTouchOver
this event call when widget touch remove.
5) addBackgroundColor
set background color of editor.
6) addBackgroundView
set background color of editor. it will overlap background color.
7) addView
add any kind of view over the editor.
8) updateView
update added view in editor.
9) canEditMultipleView
set edit selection mode multiple or single default value true
.
10) hideViewControl
it will hide borders and remove icons of all added widget.
11) showViewControl
it will show borders and remove icons of all added widget.
12) onClick
this event call when widget click.
13) clickToFocusAndMove
if you set true then any widget move, rotate, zoom by touch when user click's on default value false
.
14) moveView
move widget over the editor programmatically.
15) rotateView
rotate widget over the editor programmatically.
16) zoomInOutView
zoom in or out widget over the editor programmatically.
17) flipView
flip vertical or horizontal widget over the editor programmatically.
18) updateMatrix
update widget matrix over the editor programmatically like your way.