1

I'm trying to parse a url image in order to turn it into Uint8 bytes and share across my share provider. When trying to consolidate my http response into bytes I get the following error The method 'consolidateHttpClientResponseBytes' isn't defined by my class. Here is the code I'm trying to use..... Please help!

 Future<Null> shareImage() async{
    var request = await HttpClient().getUrl(Uri.parse('network_image_url'));
    var response = await request.close();
    Uint8List bytes = await consolidateHttpClientResponseBytes(response);
  }
Charles Jr
  • 8,333
  • 15
  • 53
  • 74

1 Answers1

3

Import this :

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

And you should be good

idurvesh
  • 644
  • 1
  • 7
  • 19