simple_image_crop 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • new84

Image Zoom and Cropping plugin for Flutter #

A simple and easy used flutter plugin to crop image on iOS and Android.

Image Cropping circle area Image Cropping rect area Image Cropping rect gif Image Cropping area gif

Installation #

Add simple_image_crop simple_image_crop as a dependency in pubspec.yaml.

Using #

Create a widget to load and edit an image: #

final imgCropKey = GlobalKey<ImgCropState>();

Widget _buildCropImage() {
  return Container(
      child: ImgCrop(
        key: cropKey,
        chipRadius: 150,  // crop area radius
        chipShape: 'circle', // crop type "circle" or "rect"
        image: Image.file(imageFile), // you selected image file

Generate a cropped image: #

Select image recommend image-picker, image file may be from the previous page:

final Map args = ModalRoute.of(context).settings.arguments

a async function get cropped file image:

final croppedFile = crop.cropCompleted('selected file image', {pictureQuality: 'int of Picture quality'})
floatingActionButton: FloatingActionButton(
  onPressed: () async {
    final crop = cropKey.currentState;
    final croppedFile =
        await crop.cropCompleted(args['image'], pictureQuality: 900);

    // show you croppedFile ……
    showImage(context, croppedFile);

it's so esay !

0.0.1 #

init package

0.0.2 #

update email

0.1.0 #

fixed unused code

0.1.1 #

update README

0.1.2 #

update api findAncestorStateOfType


image_crop_example #

Demonstrates how to use the image_crop plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  simple_image_crop: ^0.1.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:simple_image_crop/simple_image_crop.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.4


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies