Created
March 25, 2021 22:44
-
-
Save jtmuller5/bfb6a9c33ddff75cbc551742a7321181 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@injectable | |
class MediaService { | |
final picker = ImagePicker(); | |
/// Select an image from the user's device | |
Future<File> selectImage({ImageSource source = ImageSource.gallery}) 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