media_picker_widget library

Classes

Media
This class will contain the necessary data of selected media
MediaPicker
The MediaPicker widget that will select media files form storage
PickerDecoration
PickerDecoration is used for decorating the UI

Enums

ActionBarPosition
position of action bar of media picker
MediaCount
make picker to select multiple or single media file
MediaType
Media picker selection type

Functions

openCamera({required ValueChanged<Media> onCapture}) → void
call this function to capture and get media from camera

Typedefs

HeaderBuilder = dynamic Function(BuildContext context, Widget albumSelector, VoidCallback completeSelection, VoidCallback onBack)
HeaderBuilder is used to build custom header for picker context is the BuildContext of picker header albumSelector is the widget that will show the album selector, you can use it to show album selector in your custom header. Use PickerDecoration to customize it. completeSelection is called when selection is done. If you want a button for user to confirm selection, you can use it. It will trigger MediaPicker.onPicked callback. Note: If MediaPicker's media count is MediaCount.single, It won't ask for confirmation. onBack is the callback when user press back button. It will close album selector if it is open. Else your MediaPicker.onCancel callback will be called.