Im trying to resize an image from a URL using the image package from Dart. I keep on getting what seems to be a conflict and I can't figure out how to resolve it to resize the image. Any help is greatly appreciated.
Warning:
The argument type 'image' (where image is defined in .../ui/painting.dart) cant be assigned to the parameter type 'Image' (where image is defined in .... /src/image.dart)
import 'dart:io';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/services.dart';
import 'package:esys_flutter_share/esys_flutter_share.dart';
import 'package:image/image.dart' as newimage;
_resizeImage() async{
var uri = Uri.parse([IMAGE_URL]);
var httpClient = HttpClient();
var request = await httpClient.getUrl(uri);
var response = await request.close();
var imageData = <int>[];
await response.forEach((data) async {
imageData.addAll(data);
});
print(imageData.length);
ui.Image myimage =
await decodeImageFromList(Uint8List.fromList(imageData));
//TRYING TO RESIZE IMAGE WHERE CONFLICT OCCURS ON myimage
newimage.Image thumbnail = newimage.copyResize(myimage, width: 500, height: 500);
}