getData method

Future<Image> getData()

Implementation

Future<ui.Image> getData() {
  var recorder = ui.PictureRecorder();
  var origin = Offset(0.0, 0.0);
  var paintBounds = Rect.fromPoints(_lastSize.topLeft(origin), _lastSize.bottomRight(origin));
  var canvas = Canvas(recorder, paintBounds);
  if (widget.backgroundPainter != null) {
    widget.backgroundPainter!.paint(canvas, _lastSize);
  }
  _painter!.paint(canvas, _lastSize);
  var picture = recorder.endRecording();
  return picture.toImage(_lastSize.width.round(), _lastSize.height.round());
}