snapshot method

Future<void> snapshot()

Implementation

Future<void> snapshot() async {
  final Uint8List? image = await controller.takeSnapshot();
  if (image == null) return;
  if (_o.haptics) unawaited(HapticFeedback.mediumImpact());
  if (widget.onSnapshot != null) {
    widget.onSnapshot!(image);
  } else if (_o.shareSnapshots) {
    await UShare.bytes(bytes: image, fileName: "ar_${DateTime.now().millisecondsSinceEpoch}.jpg", mimeType: "image/jpeg");
  }
}