isFileDownload method

bool isFileDownload()

Implementation

bool isFileDownload() {
  if (attachment is NIMMessageFileAttachment) {
    final filePath = (attachment as NIMMessageFileAttachment).path;
    Alog.d(
        tag: 'ChatKit',
        moduleName: 'MessageExt',
        content: 'is File downloaded -->> path:$filePath');

    if (filePath?.isNotEmpty != true) {
      return false;
    }
    File file = File(filePath!);
    if (file.existsSync()) {
      return true;
    }
  }
  return false;
}