flutter_image_utils

pub package

Crops image as native plugin, both iOS and Android

Usage

Full example

# pubspec.yaml

dependencies:
  flutter_image_utils: ^0.1.0+3
// E.g. lib/main.dart

import 'dart:typed_data';
import 'package:flutter_image_utils/flutter_image_utils.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();

// All other methods can be used same way
final cropped = await FlutterImageUtils.cropImage(
  imgBytes,
  x: 0,
  y: 0,
  width: 50,
  height: 50,
  quality: 85,
);

/* ... */

MemoryImage(Uint8List.fromList(cropped))

Libraries

flutter_image_utils