Files
Gourav Sarkar 48f14caf15 Image Editor App (#75)
* added image editor

* package update
2021-07-25 20:56:09 +02:00

32 lines
933 B
Dart

import 'package:flutter/material.dart';
import 'package:image_cropper/image_cropper.dart';
EditImg(_image)async{
var CroppedImg=await ImageCropper.cropImage(
sourcePath: _image.path,
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.ratio3x2,
CropAspectRatioPreset.original,
CropAspectRatioPreset.ratio4x3,
CropAspectRatioPreset.ratio16x9
],
androidUiSettings: AndroidUiSettings(
toolbarTitle: 'Cropper',
activeControlsWidgetColor: Colors.greenAccent[400],
toolbarColor: Colors.greenAccent[400],
toolbarWidgetColor: Colors.white,
initAspectRatio: CropAspectRatioPreset.original,
lockAspectRatio: false),
iosUiSettings: IOSUiSettings(
minimumAspectRatio: 1.0,
)
);
if(CroppedImg!=null){
_image=CroppedImg;
return _image;
}
else
return null;
}