get method Null safety

Future<Uint8List> get(
  1. String path,
  2. {String? versionId}
)

Implementation

Future<Uint8List> get(String path, {String? versionId}) async {
  if (path.startsWith('/')) path = path.replaceFirst('/', '');
  http.Response rsp = await http.get(_bucketUri.replace(
    path: path,
    query: versionId != null ? 'versionId=$versionId' : null,
  ));
  if (rsp.statusCode == 200) {
    return rsp.bodyBytes;
  } else {
    throw HttpException('HTTP Error ${rsp.statusCode}: ${rsp.body}');
  }
}