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

cropperx 封面
插件详情v1.1.1

cropperx

一个用 Flutter 编写的图像裁剪包。可用于裁剪和旋转图像。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
6600
喜欢数
89
Pub 分数
160

安装插件

flutter pub add cropperx

插件介绍

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

CropperX 是一个专为 Flutter 设计的包,用于以简洁直观的界面裁剪和旋转图像。该包支持跨平台使用,兼容 Android、iOS、Web、macOS、Windows 和 Linux。它提供可自定义的控件,用于调整裁剪区域和图像旋转,非常适合需要精确图像编辑的应用程序。CropperX 可通过简单的 API 无缝集成到 Flutter 应用中,使开发者能够快速实现图像裁剪功能。CropperX 轻量且高效,专注于性能和易用性。

适合场景

  • 图像资料编辑
  • 文档扫描工作流程
  • 照片编辑工具
  • 社交媒体内容创作
  • 用户生成内容处理

主要特点

  • 交互式图像裁剪
  • 实时旋转支持
  • 跨平台兼容性
  • 可自定义的 UI 控件
  • 与 Flutter 的简单集成

适合对象

  • 移动应用开发者
  • Web应用程序创建者
  • 图像处理功能
  • 面向用户的照片编辑器
  • 需要文件或身份验证的应用程序

使用建议

  • 需要在裁剪前加载图像
  • 仅限基本编辑操作
  • 无内置图像保存功能
  • 可能需要为自定义主题添加额外的样式
  • 依赖外部图像源处理

原始 README

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

CropperX

A cropper package made fully in Flutter.

Circle Rectangle Grid
Screenshot circle Screenshot rectangle Screenshot grid
Types of overlays

The overlay can be defined by adding an overlay type through the overlayType parameter. The following types are currently supported:

  • OverlayType.none: No overlay at all.
  • OverlayType.circle: An overlay with a circular gap.
  • OverlayType.rectangle: An overlay with a rectangular gap, takes the given aspect ratio.
  • OverlayType.grid: An overlay of grid lines: 2 horizontal and 2 vertical, evenly spaced.
  • OverlayType.gridHorizontal: An overlay of 2 horizontal grid lines, evenly spaced.
  • OverlayType.gridVertical: An overlay of 2 vertical grid lines, evenly spaced.
Rotating the image

The image rotation can be defined through the rotationTurns parameter. The default value is 0, corresponding to 0 degrees of rotation. Making the value larger by 1 will rotate the image 90 degrees clockwise, making it smaller will rotate the image 90 degrees counterclockwise. 0 to 4 is not a limit, so going above or below these values will keep rotating the image.

Example
// Import package
import 'package:cropperx/cropper.dart';

// Define a key
final _cropperKey = GlobalKey(debugLabel: 'cropperKey');

// Add the Cropper widget to your tree, using the above key and adding the image to crop
Cropper(
    cropperKey: _cropperKey, // Use your key here
    image: Image.network(
        'https://i.pinimg.com/originals/6b/4d/18/6b4d18c0b756ab20c3591490dfc10090.jpg',
    ),
)

// Get the cropped image as bytes
final imageBytes = await Cropper.crop(
    cropperKey: _cropperKey, // Reference it through the key
)

所属分类

源码仓库

使用此插件的项目

暂无相关数据。