getFile method

Future<File> getFile({
  1. required String bucketId,
  2. required String fileId,
})

Get File

Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.

Implementation

Future<models.File> getFile(
    {required String bucketId, required String fileId}) async {
  final String path = '/storage/buckets/{bucketId}/files/{fileId}'
      .replaceAll('{bucketId}', bucketId)
      .replaceAll('{fileId}', fileId);

  final Map<String, dynamic> params = {};

  final Map<String, String> headers = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.get,
      path: path, params: params, headers: headers);

  return models.File.fromMap(res.data);
}