优化部分功能

This commit is contained in:
1147192855@qq.com 2024-11-05 15:49:00 +08:00
parent 33d5481773
commit 1ec5c5eb62
5 changed files with 325 additions and 398 deletions

View File

@ -20,8 +20,8 @@ class RequestConfig {
static const connectTimeout = 8000; //
static const receiveTimeout = 8000; //
static const bool requestDataPrinting = true; //
static const bool printSwitch = true; //
static const bool requestDataPrinting = false; //
static const bool printSwitch = false; //
static const successCode = [204, 200]; // code
static final BasePage basePage = BasePage(1, 10); //

View File

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:gesture_zoom_box/gesture_zoom_box.dart';
import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_bus.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
@ -41,15 +42,14 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
//
Expanded(
flex: 7,
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
child: LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
var maxWidth = constraints.maxWidth;
var maxHeight = constraints.maxHeight;
return Stack(
children: [
//
QuestionImageView(
maxWidth, maxHeight, sateData, annotationState, logic),
QuestionImageView(maxWidth, maxHeight, sateData, annotationState, logic),
//
// Positioned(right: 3.w, bottom: 4.h, child: const $ContinueToReview(isFloatingAction: true)),
//
@ -63,19 +63,15 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
heroTag: '点击前往上一题',
tooltip: '点击前往上一题',
focusColor: Theme.of(context).primaryColor,
backgroundColor:
const Color.fromRGBO(24, 32, 32, 0.05),
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.05),
elevation: 10.r,
onPressed: () =>
easyThrottle('TestQuestionSwitch', () {
onPressed: () => easyThrottle('TestQuestionSwitch', () {
var param = sateData.param.value;
param.studentId = lastPageVal.studentId;
param.templateId = lastPageVal.templateId;
sateData.param.value =
DoPaperDetailsParam.fromJson(param.toJson());
sateData.param.value = DoPaperDetailsParam.fromJson(param.toJson());
}),
child: Icon(Icons.arrow_back_ios,
color: Colors.white, size: 22.sp),
child: Icon(Icons.arrow_back_ios, color: Colors.white, size: 22.sp),
);
}),
),
@ -90,18 +86,14 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
heroTag: '点击前往下一题',
tooltip: '点击前往下一题',
elevation: 10.r,
backgroundColor:
const Color.fromRGBO(24, 32, 32, 0.05),
onPressed: () =>
easyThrottle('TestQuestionSwitch', () {
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.05),
onPressed: () => easyThrottle('TestQuestionSwitch', () {
var param = sateData.param.value;
param.studentId = nextPageVal.studentId;
param.templateId = nextPageVal.templateId;
sateData.param.value =
DoPaperDetailsParam.fromJson(param.toJson());
sateData.param.value = DoPaperDetailsParam.fromJson(param.toJson());
}),
child: Icon(Icons.arrow_forward_ios,
color: Colors.white, size: 22.sp),
child: Icon(Icons.arrow_forward_ios, color: Colors.white, size: 22.sp),
);
}),
),
@ -122,8 +114,7 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
child: CupertinoButton(
color: Colors.grey[300],
onPressed: () => easyThrottle('home_work_reload_data', () {
sateData.param.value =
DoPaperDetailsParam.fromJson(sateData.param.value.toJson());
sateData.param.value = DoPaperDetailsParam.fromJson(sateData.param.value.toJson());
}),
child: quickText('重新请求', color: Colors.black38),
),
@ -136,8 +127,7 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
//
@swidget
Widget $totalSubmitCountView(
BuildContext context, HomeworkReviewState sateData) {
Widget $totalSubmitCountView(BuildContext context, HomeworkReviewState sateData) {
return Obx(() {
var data = sateData.data.value;
if (data == null) return Container();
@ -152,10 +142,7 @@ Widget $totalSubmitCountView(
context: context,
elevation: 10,
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.r),
topRight: Radius.circular(10.r))),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(10.r), topRight: Radius.circular(10.r))),
builder: (BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 2.w),
@ -173,8 +160,7 @@ Widget $totalSubmitCountView(
SizedBox(height: 10.h),
Expanded(
child: ListView(
padding: EdgeInsets.symmetric(
vertical: 8.h, horizontal: 4.w),
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 4.w),
children: [
Wrap(
spacing: 7.2.w, // ()
@ -185,39 +171,27 @@ Widget $totalSubmitCountView(
alignment: const FractionalOffset(0.05, 0.09),
children: [
Container(
padding: EdgeInsets.only(
top: 1.2.h,
bottom: 1.5.h,
left: 13.w,
right: 5.w),
padding: EdgeInsets.only(top: 1.2.h, bottom: 1.5.h, left: 13.w, right: 5.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.r),
color: const Color.fromRGBO(
239, 242, 255, 1),
color: const Color.fromRGBO(239, 242, 255, 1),
),
child: quickText(
e.name,
size: 12.sp,
wordSpacing: 2,
color:
const Color.fromRGBO(80, 94, 110, 1),
color: const Color.fromRGBO(80, 94, 110, 1),
),
),
Stack(
alignment:
const FractionalOffset(0.52, 0.24),
alignment: const FractionalOffset(0.52, 0.24),
children: [
Icon(
const IconData(0xe63d,
fontFamily: "AlibabaIcon"),
const IconData(0xe63d, fontFamily: "AlibabaIcon"),
size: 12.sp,
color: e.isPriority
? Theme.of(context).primaryColor
: const Color.fromRGBO(
164, 164, 164, 1),
color: e.isPriority ? Theme.of(context).primaryColor : const Color.fromRGBO(164, 164, 164, 1),
),
quickText('优先',
size: 4.sp, color: Colors.white),
quickText('优先', size: 4.sp, color: Colors.white),
],
),
],
@ -239,17 +213,11 @@ Widget $totalSubmitCountView(
children: [
Padding(
padding: EdgeInsets.only(bottom: 1.h),
child: quickText('已阅',
color: const Color.fromRGBO(117, 117, 117, 1), size: 10.sp),
child: quickText('已阅', color: const Color.fromRGBO(117, 117, 117, 1), size: 10.sp),
),
quickText(data.annotatedCount,
color: Theme.of(context).primaryColor,
size: 12.sp,
fontWeight: FontWeight.bold),
quickText('/',
color: const Color.fromRGBO(117, 117, 117, 1), size: 12.sp),
quickText(data.submitCount - data.annotatedCount,
color: const Color.fromRGBO(117, 117, 117, 1), size: 10.sp),
quickText(data.annotatedCount, color: Theme.of(context).primaryColor, size: 12.sp, fontWeight: FontWeight.bold),
quickText('/', color: const Color.fromRGBO(117, 117, 117, 1), size: 12.sp),
quickText(data.submitCount - data.annotatedCount, color: const Color.fromRGBO(117, 117, 117, 1), size: 10.sp),
],
),
),
@ -259,18 +227,15 @@ Widget $totalSubmitCountView(
//
@hwidget
Widget $questionNumberView(BuildContext context, HomeworkReviewLogic logic,
HomeworkReviewState sateData) {
Widget $questionNumberView(BuildContext context, HomeworkReviewLogic logic, HomeworkReviewState sateData) {
final scrollControllerNum = useScrollController(); //
useEffect(() {
scrollControllerNum.addListener(() {
if (sateData.panQuestView == false)
sateData.slide.value = scrollControllerNum.offset;
if (sateData.panQuestView == false) sateData.slide.value = scrollControllerNum.offset;
});
var listenVal = sateData.slide.listen((e) {
if (e != scrollControllerNum.offset && sateData.panQuestView == true)
scrollControllerNum.jumpTo(e);
if (e != scrollControllerNum.offset && sateData.panQuestView == true) scrollControllerNum.jumpTo(e);
});
return () {
@ -307,20 +272,13 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewLogic logic,
return Container(
height: boxHeight > actualImgHeight ? boxHeight : actualImgHeight,
padding: EdgeInsets.only(
top: imageVal.remainingHeight > 0
? imageVal.remainingHeight / 2
: 0),
padding: EdgeInsets.only(top: imageVal.remainingHeight > 0 ? imageVal.remainingHeight / 2 : 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: studentQuestions
?.asMap()
.keys
.map((e) => $ScoringQuestionsView(
logic,
studentQuestions[e],
imageVal.scaleRatio,
studentQuestions))
.map((e) => $ScoringQuestionsView(logic, studentQuestions[e], imageVal.scaleRatio, studentQuestions))
.toList() ??
[],
),
@ -333,11 +291,7 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewLogic logic,
//
@hwidget
Widget $scoringQuestionsView(
BuildContext context,
HomeworkReviewLogic logic,
StudentQuestions item,
double scaleRatio,
List<StudentQuestions>? studentQuestions) {
BuildContext context, HomeworkReviewLogic logic, StudentQuestions item, double scaleRatio, List<StudentQuestions>? studentQuestions) {
var studentScore = useState<int?>(item.studentScore);
useValueChanged<int?, void>(studentScore.value, (_, __) {
@ -346,8 +300,7 @@ Widget $scoringQuestionsView(
//
var annotateTime = logic.state.data.value?.annotateTime;
if (annotateTime == null) {
var noRatingGiven =
studentQuestions!.firstWhereOrNull((e) => e.studentScore == null);
var noRatingGiven = studentQuestions!.firstWhereOrNull((e) => e.studentScore == null);
if (noRatingGiven == null) logic.submit(context);
}
});
@ -359,13 +312,13 @@ Widget $scoringQuestionsView(
useEffect(() {
return () {};
}, []);
var padinVal = item.correctRate > 0
? EdgeInsets.only(top: 6.4.h)
: EdgeInsets.symmetric(vertical: 2.h);
var padinVal = item.correctRate > 0 ? EdgeInsets.only(top: 6.4.h) : EdgeInsets.symmetric(vertical: 2.h);
return Container(
height: item.height! * scaleRatio,
padding: EdgeInsets.zero,
child: item.useTime == 0?Container():Stack(
child: item.useTime == 0
? Container()
: Stack(
alignment: const FractionalOffset(0, 0),
children: [
Row(
@ -377,18 +330,14 @@ Widget $scoringQuestionsView(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
backgroundColor:
const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero), //
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), //
),
child: Padding(
padding: padinVal,
child: Icon(
size: 22.sp,
color: studentScore.value == 2
? const Color(0xFF54971F)
: const Color.fromRGBO(114, 114, 114, 1),
color: studentScore.value == 2 ? Colors.green : const Color.fromRGBO(114, 114, 114, 1),
const IconData(0xe62b, fontFamily: "AlibabaIcon"),
),
),
@ -403,18 +352,14 @@ Widget $scoringQuestionsView(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
backgroundColor:
const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero), //
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), //
),
child: Padding(
padding: padinVal,
child: Icon(
size: 22.sp,
color: studentScore.value == 1
? const Color(0xFF54971F)
: const Color.fromRGBO(114, 114, 114, 1),
color: studentScore.value == 1 ? Colors.green : const Color.fromRGBO(114, 114, 114, 1),
const IconData(0xe62c, fontFamily: "AlibabaIcon"),
),
),
@ -429,18 +374,14 @@ Widget $scoringQuestionsView(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
backgroundColor:
const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero), //
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), //
),
child: Padding(
padding: padinVal,
child: Icon(
size: 22.sp,
color: studentScore.value == 0
? const Color(0xFF54971F)
: const Color.fromRGBO(114, 114, 114, 1),
color: studentScore.value == 0 ? Colors.green : const Color.fromRGBO(114, 114, 114, 1),
const IconData(0xe62a, fontFamily: "AlibabaIcon"),
),
),
@ -457,11 +398,8 @@ Widget $scoringQuestionsView(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 1.1.w),
quickText('${item.questionNo}',
color: Theme.of(context).primaryColor.withOpacity(0.7),
size: 8.sp),
if (item.correctRate > 0)
quickText(' 正确率', color: Colors.grey, size: 5.sp),
quickText('${item.questionNo}', color: Theme.of(context).primaryColor.withOpacity(0.7), size: 8.sp),
if (item.correctRate > 0) quickText(' 正确率', color: Colors.grey, size: 5.sp),
if (item.correctRate > 0)
Expanded(
child: LinearPercentIndicator(
@ -471,10 +409,7 @@ Widget $scoringQuestionsView(
alignment: MainAxisAlignment.center,
progressColor: Theme.of(context).primaryColor,
backgroundColor: const Color(0xFFB8C7CB).withOpacity(0.35),
center: quickText("${item.correctRate}%",
size: 5.sp,
align: TextAlign.center,
color: Colors.white),
center: quickText("${item.correctRate}%", size: 5.sp, align: TextAlign.center, color: Colors.white),
),
)
],
@ -486,16 +421,13 @@ Widget $scoringQuestionsView(
}
//
class QuestionImageView extends HookWidget
with EventBusMixin<BottomOperationBar> {
class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar> {
final double maxWidth;
final double maxHeight;
final HomeworkReviewLogic logic;
final HomeworkReviewState sateData;
final HomeworkReviewAnnotationsControlState annotationState;
QuestionImageView(this.maxWidth, this.maxHeight, this.sateData,
this.annotationState, this.logic,
{super.key});
QuestionImageView(this.maxWidth, this.maxHeight, this.sateData, this.annotationState, this.logic, {super.key});
///
int _findTargetIndex<T>(List<T> list, T target, [int reciprocal = 2]) {
@ -511,10 +443,14 @@ class QuestionImageView extends HookWidget
int activePointers = 0;
ImageStream? imageStream;
@override
Widget build(BuildContext context) {
final theMaxHeight = useState<double>(maxHeight);
final scrollControllerQuestion = useScrollController(); //
var vnHandWritings = useValueNotifier<List<dynamic>>([]);
var customPaintSize = useState<Size>(Size.zero);
useEffect(() {
var listenStream = sateData.data.listen((e) {
@ -522,17 +458,24 @@ class QuestionImageView extends HookWidget
sateData.handwritings = [];
vnHandWritings.value = sateData.handwritings;
});
return () => listenStream.cancel();
var listenStreamImageScale = sateData.imageScale.listen((e) {
customPaintSize.value = Size(
sateData.imageScale.value?.actualImgWidth ?? 0,
sateData.imageScale.value?.actualImgHeight ?? 0,
);
});
return () {
listenStream.cancel();
listenStreamImageScale.cancel();
};
}, []);
ImageStream? imageStream;
var imageStreamListener = useState<ImageStreamListener>(
ImageStreamListener((ImageInfo info, bool _) {
var imageStreamListener = useState<ImageStreamListener>(ImageStreamListener((ImageInfo info, bool _) {
WidgetsBinding.instance.addPostFrameCallback((_) {
sateData.imageScale.value = TestQuestionsImageInfo(
templateId: sateData.data.value?.templateId,
boxWidth: maxWidth,
boxHeight: maxHeight,
boxHeight: theMaxHeight.value,
imageWidth: info.image.width.toDouble(),
imageHeight: info.image.height.toDouble(),
url: sateData.data.value!.zgtAnswer,
@ -550,16 +493,9 @@ class QuestionImageView extends HookWidget
bool? res = await showDialog<bool>(
context: context,
builder: (context1) {
return AlertDialog(
content: quickText("是否撤销全部批注痕迹?"),
actions: <Widget>[
TextButton(
child: quickText("取消"),
onPressed: () => Navigator.pop(context1, false)),
TextButton(
child: quickText("确定",
color: Theme.of(context).primaryColor),
onPressed: () => Navigator.pop(context1, true))
return AlertDialog(content: quickText("是否撤销全部批注痕迹?"), actions: <Widget>[
TextButton(child: quickText("取消"), onPressed: () => Navigator.pop(context1, false)),
TextButton(child: quickText("确定", color: Theme.of(context).primaryColor), onPressed: () => Navigator.pop(context1, true))
]);
},
);
@ -570,15 +506,10 @@ class QuestionImageView extends HookWidget
await showDialog<bool>(
context: context,
builder: (context1) {
return AlertDialog(
content: quickText("是否撤销上次批阅批注痕迹?"),
actions: <Widget>[
return AlertDialog(content: quickText("是否撤销上次批阅批注痕迹?"), actions: <Widget>[
TextButton(child: quickText("取消"), onPressed: () => Navigator.pop(context1, false)),
TextButton(
child: quickText("取消"),
onPressed: () => Navigator.pop(context1, false)),
TextButton(
child: quickText("确定",
color: Theme.of(context).primaryColor),
child: quickText("确定", color: Theme.of(context).primaryColor),
onPressed: () {
Navigator.pop(context1, true);
sateData.data.value?.zgtAnnotate = null;
@ -600,15 +531,10 @@ class QuestionImageView extends HookWidget
await showDialog<bool>(
context: context,
builder: (context1) {
return AlertDialog(
content: quickText("是否撤销上次批阅批注痕迹?"),
actions: <Widget>[
return AlertDialog(content: quickText("是否撤销上次批阅批注痕迹?"), actions: <Widget>[
TextButton(child: quickText("取消"), onPressed: () => Navigator.pop(context1, false)),
TextButton(
child: quickText("取消"),
onPressed: () => Navigator.pop(context1, false)),
TextButton(
child: quickText("确定",
color: Theme.of(context).primaryColor),
child: quickText("确定", color: Theme.of(context).primaryColor),
onPressed: () {
Navigator.pop(context1, true);
sateData.data.value?.zgtAnnotate = null;
@ -636,8 +562,7 @@ class QuestionImageView extends HookWidget
}); //
var listenVal = sateData.slide.listen((e) {
if (e != scrollControllerQuestion.offset &&
sateData.panQuestView == false) scrollControllerQuestion.jumpTo(e);
if (e != scrollControllerQuestion.offset && sateData.panQuestView == false) scrollControllerQuestion.jumpTo(e);
});
//
@ -648,6 +573,10 @@ class QuestionImageView extends HookWidget
};
}, []);
useValueChanged<double, void>(maxHeight, (oldValue, __) {
theMaxHeight.value = maxHeight;
});
return Container(
height: maxHeight,
// padding: EdgeInsets.only(bottom: 2.h, top: 2.h),
@ -655,25 +584,19 @@ class QuestionImageView extends HookWidget
child: Obx(() {
var imageUrl = sateData.data.value?.zgtAnswer;
var showZgtAnnotate = sateData.data.value?.showZgtAnnotate;
if (imageUrl == null) return const SizedBox();
return GestureDetector(
onPanDown: (_) => sateData.panQuestView = true,
child: SingleChildScrollView(
controller: scrollControllerQuestion,
physics: !annotationState.pen.value
? const BouncingScrollPhysics()
: const NeverScrollableScrollPhysics(),
physics: !annotationState.pen.value ? const BouncingScrollPhysics() : const NeverScrollableScrollPhysics(),
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical, //
child: Container(
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
offset: Offset(-6.r, 1.r),
blurRadius: 10.r,
spreadRadius: 8.r)
]),
decoration: BoxDecoration(
boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.2), offset: Offset(-6.r, 1.r), blurRadius: 10.r, spreadRadius: 8.r)]),
child: Listener(
behavior: HitTestBehavior.opaque,
onPointerDown: (PointerDownEvent event) {
@ -700,11 +623,9 @@ class QuestionImageView extends HookWidget
if (imageScale == null || !annotationState.pen.value) return;
Offset localPosition = event.localPosition;
var dy = localPosition.dy;
if (dy > imageScale.actualImgHeight || dy < 0)
return; //
if (dy > imageScale.actualImgHeight || dy < 0) return; //
vnHandWritings.value = List.from(vnHandWritings.value)
..add(localPosition);
vnHandWritings.value = List.from(vnHandWritings.value)..add(localPosition);
sateData.handwritings = vnHandWritings.value;
},
child: Stack(
@ -712,28 +633,23 @@ class QuestionImageView extends HookWidget
$TheCachedNetworkImage(
imageUrl: imageUrl,
(context, imageProvider) {
Image imageWidget =
Image(image: imageProvider, fit: BoxFit.fitWidth);
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
imageStream?.removeListener(imageStreamListener.value);
imageStream = imageWidget.image
.resolve(const ImageConfiguration())
..addListener(imageStreamListener.value);
imageStream = imageWidget.image.resolve(const ImageConfiguration())..addListener(imageStreamListener.value);
// return imageWidget;
return imageWidget;
},
),
RepaintBoundary(
key: logic.pictureOverviewKey,
child: CustomPaint(
isComplex: true,
size: customPaintSize.value,
foregroundPainter: DrawingPainter(ctrl: vnHandWritings),
size: Size(
sateData.imageScale.value?.actualImgWidth ?? 0,
sateData.imageScale.value?.actualImgHeight ?? 0,
),
child: showZgtAnnotate != null
? $TheCachedNetworkImage(
imageUrl: showZgtAnnotate,
(_, imageProvider) => Image(
image: imageProvider, fit: BoxFit.fitWidth),
(_, imageProvider) => Image(image: imageProvider, fit: BoxFit.fitWidth),
)
: null,
),
@ -765,8 +681,7 @@ class DrawingPainter extends CustomPainter {
for (int i = 0; i < pointsLength; i++) {
Offset? offsetData = points[i];
Offset? nextOffsetData = pointsLength - 1 == i ? null : points[i + 1];
if (offsetData != null && nextOffsetData != null)
canvas.drawLine(offsetData, nextOffsetData, paintBrush);
if (offsetData != null && nextOffsetData != null) canvas.drawLine(offsetData, nextOffsetData, paintBrush);
}
}

View File

@ -5,12 +5,12 @@ import 'package:get/get.dart';
import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart';
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
import 'package:making_school_asignment_app/page/home_page/children/annotate_class/annotate_class_logic.dart';
import 'package:making_school_asignment_app/page/home_page/children/homework_review/components/question_paper_view.dart';
import 'package:making_school_asignment_app/page/home_page/home_logic.dart';
import 'components/bottom_operation_bar.dart';
import 'components/dropdown_switch_students_type.dart';
import 'components/favorite_widget.dart';
import 'components/question_paper_view.dart';
import 'configuration_files/index.dart';
class HomeworkReview extends StatefulWidget {
@ -21,6 +21,7 @@ class HomeworkReview extends StatefulWidget {
}
class _HomeworkReviewState extends State<HomeworkReview> {
final ScrollController controller = ScrollController();
final logic = Get.find<HomeworkReviewLogic>();
final sateData = Get.find<HomeworkReviewLogic>().state;
final AnnotateClassLogic _controller = Get.find<AnnotateClassLogic>();
@ -29,12 +30,14 @@ class _HomeworkReviewState extends State<HomeworkReview> {
@override
void initState() {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); //
super.initState();
}
@override
void dispose() {
Get.delete<HomeworkReviewLogic>();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [SystemUiOverlay.top, SystemUiOverlay.bottom]); //
super.dispose();
}
@ -48,15 +51,6 @@ class _HomeworkReviewState extends State<HomeworkReview> {
_homeLogicController.getList();
}
},
child: AnnotatedRegion(
value: const SystemUiOverlayStyle(
systemNavigationBarColor: Color(0xFF000000),
systemNavigationBarDividerColor: null,
statusBarColor: Colors.transparent,
systemNavigationBarIconBrightness: Brightness.light,
statusBarIconBrightness: Brightness.light,
statusBarBrightness: Brightness.light,
),
child: SafeArea(
child: Scaffold(
appBar: AppBar(
@ -74,7 +68,23 @@ class _HomeworkReviewState extends State<HomeworkReview> {
//
const DropdownSwitchStudentsType(),
SizedBox(height: 1.h),
const Expanded(child: QuestionPaperView()),
const Expanded(child: QuestionPaperView()
// child: CustomZoomWidget(
// child: Image.network('https://cdn3-banquan.ituchong.com/weili/image/l/903170934517792920.jpeg'),
// ),
// child: CustomZoomWidget(
// child: Image.network('https://cdn3-banquan.ituchong.com/weili/image/l/903170934517792920.jpeg'),
// minScale: 0.8,
// maxScale: 4,
// resetDuration: const Duration(milliseconds: 200),
// boundaryMargin: const EdgeInsets.only(bottom: 0),
// clipBehavior: Clip.hardEdge,
// useOverlay: false,
// maxOverlayOpacity: 0.5,
// overlayColor: Colors.black,
// fingersRequiredToPinch: 2,
// ),
),
const BottomAnnotationSwitch()
],
),
@ -83,7 +93,6 @@ class _HomeworkReviewState extends State<HomeworkReview> {
// floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
),
),
),
);
}
}

View File

@ -30,7 +30,8 @@ class _ReadOverPageState extends State<ReadOverPage> {
value: const SystemUiOverlayStyle(
/* systemNavigationBarColor: Color(0xFF000000),
systemNavigationBarDividerColor: null,*/
statusBarColor: Colors.transparent,
statusBarColor: Colors.white,
systemNavigationBarDividerColor: null,
systemNavigationBarIconBrightness: Brightness.light,
statusBarIconBrightness: Brightness.light,
statusBarBrightness: Brightness.light,
@ -177,7 +178,12 @@ class _ReadOverPageState extends State<ReadOverPage> {
@override
void dispose() {
Get.delete<ReadOverLogic>();
super.dispose();
logic.homeController.getList();
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
statusBarColor: Colors.transparent, //
statusBarIconBrightness: Brightness.light,
systemStatusBarContrastEnforced: false,
));
super.dispose();
}
}

View File

@ -22,7 +22,7 @@ part 'annotate_list.g.dart';
class AnnotateList extends StatefulWidget {
final int tabIndex;
final int assessType;
const AnnotateList({Key? key,required this.tabIndex,required this.assessType}) : super(key: key);
const AnnotateList({super.key, required this.tabIndex, required this.assessType});
@override
State<AnnotateList> createState() => _AnnotateListState();
@ -35,7 +35,6 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
late RxList<Items> annotateList = RxList();
late int page = 1;
late TabController tabController2;
/* 待阅卷 */
late final EasyRefreshController refreshController1;
@ -61,7 +60,6 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
EasyLoading.show(status: 'loading...');
getUnAnnotateList();
getAnnotateList();
}
//
@ -75,6 +73,7 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
EasyLoading.dismiss();
print('state.unAnnotateList.length=${unAnnotateList.length}');
}
//
void getAnnotateList() async {
WorkStudent data = WorkStudent([], 0);
@ -87,6 +86,7 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
EasyLoading.dismiss();
print('state.annotateList.length=${annotateList.length}');
}
///
Future<void> onMyRefresh(EasyRefreshController controller, int tab) async {
/* params.page = RequestConfig.basePage.page;
@ -100,7 +100,6 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
} else {
getAnnotateList();
}
}
Future<void> getCollect(item) async {
@ -122,7 +121,6 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
}*/
}
@override
Widget build(BuildContext context) {
return Column(
@ -159,15 +157,15 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
if (value.endDate != null) {
if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) {
customTimeStr.value =
'${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}';
customTimeStr.value = '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}';
} else {
customTimeStr.value = '${customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
}
}
}
}),
Expanded(child: IndexedStack(
Expanded(
child: IndexedStack(
index: widget.tabIndex,
children: <Widget>[
$EasyRefresh(
@ -237,13 +235,7 @@ Widget $easyRefresh({
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
itemBuilder: (context, index) {
Items item = data[index];
return TaskListItem(
completed: completed,
jobTaskItem: item,
type: type,
collectFun: collectFun,
tabIndex:tab - 1
);
return TaskListItem(completed: completed, jobTaskItem: item, type: type, collectFun: collectFun, tabIndex: tab - 1);
},
itemCount: data.length,
),
@ -265,8 +257,14 @@ Widget $reviewedItem({
return InkWell(
onTap: () {
Get.toNamed(Routes.annotateClassPage,
arguments: {'id': jobTaskItem.id, 'name': jobTaskItem.name, 'grade': jobTaskItem.grade,'subject':jobTaskItem.subject, 'completed': true,'tabIndex':tabIndex});
Get.toNamed(Routes.annotateClassPage, arguments: {
'id': jobTaskItem.id,
'name': jobTaskItem.name,
'grade': jobTaskItem.grade,
'subject': jobTaskItem.subject,
'completed': true,
'tabIndex': tabIndex
});
},
child: Container(
padding: EdgeInsets.only(right: 5.w),
@ -288,7 +286,6 @@ Widget $reviewedItem({
//
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 32.w,