Skip to main content

chat_media_picker 0.2.2 copy "chat_media_picker: ^0.2.2" to clipboard
chat_media_picker: ^0.2.2 copied to clipboard

Chat attachment picker: draggable sheet with gallery, camera and file picker, plus an editor with crop, draw, text and captions.

chat_media_picker #

Chat attachment picker for Flutter (GetX): a draggable sheet with gallery, camera and file options, plus a photo editor (crop, rotate, draw, text, captions).

Attach panel Gallery Editor Dark theme

Install #

flutter pub add chat_media_picker get

Android, and iOS 14.0+. The app must use GetMaterialApp.

Usage #

final media = await ChatMediaPicker.openGallery(); // attachment sheet
final shots = await ChatMediaPicker.openCamera();  // camera screen

for (final m in media ?? <PickedMedia>[]) {
  m.file; m.caption; m.isVideo; m.isFile; m.fileName;
}

Both return null when the user closes the picker.

Options #

ChatMediaPicker.config = const ChatMediaPickerConfig(
  maxSelection: 10,
  enableGallery: true,
  enableCamera: true,
  enableFilePicker: true,
  allowedFileExtensions: null, // e.g. ['pdf']
  showCloseButton: true,
  theme: ChatMediaPickerTheme(), // or ChatMediaPickerTheme.dark()
);

Use ChatMediaPickerTheme().copyWith(...) to change individual colours.

Platform setup #

Android (AndroidManifest.xml):

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
<uses-feature android:name="android.hardware.camera" android:required="false" />

iOS (platform :ios, '14.0' in the Podfile, and Info.plist):

<key>NSCameraUsageDescription</key>
<string>Take photos to share in the chat.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Required by the camera plugin.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Pick photos and videos to share.</string>
<key>PHPhotoLibraryPreventAutomaticLimitedAccessAlert</key>
<true/>
2
likes
160
points
461
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Chat attachment picker: draggable sheet with gallery, camera and file picker, plus an editor with crop, draw, text and captions.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

camera, file_picker, flutter, get, path_provider, photo_manager, video_player

More

Packages that depend on chat_media_picker