{"id":22050152,"url":"https://github.com/icapps/flutter-custom-image-crop","last_synced_at":"2025-07-14T09:39:33.949Z","repository":{"id":42994813,"uuid":"339122770","full_name":"icapps/flutter-custom-image-crop","owner":"icapps","description":"A flutter package to support a customizable image cropper.","archived":false,"fork":false,"pushed_at":"2024-12-30T16:25:00.000Z","size":7451,"stargazers_count":45,"open_issues_count":9,"forks_count":41,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-25T22:03:41.690Z","etag":null,"topics":["crop","customizable","image-cropper"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icapps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-15T15:36:20.000Z","updated_at":"2025-03-08T23:23:21.000Z","dependencies_parsed_at":"2022-09-06T02:50:13.268Z","dependency_job_id":"99acbe9a-d171-45fd-a625-6163d3203dce","html_url":"https://github.com/icapps/flutter-custom-image-crop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/icapps/flutter-custom-image-crop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Fflutter-custom-image-crop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Fflutter-custom-image-crop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Fflutter-custom-image-crop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Fflutter-custom-image-crop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icapps","download_url":"https://codeload.github.com/icapps/flutter-custom-image-crop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Fflutter-custom-image-crop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265271133,"owners_count":23738151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crop","customizable","image-cropper"],"created_at":"2024-11-30T14:18:02.767Z","updated_at":"2025-07-14T09:39:33.884Z","avatar_url":"https://github.com/icapps.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# custom_image_crop\n\nAn Image cropper that is customizable\n\n[![pub package](https://img.shields.io/pub/v/custom_image_crop.svg)](https://pub.dartlang.org/packages/custom_image_crop)\n[![Build Status](https://app.travis-ci.com/icapps/flutter-custom-image-crop.svg?branch=main)](https://app.travis-ci.com/icapps/flutter-custom-image-crop)\n[![Coverage Status](https://coveralls.io/repos/github/icapps/flutter-custom-image-crop/badge.svg?branch=main)](https://coveralls.io/github/icapps/flutter-custom-image-crop?branch=main)\n[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)\n\n\u003cimg src=\"https://github.com/icapps/flutter-custom-image-crop/blob/main/example/screenshots/customimagecrop.gif?raw=true\" alt=\"customcropcircle\" height=\"320\"/\u003e \u003cimg src=\"https://github.com/icapps/flutter-custom-image-crop/blob/main/example/screenshots/customcropsquare.png?raw=true\" alt=\"customcropsquare\" height=\"320\"/\u003e \u003cimg src=\"https://github.com/icapps/flutter-custom-image-crop/blob/main/example/screenshots/customcropcircle.png?raw=true\" alt=\"customcropcircle\" height=\"320\"/\u003e\n\n# CustomImageCrop\n\n```dart\nCustomImageCrop(\n  cropController: controller,\n  image: const AssetImage('assets/test.png'),\n),\n```\n\nYou can provide the image using any Imageprovider.\n\n## Parameters\n\n### required image\n\nThe image that needs to be cropped\n\n### cropController\n\nThe controller used to adjust the image and crop it.\n\n### overlayColor\n\nThe color above the image that will be cropped\n\n### backgroundColor\n\nThe color behind the image. This color will also be used when there are gaps/empty space after the cropping\n\n### shape\n\nThe shape of the cropping path.\n\n### maskShape\n\nThe shape of the UI masking.\n\n### cropPercentage\n\nHow big the crop should be in regards to the width and height available to the cropping widget.\n\n### drawPath\n\nHow the border of the crop should be painted. default DottedCropPathPainter.drawPath and SolidCropPathPainter.drawPath are provided, but you can create/provide any CustomPaint.\n\n### pathPaint\nCustom painting for the crop area border style.\n\n### canRotate\n\nWhether to allow the image to be rotated.\n\n### customProgressIndicator\n\nCustom widget for progress indicator.\n\n### ratio\n\nRatio of the cropping area.\nIf ` shape`` is set to  `CustomCropShape.Ratio`, this property is required.\nFor example, to create a square crop area, use `[`Ratio(width: 1, height: 1)`.\nTo create a rectangular crop area with a 16:9 aspect ratio, use `[`Ratio(width: 16, height: 9)`.\n\n### borderRadius\nThe radius for rounded corners of the cropping area.\n\n### forceInsideCropArea\nWhether image area must cover clip path.\n\n\n# Controller Methods\n\n## addTransition\n\n`void addTransition(CropImageData transition)`\n\nAdd the position, angle and scale to the current state. This can be used to adjust the image with sliders, buttons, etc.\n\n## setData\n\n`void setData(CropImageData data)`\n\nSet the position, angle and scale to the specified values. This can be used to center the image by pressing a button for example.\n\n## reset\n\n`void reset()`\n\nReset the image to its default state\n\n## onCropImage\n\n`Future\u003cMemoryImage\u003e onCropImage()`\n\nCrops the image in its current state, this will return a MemoryImage that contains the cropped image\n\n# Example\n\nSee example/lib\n\n```dart\nclass MyHomePage extends StatefulWidget {\n  final String title;\n\n  MyHomePage({\n    required this.title,\n    Key? key,\n  }) : super(key: key);\n\n  @override\n  _MyHomePageState createState() =\u003e _MyHomePageState();\n}\n\nclass _MyHomePageState extends State\u003cMyHomePage\u003e {\n  late CustomImageCropController controller;\n\n  @override\n  void initState() {\n    super.initState();\n    controller = CustomImageCropController();\n  }\n\n  @override\n  void dispose() {\n    controller.dispose();\n    super.dispose();\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text(widget.title),\n        brightness: Brightness.dark,\n      ),\n      body: Column(\n        children: [\n          Expanded(\n            child: CustomImageCrop(\n              cropController: controller,\n              image: const AssetImage('assets/test.png'), // Any Imageprovider will work, try with a NetworkImage for example...\n            ),\n          ),\n          Row(\n            children: [\n              IconButton(icon: const Icon(Icons.refresh), onPressed: controller.reset),\n              IconButton(icon: const Icon(Icons.zoom_in), onPressed: () =\u003e controller.addTransition(CropImageData(scale: 1.33))),\n              IconButton(icon: const Icon(Icons.zoom_out), onPressed: () =\u003e controller.addTransition(CropImageData(scale: 0.75))),\n              IconButton(icon: const Icon(Icons.rotate_left), onPressed: () =\u003e controller.addTransition(CropImageData(angle: -pi / 4))),\n              IconButton(icon: const Icon(Icons.rotate_right), onPressed: () =\u003e controller.addTransition(CropImageData(angle: pi / 4))),\n              IconButton(\n                icon: const Icon(Icons.crop),\n                onPressed: () async {\n                  final image = await controller.onCropImage();\n                  if (image != null) {\n                    Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) =\u003e ResultScreen(image: image)));\n                  }\n                },\n              ),\n            ],\n          ),\n          SizedBox(height: MediaQuery.of(context).padding.bottom),\n        ],\n      ),\n    );\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficapps%2Fflutter-custom-image-crop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficapps%2Fflutter-custom-image-crop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficapps%2Fflutter-custom-image-crop/lists"}