Skip to content
forked from kekland/croppy

A fully customizable image cropper for Flutter, in Flutter

License

Notifications You must be signed in to change notification settings

vertex-ly/croppy

 
 

Repository files navigation

Cover image

croppy

Pub Version

A fully customizable image cropper for Flutter, with built-in Material and Cupertino croppers.

Check out the example at https://kekland.github.io/croppy.

Supported platforms:

  • Android
  • iOS
  • Windows
  • Linux (untested, but should work)
  • macOS
  • Web (uses Dart's Cassowary instead of FFI because there's no FFI support in web)

Features

  • Material image cropper (similar to Google Photos)
  • iOS Photos app-like image cropper
  • Support for any linear transformations on the image: scaling, rotating, skewing, flipping, etc
  • Completely customizable (will create documentation with later releases)
  • Fixed aspect ratios
  • Custom cropping shapes
  • Kickass animations
  • Localization

In progress:

  • Image editing module (?) (brightness, contrast, etc)

Getting started

Install croppy from pub:

dependencies:
  croppy: <latest_version>

Enjoy using it :)

Usage

Currently croppy supports a Material (Google Photos-like) and a Cupertino (iOS Photos-like) image croppers:

final result = await showMaterialImageCropper(
  context,
  imageProvider: const NetworkImage('MY_IMAGE_URL'), // Or any other image provider
);

final result = await showCupertinoImageCropper(
  context,
  imageProvider: const NetworkImage('MY_IMAGE_URL'), // Or any other image provider
);

Voilà! You can now start cropping images.

For a complete runnable example, see ./example. For the full in-depth documentation, including customization, see the documentation.

Localization

croppy currently supports the following languages:

  • English
  • Kazakh
  • Russian

If there's a language that you would like to add, please see the localization guide.

It's recommended to insert the CroppyLocalizationDelegate in your MaterialApp or CupertinoApp:

MaterialApp(
  localizationsDelegates: [
    CroppyLocalizationDelegate(), // <- This here
    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate,
    GlobalCupertinoLocalizations.delegate,
  ],
  ...
)

Additional information

This package is still WIP, so expect some major updates along the way. Feel free to report bugs/issues on GitHub.

If you have questions, you can contact me directly at [email protected].

Credits:

About

A fully customizable image cropper for Flutter, in Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 65.6%
  • C++ 25.7%
  • CMake 5.1%
  • C 1.3%
  • Ruby 1.2%
  • Swift 0.4%
  • Other 0.7%