{"id":17325267,"url":"https://github.com/legoffmael/insta_assets_picker","last_synced_at":"2025-04-14T16:56:08.646Z","repository":{"id":65142472,"uuid":"577645452","full_name":"LeGoffMael/insta_assets_picker","owner":"LeGoffMael","description":"An image (and videos) picker similar with Instagram, supports multi picking, crop and aspect ratio.","archived":false,"fork":false,"pushed_at":"2024-09-26T02:18:35.000Z","size":10508,"stargazers_count":92,"open_issues_count":5,"forks_count":58,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-25T11:03:00.378Z","etag":null,"topics":["crop","crop-image","dart","flutter","instagram","multiple-assets","photomanager","picker"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/insta_assets_picker","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/LeGoffMael.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":"2022-12-13T07:50:49.000Z","updated_at":"2025-02-26T05:13:43.000Z","dependencies_parsed_at":"2022-12-31T21:40:25.508Z","dependency_job_id":"5f6837f0-7034-456b-8317-202013320ed5","html_url":"https://github.com/LeGoffMael/insta_assets_picker","commit_stats":{"total_commits":115,"total_committers":3,"mean_commits":"38.333333333333336","dds":"0.017391304347826098","last_synced_commit":"dea1350751198a34b71b2a66e52bb0a25d9708e6"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeGoffMael%2Finsta_assets_picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeGoffMael%2Finsta_assets_picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeGoffMael%2Finsta_assets_picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeGoffMael%2Finsta_assets_picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeGoffMael","download_url":"https://codeload.github.com/LeGoffMael/insta_assets_picker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248923649,"owners_count":21183949,"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","crop-image","dart","flutter","instagram","multiple-assets","photomanager","picker"],"created_at":"2024-10-15T14:12:49.491Z","updated_at":"2025-04-14T16:56:08.639Z","avatar_url":"https://github.com/LeGoffMael.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eInstagram Assets Picker\u003c/h1\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pub.dev/packages/insta_assets_picker\"\u003e\n    \u003cimg src=\"https://img.shields.io/pub/v/insta_assets_picker.svg\" alt=\"Pub\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pub.dev/packages/flutter_lints\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/style-flutter__lints-40c4ff.svg\" alt=\"Flutter lints\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://gitmoji.dev\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg\" alt=\"Gitmoji\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n\nAn image (also with videos) picker based on Instagram picker UI. It is using the powerful [flutter_wechat_assets_picker](https://pub.dev/packages/wechat_assets_picker)\npackage to handle the picker and a custom version of [image_crop](https://pub.dev/packages/image_crop) for crop.\n\n## 🚀 Features\n\n- ✅ Instagram layout\n    - Scroll behaviors, animation\n    - Preview, select, unselect action logic\n- ✅ Image and Video ([but not video processing](#video)) support\n- ✅ Theme and language customization\n- ✅ Multiple assets pick (with maximum limit)\n- ✅ Single asset pick mode\n- ✅ Restore state of picker after pop\n- ✅ Select aspect ratios to crop all assets with (default to 1:1 \u0026 4:5)\n- ✅ Crop all image assets at once and receive a stream with a progress value\n- ✅ Prepend or append a custom item in the assets list\n- ✅ Add custom action buttons\n\n## 📸 Screenshots\n\n| Layout and scroll                   | Crop                                     |\n| ----------------------------------- | ---------------------------------------- |\n| ![](https://raw.githubusercontent.com/LeGoffMael/insta_assets_picker/main/example/screenshots/scroll.webp) | ![](https://raw.githubusercontent.com/LeGoffMael/insta_assets_picker/main/example/screenshots/crop-export.webp) |\n\n## 📖 Installation\n\nAdd this package to the `pubspec.yaml`\n\n```yaml\ninsta_assets_picker: ^3.2.0\n```\n\n### ‼️ DO NOT SKIP THIS PART\n\nSince this package is a custom delegate of `flutter_wechat_assets_picker` you **MUST** follow this package setup recommendation : [installation guide](https://pub.dev/packages/wechat_assets_picker#preparing-for-use-).\n\n## 👀 Usage\n\nFor more details check out the [example](https://github.com/LeGoffMael/insta_assets_picker/blob/main/example/lib/main.dart).\n\n```dart\nFuture\u003cList\u003cAssetEntity\u003e?\u003e callPicker() =\u003e InstaAssetPicker.pickAssets(\n    context,\n    pickerConfig: InstaAssetPickerConfig(\n      title: 'Select assets',\n    ),\n    maxAssets: 10,\n    onCompleted: (Stream\u003cInstaAssetsExportDetails\u003e stream) {\n        // TODO : handle crop stream result\n        // i.e : display it using a StreamBuilder\n        // - in the same page (closeOnComplete=true)\n        // - send it to another page (closeOnComplete=false)\n        // or use `stream.listen` to handle the data manually in your state manager\n        // - ...\n    },\n);\n```\n\nFields in `InstaAssetsExportDetails`:\n\n| Name           | Type                          | Description                                             |\n| -------------- | ----------------------------- | --------------------------------------------------------------------- |\n| data           | `List\u003cInstaAssetsExportData\u003e` | Contains the selected assets, crop parameters and possible crop file. |\n| selectedAssets | `List\u003cAssetEntity\u003e`           | Selected assets without crop                            |\n| aspectRatio    | `double`                      | Selected aspect ratio (1 or 4/5)                        |\n| progress       | `double`                      | Progress indicator of the exportation (between 0 and 1) |\n\nFields in `InstaAssetsExportData`:\n\n| Name         | Type                  | Description                                                        |\n| ------------ | --------------------- | ------------------------------------------------------------------ |\n| croppedFile  | `File?`               | The cropped file. Can be null if video or if choose to skip crop.  |\n| selectedData | `InstaAssetsCropData` | The selected asset and it's crop parameter (area, scale, ratio...) |\n\n### Picker configuration\n\nPlease follow `flutter_wechat_assets_picker` documentation : [AssetPickerConfig](https://pub.dev/packages/wechat_assets_picker#usage-)\n\n### Localizations\n\nPlease follow `flutter_wechat_assets_picker` documentation : [Localizations](https://pub.dev/packages/wechat_assets_picker#localizations)\n\n### Theme customization\n\nMost of the components of the picker can be customized using theme.\n\n```dart\n// set picker theme based on app theme primary color\nfinal theme = InstaAssetPicker.themeData(Theme.of(context).primaryColor);\nInstaAssetPicker.pickAssets(\n    context,\n    pickerConfig: InstaAssetPickerConfig(\n      pickerTheme: theme.copyWith(\n        canvasColor: Colors.black, // body background color\n        splashColor: Color.grey, // ontap splash color\n        colorScheme: theme.colorScheme.copyWith(\n          background: Colors.black87, // albums list background color\n        ),\n        appBarTheme: theme.appBarTheme.copyWith(\n          backgroundColor: Colors.black, // app bar background color\n          titleTextStyle: Theme.of(context)\n              .appBarTheme\n              .titleTextStyle\n              ?.copyWith(color: Colors.white), // change app bar title text style to be like app theme\n        ),\n        // edit `confirm` button style\n        textButtonTheme: TextButtonThemeData(\n          style: TextButton.styleFrom(\n            foregroundColor: Colors.blue,\n            disabledForegroundColor: Colors.red,\n          ),\n        ),\n      ),\n    ),\n    onCompleted: (_) {},\n);\n```\n\n### Crop customization\n\nYou can set the list of crop aspect ratios available.\nYou can also set the preferred size, for the cropped assets.\n\n```dart\nInstaAssetPicker.pickAssets(\n    context,\n    pickerConfig: InstaAssetPickerConfig(\n      cropDelegate: InstaAssetCropDelegate(\n        // allows you to set the preferred size used when cropping the asset.\n        // the final size will depends on the scale used when cropping.\n        preferredSize: 1080,\n        cropRatios: [\n        // - allow you to set the list of aspect ratios selectable,\n        // the default values are [1/1, 4/5] like instagram.\n        // - if you want to disable cropping, you can set only one parameter,\n        // in this case, the \"crop\" button will not be displayed (#10).\n        // - if the value of cropRatios is different than the default value,\n        // the \"crop\" button will display the selected ratio value (i.e.: 1:1)\n        // instead of unfold arrows.\n      ]),\n    ),\n    onCompleted: (_) {},\n);\n```\n\n### Camera\n\nMany people requested the ability to take picture from the picker.\nThe main aspect of this package is selection and uniform crop selection.\nConsequently, camera-related operations have no place in this package. \nHowever, since version `2.0.0`, it is now possible to trigger this action using either `specialItemBuilder` and/or `actionsBuilder`.\n\nThe ability to take a photo from the camera must be handled on your side, but the picker is now able to refresh the list and select the new photo.\nNew [examples](https://github.com/LeGoffMael/insta_assets_picker/tree/main/example/lib/pages/camera) have been written to show how to manage this process with the [camera](https://pub.dev/packages/camera) or [wechat_camera_picker](https://pub.dev/packages/wechat_camera_picker) package.\n\n### Video\n\nVideo are now supported on version `3.0.0`. You can pick a video asset and select the crop area directly in the picker.\nHowever, as video processing is a heavy operation it is not handled by this package.\nWhich means you must handle it yourself. If you want to preview the video result, you can use the `InstaAssetCropTransform` which will transform the Image or VideoPlayer to fit the selected crop area.\n\nThe example app has been updated to support videos (+ camera recording) and shows [how to process the video](https://github.com/LeGoffMael/insta_assets_picker/tree/main/example/lib/post_provider.dart#L84) using the now retired [ffmpeg_kit_flutter](https://pub.dev/packages/ffmpeg_kit_flutter).\n\n## ✨ Credit\n\nThis package is based on [flutter_wechat_assets_picker](https://pub.dev/packages/wechat_assets_picker) by [AlexV525](https://github.com/AlexV525) and [image_crop](https://pub.dev/packages/image_crop) by [lykhonis](https://github.com/lykhonis).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flegoffmael%2Finsta_assets_picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flegoffmael%2Finsta_assets_picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flegoffmael%2Finsta_assets_picker/lists"}