service: Allow sending multiple files

This commit is contained in:
2022-07-24 14:38:13 +02:00
parent 0acd812a60
commit 660c56e27a
4 changed files with 93 additions and 69 deletions

View File

@@ -290,12 +290,12 @@ class ConversationBloc extends Bloc<ConversationEvent, ConversationState> {
}
Future<void> _onFileUploadRequested(FileUploadRequestedEvent event, Emitter<ConversationState> emit) async {
final result = await FilePicker.platform.pickFiles(type: FileType.image);
final result = await FilePicker.platform.pickFiles(type: FileType.image, allowMultiple: true);
if (result != null) {
await MoxplatformPlugin.handler.getDataSender().sendData(
SendFileCommand(
path: result.files.single.path!,
SendFilesCommand(
paths: result.files.map((PlatformFile file) => file.path!).toList(),
jid: state.conversation!.jid,
),
awaitable: false,