@@ -90,9 +90,12 @@ class _MyHomePageState extends State<MyHomePage> {
90
90
child: CustomImageCrop (
91
91
cropController: controller,
92
92
// image: const AssetImage('assets/test.png'), // Any Imageprovider will work, try with a NetworkImage for example...
93
- image: const NetworkImage ('https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png' ),
93
+ image: const NetworkImage (
94
+ 'https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png' ),
94
95
shape: _currentShape,
95
- ratio: _currentShape == CustomCropShape .Ratio ? Ratio (width: _width, height: _height) : null ,
96
+ ratio: _currentShape == CustomCropShape .Ratio
97
+ ? Ratio (width: _width, height: _height)
98
+ : null ,
96
99
canRotate: true ,
97
100
canMove: false ,
98
101
canScale: false ,
@@ -108,17 +111,32 @@ class _MyHomePageState extends State<MyHomePage> {
108
111
Row (
109
112
mainAxisAlignment: MainAxisAlignment .spaceAround,
110
113
children: [
111
- IconButton (icon: const Icon (Icons .refresh), onPressed: controller.reset),
112
- IconButton (icon: const Icon (Icons .zoom_in), onPressed: () => controller.addTransition (CropImageData (scale: 1.33 ))),
113
- IconButton (icon: const Icon (Icons .zoom_out), onPressed: () => controller.addTransition (CropImageData (scale: 0.75 ))),
114
- IconButton (icon: const Icon (Icons .rotate_left), onPressed: () => controller.addTransition (CropImageData (angle: - pi / 4 ))),
115
- IconButton (icon: const Icon (Icons .rotate_right), onPressed: () => controller.addTransition (CropImageData (angle: pi / 4 ))),
114
+ IconButton (
115
+ icon: const Icon (Icons .refresh), onPressed: controller.reset),
116
+ IconButton (
117
+ icon: const Icon (Icons .zoom_in),
118
+ onPressed: () =>
119
+ controller.addTransition (CropImageData (scale: 1.33 ))),
120
+ IconButton (
121
+ icon: const Icon (Icons .zoom_out),
122
+ onPressed: () =>
123
+ controller.addTransition (CropImageData (scale: 0.75 ))),
124
+ IconButton (
125
+ icon: const Icon (Icons .rotate_left),
126
+ onPressed: () =>
127
+ controller.addTransition (CropImageData (angle: - pi / 4 ))),
128
+ IconButton (
129
+ icon: const Icon (Icons .rotate_right),
130
+ onPressed: () =>
131
+ controller.addTransition (CropImageData (angle: pi / 4 ))),
116
132
IconButton (
117
133
icon: const Icon (Icons .crop),
118
134
onPressed: () async {
119
135
final image = await controller.onCropImage ();
120
136
if (image != null ) {
121
- Navigator .of (context).push (MaterialPageRoute (builder: (BuildContext context) => ResultScreen (image: image)));
137
+ Navigator .of (context).push (MaterialPageRoute (
138
+ builder: (BuildContext context) =>
139
+ ResultScreen (image: image)));
122
140
}
123
141
},
124
142
),
0 commit comments