Fixed numerous bugs within talk and file upload
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:loader_overlay/loader_overlay.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@ -8,6 +9,7 @@ import '../../../api/marianumcloud/files-sharing/fileSharingApi.dart';
|
||||
import '../../../api/marianumcloud/files-sharing/fileSharingApiParams.dart';
|
||||
import '../../../api/marianumcloud/talk/sendMessage/sendMessage.dart';
|
||||
import '../../../api/marianumcloud/talk/sendMessage/sendMessageParams.dart';
|
||||
import '../../../api/marianumcloud/webdav/webdavApi.dart';
|
||||
import '../../../model/chatList/chatProps.dart';
|
||||
import '../../../widget/filePick.dart';
|
||||
import '../files/fileUploadDialog.dart';
|
||||
@ -38,6 +40,10 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
|
||||
String filename = "${path.split("/").last.split(".").first}-${const Uuid().v4()}.${path.split(".").last}";
|
||||
String shareFolder = "MarianumMobile";
|
||||
WebdavApi.webdav.then((webdav) {
|
||||
webdav.mkcol("/$shareFolder");
|
||||
});
|
||||
|
||||
showDialog(context: context, builder: (context) => FileUploadDialog(
|
||||
doShowFinish: false,
|
||||
fileName: filename,
|
||||
@ -45,9 +51,9 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
remotePath: [shareFolder],
|
||||
onUploadFinished: () {
|
||||
FileSharingApi().share(FileSharingApiParams(
|
||||
shareType: 10,
|
||||
shareWith: widget.sendToToken,
|
||||
path: "$shareFolder/$filename",
|
||||
shareType: 10,
|
||||
shareWith: widget.sendToToken,
|
||||
path: "$shareFolder/$filename",
|
||||
)).then((value) => _query());
|
||||
},
|
||||
), barrierDismissible: false);
|
||||
@ -81,16 +87,19 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.image),
|
||||
title: const Text("Aus Gallerie auswählen"),
|
||||
onTap: () {
|
||||
context.loaderOverlay.show();
|
||||
FilePick.galleryPick().then((value) {
|
||||
mediaUpload(value?.path);
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
Visibility(
|
||||
visible: !Platform.isIOS,
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.image),
|
||||
title: const Text("Aus Gallerie auswählen"),
|
||||
onTap: () {
|
||||
context.loaderOverlay.show();
|
||||
FilePick.galleryPick().then((value) {
|
||||
mediaUpload(value?.path);
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
Reference in New Issue
Block a user