https://github.com/jayeshpansheriya/image_picker_type
A Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures with the camera or gallery and crop it.
https://github.com/jayeshpansheriya/image_picker_type
camera crop-image flutter flutter-camera flutter-package image-picker image-picker-lib image-picker-library
Last synced: about 1 month ago
JSON representation
A Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures with the camera or gallery and crop it.
- Host: GitHub
- URL: https://github.com/jayeshpansheriya/image_picker_type
- Owner: jayeshpansheriya
- License: mit
- Created: 2020-07-18T04:23:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-12T09:29:20.000Z (over 2 years ago)
- Last Synced: 2025-03-28T13:21:20.446Z (about 2 months ago)
- Topics: camera, crop-image, flutter, flutter-camera, flutter-package, image-picker, image-picker-lib, image-picker-library
- Language: Dart
- Homepage: https://pub.dev/packages/image_picker_type
- Size: 3.09 MB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# image_picker_type plugin for Flutter
A Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures with the camera or gallery and crop it.
## Features
- [X] iOS Support
- [X] Android Support
- [X] Web Support## Installation
First, add `image_picker_type`.
### iOS
Add the following keys to your _Info.plist_ file, located in `/ios/Runner/Info.plist`:
* `NSPhotoLibraryUsageDescription` - describe why your app needs permission for the photo library. This is called _Privacy - Photo Library Usage Description_ in the visual editor.
* `NSCameraUsageDescription` - describe why your app needs access to the camera. This is called _Privacy - Camera Usage Description_ in the visual editor.
* `NSMicrophoneUsageDescription` - describe why your app needs access to the microphone, if you intend to record videos. This is called _Privacy - Microphone Usage Description_ in the visual editor.### Android
- Add UCropActivity into your AndroidManifest.xml
````xml
````
#### Note:
From v1.2.0, you need to migrate your android project to v2 embedding ([detail](https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects))#### API 29+
No configuration required - the plugin should work out of the box.#### API < 29
Add `android:requestLegacyExternalStorage="true"` as an attribute to the `` tag in AndroidManifest.xml. The [attribute](https://developer.android.com/training/data-storage/compatibility) is `false` by default on apps targeting Android Q.
### Web
- Add following codes inside `` tag in file `web/index.html`:```html
....
....
```
### Example
``` dart
// show bottom sheet to select image option
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return ImagePickerHelper(
size: Size(300, 300),
onDone: (file) {
if (file == null) {
print(null);
} else {
setState(() {
File file = file;
});
}
},
);
});
```
## Getting StartedThis project is a starting point for a Dart
[package](https://flutter.dev/developing-packages/),
a library module containing code that can be shared easily across
multiple Flutter or Dart projects.For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.