|
@@ -236,6 +236,7 @@ class _MeasureMainViewState extends State<MeasureMainView> {
|
|
|
measureApplicationName: application.applicationName,
|
|
|
features: features,
|
|
|
);
|
|
|
+ //加延时是为了等待UI消失,防止截图截到UI
|
|
|
await Future.delayed(const Duration(milliseconds: 10), () async {
|
|
|
final RenderRepaintBoundary? boundary =
|
|
|
_key.currentContext?.findRenderObject() as RenderRepaintBoundary?;
|
|
@@ -244,27 +245,25 @@ class _MeasureMainViewState extends State<MeasureMainView> {
|
|
|
final image = await boundary.toImage();
|
|
|
final byteData = await image.toByteData(format: ImageByteFormat.png);
|
|
|
final pngBytes = byteData!.buffer.asUint8List();
|
|
|
- await measureData.saveImage.call(
|
|
|
+ isCaptureState = false;
|
|
|
+ PromptBox.snackbar(
|
|
|
+ i18nBook.measure.saveLocation.t +
|
|
|
+ ' > ' +
|
|
|
+ i18nBook.measure.measureImage.t,
|
|
|
+ duration: const Duration(milliseconds: 1500),
|
|
|
+
|
|
|
+ ///TODO:[Gavin] i18n (截图保存成功)->(截图成功),因为可能上传失败
|
|
|
+ title: i18nBook.measure.screenshotSavedSuccessfully.t,
|
|
|
+ textColor: Colors.white,
|
|
|
+ backgroundColor: Colors.black.withOpacity(0.7));
|
|
|
+ setState(() {});
|
|
|
+ measureData.saveImage.call(
|
|
|
pngBytes,
|
|
|
measureData.measureImageData.patientCode ?? '',
|
|
|
measureData.measureImageData.recordCode ?? '',
|
|
|
measureData.measureImageData.remedicalCode ?? '',
|
|
|
measureResult.toDisplay(),
|
|
|
);
|
|
|
- isCaptureState = false;
|
|
|
- PromptBox.snackbar(
|
|
|
- i18nBook.measure.saveLocation.t +
|
|
|
- ':' +
|
|
|
- i18nBook.measure.measureImage.t,
|
|
|
- title: i18nBook.measure.screenshotSavedSuccessfully.t,
|
|
|
- textColor: const Color.fromARGB(
|
|
|
- 255,
|
|
|
- 219,
|
|
|
- 219,
|
|
|
- 219,
|
|
|
- ),
|
|
|
- );
|
|
|
- setState(() {});
|
|
|
}
|
|
|
});
|
|
|
}
|