Flutter consolidateHttpClientResponseBytes 未定义错误?

Flutter consolidateHttpClientResponseBytes not defined error?

我正在尝试解析 url 图像,以便将其转换为 Uint8 字节并在我的共享提供商之间共享。尝试将我的 http 响应合并为字节时,我的 class 收到以下错误 The method 'consolidateHttpClientResponseBytes' isn't defined。这是我正在尝试使用的代码..... 请帮忙!

 Future<Null> shareImage() async{
    var request = await HttpClient().getUrl(Uri.parse('network_image_url'));
    var response = await request.close();
    Uint8List bytes = await consolidateHttpClientResponseBytes(response);
  }

导入这个:

import 'dart:typed_data';
import 'package:flutter/foundation.dart';
import 'package:path_provider/path_provider.dart';

而且你应该很好