getLocalImageWidth(String path){
int width;
Completer<int> completer = new Completer<int>();
Image image = Image.file(File.fromUri(Uri.parse(path)));
image.image.resolve(new ImageConfiguration()).addListener(
new ImageStreamListener((ImageInfo info, bool _) {
width = info.image.width;
print('height===$width');
completer.complete(width);
}));
return completer.future;
}
getLocalImageHeight(String path){
int height;
Completer<int> completer = new Completer<int>();
Image image = Image.file(File.fromUri(Uri.parse(path)));
image.image.resolve(new ImageConfiguration()).addListener(
new ImageStreamListener((ImageInfo info, bool _) {
height = info.image.height;
print('height===$height');
completer.complete(height);
}));
return completer.future;
}
int originalWidth,originalHeight;
originalWidth = await Utils().getLocalImageWidth(imagePath);
originalHeight = await Utils().getLocalImageHeight(imagePath);