搜索插件、代码仓与 APP 分类

croppy 封面
插件详情v1.5.3

croppy

一个完全可自定义的 Flutter 图像裁剪工具。以移动设备为优先,但同时也支持 Web 和桌面平台。

Web
近 30 天下载
9730
喜欢数
144
Pub 分数
150

安装插件

flutter pub add croppy

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Croppy 是一个完全可定制的 Flutter 图像裁剪工具,采用以移动设备为先的设计理念,同时支持 Web 和桌面平台。它提供了直观的手势操作和灵活的配置选项,带来无缝的图像裁剪体验。专为需要精细控制裁剪界面的开发者打造,Croppy 可自定义纵横比、裁剪边界和用户界面元素。其轻量级且响应迅速的设计确保了在各种设备上的流畅性能。

适合场景

  • 移动应用中的图像编辑
  • 基于网络的照片裁剪工具
  • 桌面图像处理工作流程
  • 可自定义的面向用户的裁剪接口
  • 将图像裁剪集成到媒体上传流程中

主要特点

  • 完全可自定义的裁剪区域
  • 对多个平台(Web、移动设备、桌面)的支持
  • 基于手势的裁剪控制
  • 可配置的纵横比
  • 响应式和自适应的用户界面
  • 可扩展的样式选项

适合对象

  • 开发媒体丰富的应用程序的开发者
  • 需要高级图像处理的应用程序
  • 跨平台图像裁剪解决方案
  • Teams prioritizing user experience in image editing
  • 需要轻量级、高性能裁剪组件的项目

使用建议

  • 非移动平台需要额外设置
  • 用于裁剪形状的内置预设有限
  • 可能需要自定义样式以匹配品牌UI
  • 未针对大规模高分辨率图像处理进行优化
  • 依赖于平台特定的渲染行为

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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)

NOTE: see https://github.com/kekland/croppy/issues/38. Currently I'm very busy with other projects so support might be limited.

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 showAdaptiveImageCropper(
    context,
    imageProvider: const NetworkImage('MY_IMAGE_URL'), // Or any other image provider
);

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
  • Arabic (thanks @Milad-Akarie)
  • Vietnamese (thanks @ptanhVNU)
  • Portuguese (thanks @JCKodel)
  • Spanish (thanks @Thesergiolg99)
  • Chinese (thanks @yohom and @zhushenwudi)
  • Hebrew (thanks @kfiross)
  • German (thanks @jkoenig134)
  • Persian (thanks @mdpe-ir)
  • Turkish (thanks @BayramYARIM)
  • Polish (thanks @mekkolodziejski)
  • Romanian (thanks @AdrianSima)
  • Kyrgyz (thanks @warioddly)

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

It's recommended to insert the CroppyLocalizations.delegate in your MaterialApp or CupertinoApp:

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

Additional information

Feel free to report bugs/issues on GitHub.

If you have questions, you can contact me directly at kk.erzhan@gmail.com.

Credits:

  • https://github.com/daniyarzt for the FitAabbInQuadSolver class

所属分类

依赖

依赖清单 11 项

源码仓库

使用此插件的项目

暂无相关数据。