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);
return Image.file(imageFile,
width: 200.w,
height: 200.w,
fit: BoxFit.fill,
frameBuilder: (context, child, frame, wasSynchronouslyLoaded){
if(wasSynchronouslyLoaded){
return child;
}
return AnimatedOpacity(
child: child,
opacity: frame == null ? 0 : 1,
duration: const Duration(seconds: 4),
curve: Curves.easeOut,
);
}),
return Image.memory(imageUint8List);
Image.memory(Base64Decoder().convert(slideImageBase64)));