Closed Choi-Woo-Young closed 6 months ago
The docs for debugNeedsPaint states: Whether this render object's paint information is dirty.
Wrapping controller.capture()
in two addPostFrameCallback
works for me:
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
final bytes = await controller.capture();
setState(() {
this.bytes = bytes;
});
});
});
I upload the new version to solve this pugs.
Hello. I'm using your package well. But When the capture() function was called, the following error pack occurred.
UI WidgetsToImage(controller: controller.pollDocImageController, child: _buildPoll()),
GetXController pollDocBytes.value = await pollDocImageController.capture() ?? Uint8List(0);
ERROR [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/rendering/proxy_box.dart': Failed assertion: line 3379 pos 12: '!debugNeedsPaint': is not true.