flutter custompaint image
import 'dart:ui' as ui show Image;
// Draw Class
class MyCustomPainter extends CustomPainter {
final ui.Image myBackground;
const MyCustomPainter(this.myBackground);
@override
void paint(Canvas canvas, Size size) {
canvas.drawImage(myBackground, Offset.zero, Paint());
}
}
// Useses
Future<ui.Image> myBackground = await decodeImageFromList(imageFile.readAsBytes());