Skip to content

Commit e2490cd

Browse files
Fixed imageAsUIImage!
1 parent a57ba56 commit e2490cd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/src/widgets/custom_image_crop_widget.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ class _CustomImageCropState extends State<CustomImageCrop> with CustomImageCropL
101101

102102
@override
103103
Widget build(BuildContext context) {
104-
if (imageAsUIImage == null) {
104+
final image = imageAsUIImage;
105+
if (image == null) {
105106
return const Center(child: CircularProgressIndicator());
106107
}
107108
return LayoutBuilder(
108109
builder: (context, constraints) {
109110
width = constraints.maxWidth;
110111
height = constraints.maxHeight;
111-
final image = imageAsUIImage!;
112112
final cropWidth = min(width, height) * widget.cropPercentage;
113113
final defaultScale = min(image.width, image.height) / cropWidth;
114114
final scale = data.scale * defaultScale;

0 commit comments

Comments
 (0)