flutter_image_crop 0.2.4+1

flutter_image_crop #

DEPRECATED. Use flutter_image_utils instead

pub package

Crops image as native plugin, both iOS and Android

Usage #

Full example

# pubspec.yaml

dependencies:
  flutter_image_crop: ^0.2.4+1
// E.g. lib/main.dart

import 'dart:typed_data';
import 'package:flutter_image_crop/flutter_image_crop.dart';

/* ... */

final img = AssetImage('assets/some_image.jpg');
final config = new ImageConfiguration();

final key = await img.obtainKey(config);
final data = await key.bundle.load(key.name);

final imgBytes = data.buffer.asUint8List();

final cropped = await FlutterImageCrop.cropImage(
  imgBytes,
  x: 0,
  y: 0,
  width: 50,
  height: 50,
  quality: 85,
);

/* ... */

MemoryImage(Uint8List.fromList(cropped))

0.2.4+1 #

0.2.4 #

  • added support for Android API level 21

0.2.3 #

  • increased speed of exif orieantion fix on android

0.2.2+1 #

  • updated description in pubspec.yaml

0.2.2 #

  • fixed wrong image orientation after cropping

0.2.1 #

  • updated to Swift 5

0.2.0+2 #

  • updated readmes

0.2.0+1 #

  • updated example app, now it supports picking images from camera and photo gallery (thanks to image_picker plugin)
  • added docs

0.2.0 #

  • basic functionality

example/README.md

flutter_image_crop example #

example

  • Run app by executing flutter run
  • Pick the image from one of the sources
  • Adjust x, y, width, height and quality values with sliders
  • Tap on crop button

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_image_crop: ^0.2.4+1

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:flutter_image_crop/flutter_image_crop.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
69
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
85
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
image_picker ^0.6.0+3

Admin