useAsImage method
Future<bool>
useAsImage(
- GlobalKey<
State< boundaryKey, {StatefulWidget> > - double pixelRatio = 2.5,
override
Implementation
@override
Future<bool> useAsImage(
GlobalKey boundaryKey, {
double pixelRatio = 2.5,
}) async {
try {
final bytes = await _captureWidget(boundaryKey, pixelRatio);
if (bytes == null) return false;
final filePath = await _saveTempFile(bytes, 'use_as_temp');
await methodChannel.invokeMethod('useAsImage', {'path': filePath});
return true;
} on PlatformException catch (e) {
debugPrint('useAsImage error: ${e.message}');
return false;
}
}