1
0
mirror of https://github.com/nisrulz/flutter-examples.git synced 2026-04-20 22:21:04 +00:00

Image Editor App (#75)

* added image editor

* package update
This commit is contained in:
Gourav Sarkar
2021-07-26 00:26:09 +05:30
committed by GitHub
parent abd78777a6
commit 48f14caf15
70 changed files with 1657 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
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;
}