// import 'package:flutter/material.dart';
// import 'package:flutter_riverpod/flutter_riverpod.dart';
// import 'package:flutter_screenutil/flutter_screenutil.dart';
// import 'package:marking_app/common/model/enum/job_enums.dart';
// import 'package:marking_app/pages/homework_correction/hooks/use_data.dart';
// import 'package:marking_app/provider/annotation_graffiti_switch_provider.dart';
// import 'package:marking_app/utils/anti_shake_throttling.dart';
// import 'package:marking_app/utils/index.dart';

// class PreviousQuestionButton extends ConsumerWidget {
//   final bool noPrev;
//   final UseData useData;
//   const PreviousQuestionButton({required this.noPrev, required this.useData, super.key});

//   @override
//   Widget build(BuildContext context, WidgetRef ref) {
//     // 此处作用：打开作图绘画不能切换试题
//     // bool annotationSwitch = ref.watch(annotationGraffitiSwitchProvider).annotationSwitch;
//     // if (annotationSwitch) return Container();
//     return Positioned(
//       left: 3.w,
//       top: ScreenUtil().setHeight(MediaQuery.of(context).size.height) / 2 * 0.87,
//       child: FloatingActionButton(
//         tooltip: '前往上一题',
//         splashColor: Theme.of(context).primaryColor, //水波纹颜色
//         backgroundColor: noPrev ? const Color.fromRGBO(24, 32, 32, 0.04) : const Color.fromRGBO(24, 32, 32, 0.1),
//         focusColor: Theme.of(context).primaryColor,
//         elevation: 0,
//         onPressed: noPrev
//             ? null
//             : () => easyThrottle(
//                   'TestQuestionSwitch',
//                   () => toPrevious(context, ref),
//                   duration: Duration(seconds: 1),
//                 ),
//         child: const Icon(Icons.arrow_back_ios, color: Colors.white),
//         heroTag: 'other',
//       ),
//     );
//   }

//   void toPrevious(BuildContext context, WidgetRef ref) {
//     // ref.read(annotationGraffitiSwitchProvider.notifier).setSwitch(false); 此处作用是关闭作图工具
//     setTimeOut(0, () {
//       useData.futureState.value = useData.getData(context, switchAction: ReviewSwitching.TO_PREVIOUS_QUESTION);
//     });
//   }
// }
