|
@@ -0,0 +1,85 @@
|
|
|
+import 'package:fis_measure/process/workspace/measure_data_controller.dart';
|
|
|
+import 'package:fis_measure/process/workspace/measure_handler.dart';
|
|
|
+import 'package:fis_measure/process/workspace/rpc_helper.dart';
|
|
|
+import 'package:fis_ui/index.dart';
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
+
|
|
|
+class TurnPage extends StatefulWidget {
|
|
|
+ const TurnPage({super.key});
|
|
|
+
|
|
|
+ @override
|
|
|
+ State<StatefulWidget> createState() {
|
|
|
+ return TurnPageState();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class TurnPageState extends State<TurnPage> {
|
|
|
+ final measureData = Get.find<MeasureDataController>();
|
|
|
+ final rpcHelper = Get.find<RPCHelper>();
|
|
|
+ final measureHandler = Get.find<MeasureHandler>();
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return Column(
|
|
|
+ children: [
|
|
|
+ if (measureData.index > 0) ...[
|
|
|
+ ElevatedButton(
|
|
|
+ onPressed: () async {
|
|
|
+ measureData.index--;
|
|
|
+ var preImageInfo = await measureData.getImageInfoByIndex(
|
|
|
+ measureData.measureImageData.recordCode ?? '',
|
|
|
+ rpcHelper.userToken,
|
|
|
+ measureData.measureImageData.patientCode ?? '',
|
|
|
+ measureData.index,
|
|
|
+ );
|
|
|
+ if (preImageInfo != null) {
|
|
|
+ measureHandler.changeImageByIndex.emit(this, preImageInfo);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ style: ElevatedButton.styleFrom(
|
|
|
+ shape: const CircleBorder(),
|
|
|
+ padding: const EdgeInsets.all(16),
|
|
|
+ elevation: 0,
|
|
|
+ backgroundColor: Colors.white.withOpacity(0.2),
|
|
|
+ ),
|
|
|
+ child: const Icon(
|
|
|
+ Icons.keyboard_arrow_up,
|
|
|
+ size: 40,
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ if (measureData.index < measureData.totalCount - 1) ...[
|
|
|
+ const FSizedBox(
|
|
|
+ height: 20,
|
|
|
+ ),
|
|
|
+ ElevatedButton(
|
|
|
+ style: ElevatedButton.styleFrom(
|
|
|
+ shape: const CircleBorder(),
|
|
|
+ padding: const EdgeInsets.all(16),
|
|
|
+ elevation: 0,
|
|
|
+ backgroundColor: Colors.white.withOpacity(0.2),
|
|
|
+ ),
|
|
|
+ onPressed: () async {
|
|
|
+ measureData.index++;
|
|
|
+ var nextImageInfo = await measureData.getImageInfoByIndex(
|
|
|
+ measureData.measureImageData.recordCode ?? '',
|
|
|
+ rpcHelper.userToken,
|
|
|
+ measureData.measureImageData.patientCode ?? '',
|
|
|
+ measureData.index,
|
|
|
+ );
|
|
|
+ if (nextImageInfo != null) {
|
|
|
+ measureHandler.changeImageByIndex.emit(this, nextImageInfo);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ child: const Icon(
|
|
|
+ Icons.keyboard_arrow_down,
|
|
|
+ size: 40,
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|