Created
October 6, 2019 18:38
-
-
Save adityadroid/64fd2e1379d85b8b8bcd626d0a8de30c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| showFilePicker(FileType fileType) async { | |
| File file; | |
| if (fileType == FileType.IMAGE && SharedObjects.prefs.getBool(Constants.configImageCompression)) | |
| file = await ImagePicker.pickImage( | |
| source: ImageSource.gallery, imageQuality: 70); | |
| else | |
| file = await FilePicker.getFile(type: fileType); | |
| if (file == null) return; | |
| chatBloc.dispatch(SendAttachmentEvent(chat.chatId, file, fileType)); | |
| Navigator.pop(context); | |
| GradientSnackBar.showMessage(context, 'Sending attachment..'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment