Skip to content

Instantly share code, notes, and snippets.

Created March 25, 2021 22:44
What would you like to do?
class MediaService {
final picker = ImagePicker();
/// Select an image from the user's device
Future<File> selectImage({ImageSource source =}) async {
final pickedFile = await picker.getImage(source: source);
if(pickedFile!= null) {
return File(pickedFile.path);
} else {
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment