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))

Libraries

flutter_image_crop