uploadImage method

  1. @override
Future<String> uploadImage(
  1. String filePath,
  2. String fileName
)
override

Uploads filePath as a chat image attachment and returns its public URL.

Implementation

@override
Future<String> uploadImage(String filePath, String fileName) async {
  final file = await _storage.createFile(
    bucketId: bucketId,
    fileId: ID.unique(),
    file: InputFile.fromPath(path: filePath, filename: fileName),
  );
  return '$endpoint/storage/buckets/$bucketId/files/${file.$id}/view?project=$projectId';
}