|
|
|
@ -405,7 +405,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
if (user.id == parameters![1] && parameters[0] == true) {
|
|
|
|
|
user.isTyping = parameters[0] as bool?;
|
|
|
|
|
Future.delayed(
|
|
|
|
|
const Duration(seconds: 1),
|
|
|
|
|
const Duration(seconds: 2),
|
|
|
|
|
() {
|
|
|
|
|
user.isTyping = false;
|
|
|
|
|
notifyListeners();
|
|
|
|
@ -839,12 +839,15 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> getChatMedia({required String fileName, required String fileTypeName, required int fileTypeID}) async {
|
|
|
|
|
Future<void> getChatMedia(BuildContext context, {required String fileName, required String fileTypeName, required int fileTypeID}) async {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
if (fileTypeID == 1 || fileTypeID == 5 || fileTypeID == 7 || fileTypeID == 6 || fileTypeID == 8 || fileTypeID == 2) {
|
|
|
|
|
Uint8List encodedString = await ChatApiClient().downloadURL(fileName: fileName, fileTypeDescription: getFileTypeDescription(fileTypeName));
|
|
|
|
|
try {
|
|
|
|
|
String path = await downChatMedia(encodedString, fileTypeName ?? "");
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
OpenFile.open(path);
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
Utils.showToast("Cannot open file.");
|
|
|
|
|
}
|
|
|
|
|