Answers for "how to reduce the size of asset image in flutter"

3

resize image asset flutter

Image.asset(    'assets/images/file-name.jpg',    height: 100,    width: 100, )
Posted by: Guest on November-14-2020
0

flutter - resize asset image to dart ui image

Future<ui.Image> getUiImage(String imageAssetPath, int height, int width) async {
  final ByteData assetImageByteData = await rootBundle.load(imageAssetPath);
  final codec = await ui.instantiateImageCodec(
    assetImageByteData.buffer.asUint8List(),
    targetHeight: height,
    targetWidth: width,
  );
  final image = (await codec.getNextFrame()).image;
}
Posted by: Guest on January-12-2022

Code answers related to "how to reduce the size of asset image in flutter"

Browse Popular Code Answers by Language