fake_image_picker library

A ready-to-use fake for the Flutter image_picker plugin.

Add fake_image_picker to your dev_dependencies, call FakeImagePicker.register() in setUp, and control exactly what your tests receive from the image picker.

Classes

CustomFakeDataSource
A data source where every response is supplied by the test author.
EmptyFakeDataSource
A data source that always simulates cancellation.
FakeImagePicker
A drop-in test replacement for the ImagePicker facade.
FakeImagePickerBehavior
Configurable runtime behavior of the fake picker.
FakeImagePickerConfiguration
Immutable configuration for FakeImagePickerPlatform.
FakeImagePickerDataSource
The source of synthetic files used by FakeImagePickerPlatform.
FakeImagePickerPlatform
A fully functional fake implementation of ImagePickerPlatform.
FakePlatformConstraints
Describes what a simulated platform is capable of.
ImageOptions
Specifies image-specific options for picking.
ImagePickerCameraDelegate
A delegate for ImagePickerPlatform implementations that do not provide a camera implementation, or that have a default but allow substituting an alternate implementation.
ImagePickerCameraDelegateOptions
Options for ImagePickerCameraDelegate methods.
ImagePickerOptions
Specifies options for picking a single image from the device's camera or gallery.
ImagePickerPlatform
The interface that implementations of image_picker must implement.
LostData
The response object of ImagePicker.retrieveLostData.
LostDataResponse
The response object of ImagePicker.getLostData.
MediaOptions
Specifies options for selecting items when using ImagePickerPlatform.getMedia.
MultiImagePickerOptions
Specifies options for picking multiple images from the device's gallery.
MultiVideoPickerOptions
Specifies options for picking multiple videos.
PickedFile
A PickedFile is a cross-platform, simplified File abstraction.
PredefinedFakeDataSource
A deterministic data source that returns synthetic images and videos.
RandomFakeDataSource
A data source that returns randomized fake files on every call.
XFile
A CrossFile is a cross-platform, simplified File abstraction.
XFileFactory
Helpers shared by data source implementations.

Enums

CameraDevice
Which camera to use when picking images/videos while source is ImageSource.camera.
FakePlatform
Known platforms that FakeImagePickerPlatform can simulate.
ImageSource
Specifies the source where the picked image should come from.
MediaSelectionType
The type of media to allow the user to select with ImagePickerPlatform.getMedia.
RetrieveType
The type of the retrieved data in a LostDataResponse.

Extensions

FakePlatformConstraintsResolver on FakePlatform
Convenience extension to resolve a FakePlatform to its constraints.

Constants

kTypeImage → const String
Denotes that an image is being picked.
kTypeMedia → const String
Denotes that either a video or image is being picked.
kTypeVideo → const String
Denotes that a video is being picked.