Skip to content

Commit 6a8b77c

Browse files
author
Skandar Munir Ahmed
committed
fix formatting
1 parent a041608 commit 6a8b77c

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

example/lib/main.dart

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ class _MyHomePageState extends State<MyHomePage> {
9090
child: CustomImageCrop(
9191
cropController: controller,
9292
// 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'),
9495
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,
9699
canRotate: true,
97100
canMove: false,
98101
canScale: false,
@@ -108,17 +111,32 @@ class _MyHomePageState extends State<MyHomePage> {
108111
Row(
109112
mainAxisAlignment: MainAxisAlignment.spaceAround,
110113
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))),
116132
IconButton(
117133
icon: const Icon(Icons.crop),
118134
onPressed: () async {
119135
final image = await controller.onCropImage();
120136
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)));
122140
}
123141
},
124142
),

0 commit comments

Comments
 (0)