diff --git a/.gitignore b/.gitignore index e146bd9..bab1ac1 100644 --- a/.gitignore +++ b/.gitignore @@ -211,3 +211,6 @@ marking_app/lib/common/model/job/job_fav_student.g.dart marking_app/lib/common/model/job/job_data_report.g.dart marking_app/lib/common/model/job/job_student_history.g.dart marking_app/lib/pages/homework_correction/job_personal_detail.g.dart +marking_app/lib/common/model/event_bus/jobs/job_do_papers_submit_check_switch_bus.g.dart +marking_app/lib/common/model/event_bus/jobs/job_do_synchro_tab.g.dart +marking_app/lib/pages/homework_correction/widget/top_count.g.dart diff --git a/marking_app/lib/common/model/event_bus/jobs/job_do_papers_submit_check_switch_bus.dart b/marking_app/lib/common/model/event_bus/jobs/job_do_papers_submit_check_switch_bus.dart new file mode 100644 index 0000000..c6c5cbf --- /dev/null +++ b/marking_app/lib/common/model/event_bus/jobs/job_do_papers_submit_check_switch_bus.dart @@ -0,0 +1,12 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'job_do_papers_submit_check_switch_bus.g.dart'; + +@JsonSerializable() +class JobDoPapersSubmitCheckSwitchBus extends Object { + JobDoPapersSubmitCheckSwitchBus(); + + factory JobDoPapersSubmitCheckSwitchBus.fromJson(Map srcJson) => _$JobDoPapersSubmitCheckSwitchBusFromJson(srcJson); + + Map toJson() => _$JobDoPapersSubmitCheckSwitchBusToJson(this); +} diff --git a/marking_app/lib/common/model/event_bus/jobs/job_do_synchro_tab.dart b/marking_app/lib/common/model/event_bus/jobs/job_do_synchro_tab.dart new file mode 100644 index 0000000..c08bc4f --- /dev/null +++ b/marking_app/lib/common/model/event_bus/jobs/job_do_synchro_tab.dart @@ -0,0 +1,27 @@ +import 'package:json_annotation/json_annotation.dart'; +import 'package:marking_app/common/model/job/job_page_tab.dart'; + +part 'job_do_synchro_tab.g.dart'; + +@JsonSerializable() +class JobDoSynchroTab extends Object { + List tabs; + + JobDoSynchroTab(this.tabs); + + factory JobDoSynchroTab.fromJson(Map srcJson) => _$JobDoSynchroTabFromJson(srcJson); + + Map toJson() => _$JobDoSynchroTabToJson(this); + + /// 当前tab下一个tab的pageIndex + int? getNextPageIndex([int? indexLocated]) { + if (indexLocated == null) return null; + return indexLocated == tabs.length - 1 ? null : tabs[indexLocated + 1].pageIndex; + } + + /// 当前tab上一个tab的pageIndex + int? getPreviousPageIndex([int? indexLocated]) { + if (indexLocated == null) return null; + return indexLocated == 0 ? null : tabs[indexLocated - 1].pageIndex; + } +} diff --git a/marking_app/lib/pages/homework_correction/do_papers_job.dart b/marking_app/lib/pages/homework_correction/do_papers_job.dart index a9efb69..17d49d6 100644 --- a/marking_app/lib/pages/homework_correction/do_papers_job.dart +++ b/marking_app/lib/pages/homework_correction/do_papers_job.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; @@ -10,6 +11,8 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:marking_app/common/mixin/common.dart'; import 'package:marking_app/common/model/common/base_structure_result.dart'; import 'package:marking_app/common/model/event_bus/jobs/job_do_papers_student_bus.dart'; +import 'package:marking_app/common/model/event_bus/jobs/job_do_papers_submit_check_switch_bus.dart'; +import 'package:marking_app/common/model/event_bus/jobs/job_do_synchro_tab.dart'; import 'package:marking_app/common/model/job/job_concerned_with_student.dart'; import 'package:marking_app/common/model/job/job_concerned_with_student_params.dart'; import 'package:marking_app/common/model/job/job_do_marking_status_info.dart'; @@ -22,6 +25,7 @@ import 'package:marking_app/pages/common/event_bus_mixin.dart'; import 'package:marking_app/pages/homework_correction/components/new_version_of_homework/bottom_annotation_switch_job.dart'; import 'package:marking_app/pages/homework_correction/eventBus/marking_text_question_job_tab_params_bus.dart'; import 'package:marking_app/pages/homework_correction/providers/drawing_provider.dart'; +import 'package:marking_app/routes/RouterManager.dart'; import 'package:marking_app/utils/index.dart'; // utils @@ -227,6 +231,11 @@ class ReviewStatusInfo extends HookWidget with CommonMixin { Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Function() exitCallback, required int taskId, required int jobId}) { UseSwitchStudentAndType _useSwitchStudentAndType = UseSwitchStudentAndType.use(); // 学生和试卷状态 + // 当前tab改变时 + useValueChanged?, String>(_useSwitchStudentAndType.tabs.value, (_, __) { + _useSwitchStudentAndType.eventFire(model: JobDoSynchroTab(_useSwitchStudentAndType.tabs.value)); + }); + // 当前tab改变时 useValueChanged(_useSwitchStudentAndType.currentTab.value, (_, __) { var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex; @@ -234,11 +243,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func if (studentBus != null && studentBus.pageIndex == thePageIndex) return; // 获取试卷详情数据 定位到对应学生的数据 无需再通知详情获取数据 if (thePageIndex != null) { _useSwitchStudentAndType.getDataForStudents(taskId: taskId, pageIndex: thePageIndex); - int indexLocated = _useSwitchStudentAndType.tabs.value.indexWhere((element) => element.pageIndex == thePageIndex); - _useSwitchStudentAndType.eventFire( - model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex, - nextPageIndex: _useSwitchStudentAndType.getNextPageIndex(indexLocated), - previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(indexLocated))); + _useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex)); } }); useValueChanged(_useSwitchStudentAndType.currentStudent.value, (oldData, __) { @@ -247,15 +252,8 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func if (studentBus != null && studentBus.studentId == studentId) return; // 获取试卷详情数据 定位到对应学生的数据 无需再通知详情获取数据 var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex; - if (thePageIndex != null) // 通知详情数据 - { - int indexLocated = _useSwitchStudentAndType.tabs.value.indexWhere((element) => element.pageIndex == thePageIndex); - _useSwitchStudentAndType.eventFire( - model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex, - studentId: studentId, - nextPageIndex: _useSwitchStudentAndType.getNextPageIndex(indexLocated), - previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(indexLocated)), - ); + if (thePageIndex != null) { + _useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex, studentId: studentId)); } }); @@ -289,6 +287,24 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func _useSwitchStudentAndType.currentTab.value = _useSwitchStudentAndType.tabs.value.firstWhere((element) => moldeParams.pageIndex == element.pageIndex); break; + case JobDoPapersSubmitCheckSwitchBus: // 提交后切换试题通知 + var _currentTab = _useSwitchStudentAndType.currentTab.value; + var _pageIndex = _currentTab?.pageIndex; + if (_currentTab == null || _pageIndex == null) return; + var params = MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex); + if (_currentTab.finishCount + 1 == _currentTab.total) { + var _currentTabNew = + _useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.pageIndex != _currentTab.pageIndex && e.finishCount != e.total); + // 如果全部都已经批阅完成就不需要跳转到不必要得批阅试题 + if (_currentTabNew != null) params.pageIndex = _currentTabNew.pageIndex; + } + var _theCurrentPage = _useSwitchStudentAndType.tabs.value.firstWhereOrNull((element) => element.pageIndex == _pageIndex); + if (_theCurrentPage != null) { + _theCurrentPage.finishCount += 1; + _useSwitchStudentAndType.tabs.value = _useSwitchStudentAndType.tabs.value.map((e) => JobPageTab.fromJson(e.toJson())).toList(); + } + _useSwitchStudentAndType.eventFire(model: params); + break; default: } }, @@ -297,9 +313,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func _useSwitchStudentAndType.eventCancel(); }; }, []); - - var _currentTab = _useSwitchStudentAndType.currentTab.value; - + print(_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.finishCount < e.total)?.toJson()); return Container( padding: EdgeInsets.only(bottom: 2.r, left: 12.r, right: 12.r), decoration: BoxDecoration( @@ -348,7 +362,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func ), Expanded(flex: 1, child: SizedBox()), Expanded( - flex: 5, + flex: 4, child: Container( padding: EdgeInsets.only(left: 10.w), decoration: BoxDecoration( @@ -389,7 +403,8 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end, children: [ - if (_useSwitchStudentAndType.isFinish.value && _currentTab?.finishCount != _currentTab?.total) + if (_useSwitchStudentAndType.isFinish.value && + _useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.finishCount < e.total) != null) Expanded( child: Row( mainAxisSize: MainAxisSize.min, @@ -401,10 +416,10 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func onTap: () => easyThrottle( 'DO_PAPERS_JOB_CONTINUE_TO_REVIEW', () { - var _pageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex; - if (_pageIndex == null) return; - - _useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex)); + var _currentTabNew = _useSwitchStudentAndType.tabs.value.firstWhere((e) => e.finishCount < e.total); + _useSwitchStudentAndType.eventFire( + model: MarkingTextQuestionJobTabParamsBus(taskId, _currentTabNew.pageIndex), + ); }, ), child: quickText( @@ -418,6 +433,30 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func ], ), ), + Expanded( + child: InkWell( + onTap: () => easyThrottle('DO_PAPERS_JOB_HISTORICAL_HOMEWORK', () { + JobConcernedWithStudent? _studentModel = _useSwitchStudentAndType.currentStudent.value; + if (_studentModel == null) return; + String url = + '${RouterManager.jobPersonalDetailPath}?studentId=${_studentModel.studentId}&studentName=${Uri.encodeComponent(_studentModel.studentName)}'; + RouterManager.router.navigateTo(context, url, transition: getTransition()); + }), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Icon(Icons.location_history, size: 12.sp, color: Color.fromRGBO(104, 103, 103, 1)), + SizedBox(width: 1.w), + quickText( + '历史作业', + size: 10.sp, + decoration: TextDecoration.underline, + color: Theme.of(context).primaryColor.withOpacity(0.8), + ), + ], + ), + ), + ), Stack( alignment: const FractionalOffset(0.52, 0.24), children: [ @@ -429,12 +468,6 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func quickText('优先', size: 4.sp, color: Colors.white), ], ), - SizedBox(width: 1.2.w), - quickText( - '优先批阅', - size: 10.sp, - color: _useSwitchStudentAndType.isFirst.value ? Color.fromRGBO(76, 199, 147, 1) : Color.fromRGBO(164, 164, 164, 1), - ), ], ), // InkWell( @@ -492,6 +525,7 @@ class _EexamPaperAndScoringViewState extends ConsumerState scaffoldKeyPictureOverview = GlobalKey(); Future? _future; // 考试试卷 bool firstLoading = true; + JobDoSynchroTab? synchroTabs; late RemoveListener _doJobObtainGradingDataProviderListener; // 批注关闭监听 @override @@ -514,6 +548,9 @@ class _EexamPaperAndScoringViewState extends ConsumerState switchTestQuestions(jobData: jobData), - switchQuestionTypes: () { - eventFire(model: JobCheckSwitchingQuestionTabBus(jobData.pageIndex)); - }, + switchQuestionTypes: () => eventFire(model: JobCheckSwitchingQuestionTabBus(jobData.pageIndex)), viewHomeworkNotes: (JobReviewQuestions subJobQuestion) { var _theBusModel = JobNotesViewBus(taskId: jobData.taskId, paperId: jobData.paperId, questionNo: subJobQuestion.questionNo); @@ -756,7 +791,8 @@ Widget $examPaperAndScoringKeyboardView( return; } // 有下一道题 自动跳转下一道题 - toNextQuestionCall(); + // toNextQuestionCall(); + _useDoScoring.eventFire(model: JobDoPapersSubmitCheckSwitchBus()); }); } diff --git a/marking_app/lib/pages/homework_correction/hooks/do_papers_job/use_switch_student_and_type.dart b/marking_app/lib/pages/homework_correction/hooks/do_papers_job/use_switch_student_and_type.dart index 0be114b..e7a210d 100644 --- a/marking_app/lib/pages/homework_correction/hooks/do_papers_job/use_switch_student_and_type.dart +++ b/marking_app/lib/pages/homework_correction/hooks/do_papers_job/use_switch_student_and_type.dart @@ -82,8 +82,8 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin { RestClient client = await getClient(); BaseStructureResult> result = await client.getJobOfTabs(taskId); if (result.success && result.data != null) { + tabs.value = result.data!; if (synchronization) { - tabs.value = result.data!; currentTab.value = tabs.value.firstWhere((e) => e.finishCount < e.total, orElse: () => tabs.value[0]); } } else { @@ -121,38 +121,9 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin { exitPromptFlag.value = true; return tabJob; // 不跳转 } - exitCallback(); } else { // 跳转到对于位置 - /** - * - var continueFlag = await showDialog( - context: context, - builder: (BuildContext context1) { - return AlertDialog( - title: quickText('页码跳转提示'), - content: Text('当前页:${currentTab.value?.pageIndex} 已批阅完成,是否跳转到页码:${tabJob.pageIndex}继续批阅?'), - actions: [ - TextButton( - child: Text('是'), - onPressed: () { - Navigator.of(context1).pop(true); - }, - ), - TextButton( - child: Text('否'), - onPressed: () { - // 在这里处理删除操作 - Navigator.of(context1).pop(false); - }, - ), - ], - ); - }, - ); - if (continueFlag == null || !continueFlag) return tabJob; // 不跳转 - */ tabs.value = tabDatas; if (tabJob != null) currentTab.value = tabJob; if (tabJob == null && exitPromptFlag.value) ToastUtils.showSuccess('最后一题提交成功'); @@ -162,20 +133,6 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin { return null; } - /// 当前tab下一个tab的pageIndex - int? getNextPageIndex(int? indexLocated) { - if (indexLocated == null) indexLocated = currentTab.value?.pageIndex; - if (indexLocated == null) return null; - return indexLocated == tabs.value.length - 1 ? null : tabs.value[indexLocated + 1].pageIndex; - } - - /// 当前tab上一个tab的pageIndex - int? getPreviousPageIndex(int? indexLocated) { - if (indexLocated == null) indexLocated = currentTab.value?.pageIndex; - if (indexLocated == null) return null; - return indexLocated == 0 ? null : tabs.value[indexLocated - 1].pageIndex; - } - /// 优先批阅 ==> 取消优先批阅 Future jobPriorityReviewCancel(int jobId) async { RestClient _client = await getClient(); diff --git a/marking_app/lib/pages/homework_correction/widget/top_count.dart b/marking_app/lib/pages/homework_correction/widget/top_count.dart index 5e43378..c92fb22 100644 --- a/marking_app/lib/pages/homework_correction/widget/top_count.dart +++ b/marking_app/lib/pages/homework_correction/widget/top_count.dart @@ -6,25 +6,23 @@ import 'package:marking_app/routes/RouterManager.dart'; import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart'; import 'package:marking_app/utils/index.dart'; +part 'top_count.g.dart'; + class TopCount extends StatelessWidget { final JobReportModel data; final String className; final int jobId; - const TopCount(this.data, this.className, this.jobId,{Key? key}) : super(key: key); + const TopCount(this.data, this.className, this.jobId, {Key? key}) : super(key: key); - void showStudentListDialog( - {required BuildContext context, - required String title, - required List arr}) { + void showStudentListDialog({required BuildContext context, required String title, required List arr}) { showDialog( context: context, builder: (BuildContext context) { return AlertDialog( // insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r), contentPadding: EdgeInsets.all(20.r), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(15.r))), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))), content: SizedBox( width: MediaQuery.of(context).size.width * 0.7, height: MediaQuery.of(context).size.height * 0.7, @@ -34,10 +32,7 @@ class TopCount extends StatelessWidget { Center( child: Text( className + title, - style: TextStyle( - fontSize: 15.sp, - color: Color(0xFF3C3C3C), - fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 15.sp, color: Color(0xFF3C3C3C), fontWeight: FontWeight.w500), ), ), SizedBox( @@ -53,24 +48,19 @@ class TopCount extends StatelessWidget { itemBuilder: (context, index) { AnswerOkStudents item = arr[index]; return InkWell( - onTap: (){ + onTap: () { RouterManager.router.navigateTo( - context, - RouterManager.quickCheckPersonalPath + - '?jobId=$jobId&studentId=${item.id}', - transition: getTransition(),); + context, + RouterManager.quickCheckPersonalPath + '?jobId=$jobId&studentId=${item.id}', + transition: getTransition(), + ); }, child: Container( - padding: EdgeInsets.symmetric( - vertical: 5.r, horizontal: 15.r), - color: index.isOdd - ? Colors.white - : Color(0xFFF0F0F0), + padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 15.r), + color: index.isOdd ? Colors.white : Color(0xFFF0F0F0), child: Text( item.name, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), ), ), ); @@ -88,8 +78,8 @@ class TopCount extends StatelessWidget { @override Widget build(BuildContext context) { - double leftWidth = (MediaQuery.of(context).size.width-40.r) * 0.7/3; - double rightWidth = (MediaQuery.of(context).size.width-40.r) * 0.3/2; + double leftWidth = (MediaQuery.of(context).size.width - 40.r) * 0.7 / 3; + double rightWidth = (MediaQuery.of(context).size.width - 40.r) * 0.3 / 2; return Container( padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r), margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r), @@ -104,31 +94,21 @@ class TopCount extends StatelessWidget { children: [ InkWell( onTap: () { - showStudentListDialog( - context: context, - title: '未提交作业学生', - arr: data.noAnswerStudents!); + showStudentListDialog(context: context, title: '未提交作业学生', arr: data.noAnswerStudents!); }, - child:leftContainer(context,count: data.noAnswerCount,name: '未提交',nameColor: Color(0xFFD92F2F),bgColor: Color(0xFFEEEEEE)), + child: leftContainer(context, count: data.noAnswerCount, name: '未提交', nameColor: Color(0xFFD92F2F), bgColor: Color(0xFFEEEEEE)), ), InkWell( onTap: () { - showStudentListDialog( - context: context, - title: '已提交作业学生', - arr: data.validStudents!); + showStudentListDialog(context: context, title: '已提交作业学生', arr: data.validStudents!); }, - child: leftContainer(context,count: data.validCount,name: '已提交',nameColor: Color(0xFF4CC793),bgColor: Color(0xFFF5F5F5)), + child: leftContainer(context, count: data.validCount, name: '已提交', nameColor: Color(0xFF4CC793), bgColor: Color(0xFFF5F5F5)), ), InkWell( onTap: () { - showStudentListDialog( - context: context, - title: '全对作业学生', - arr: data.allCorrectStudents!); + showStudentListDialog(context: context, title: '全对作业学生', arr: data.allCorrectStudents!); }, - child:leftContainer(context,count: data.allCorrect,name: '全对',nameColor: Color(0xFFFF9800),bgColor: Color(0xFFEEEEEE)), - + child: leftContainer(context, count: data.allCorrect, name: '全对', nameColor: Color(0xFFFF9800), bgColor: Color(0xFFEEEEEE)), ), Container( height: 92.r, @@ -138,62 +118,55 @@ class TopCount extends StatelessWidget { children: [ Expanded( child: InkWell( - onTap: (){ - showStudentListDialog( - context: context, - title: '优等作业学生', - arr: data.overallInfos['优']!.students); - }, - child: rightContainer(count: data.overallInfos['优']!.count,bgColor: Color(0xFF56FFB8),nameColor: Color(0xFF009254),name: '优',), - ) - ), + onTap: () { + showStudentListDialog(context: context, title: '优等作业学生', arr: data.overallInfos['优']!.students); + }, + child: rightContainer( + count: data.overallInfos['优']!.count, + bgColor: Color(0xFF56FFB8), + nameColor: Color(0xFF009254), + name: '优', + ), + )), Expanded( child: InkWell( - onTap: (){ - showStudentListDialog( - context: context, - title: '中等作业学生', - arr: data.overallInfos['中']!.students); - }, - child: rightContainer(count: data.overallInfos['中']!.count,bgColor: Color(0xFFD3FF93),nameColor: Color(0xFF3F6605),name: '中'), - ) - ), + onTap: () { + showStudentListDialog(context: context, title: '中等作业学生', arr: data.overallInfos['中']!.students); + }, + child: + rightContainer(count: data.overallInfos['中']!.count, bgColor: Color(0xFFD3FF93), nameColor: Color(0xFF3F6605), name: '中'), + )), ], ), ), Container( height: 92.r, - width:rightWidth, + width: rightWidth, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: InkWell( - onTap: (){ - showStudentListDialog( - context: context, - title: '良等作业学生', - arr: data.overallInfos['良']!.students); - }, - child: rightContainer(count: data.overallInfos['良']!.count,bgColor: Color(0xFFFFC38C),nameColor: Color(0xFFD36500),name: '良' ), - ) - ), + onTap: () { + showStudentListDialog(context: context, title: '良等作业学生', arr: data.overallInfos['良']!.students); + }, + child: + rightContainer(count: data.overallInfos['良']!.count, bgColor: Color(0xFFFFC38C), nameColor: Color(0xFFD36500), name: '良'), + )), Expanded( child: InkWell( - onTap: (){ - showStudentListDialog( - context: context, - title: '差等作业学生', - arr: data.overallInfos['差']!.students); - }, - child: rightContainer(count: data.overallInfos['差']!.count,bgColor: Color(0xFFFF9D94),nameColor: Color(0xFFD12616),name: '差' ), - )), + onTap: () { + showStudentListDialog(context: context, title: '差等作业学生', arr: data.overallInfos['差']!.students); + }, + child: + rightContainer(count: data.overallInfos['差']!.count, bgColor: Color(0xFFFF9D94), nameColor: Color(0xFFD12616), name: '差'), + )), ], ), ) ], ), - /* Row( + /* Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ InkWell( @@ -391,10 +364,7 @@ class TopCount extends StatelessWidget { } return InkWell( onTap: () { - showStudentListDialog( - context: context, - title: item.title + '等作业学生', - arr: item.studentNames); + showStudentListDialog(context: context, title: item.title + '等作业学生', arr: item.studentNames); }, child: Container( padding: EdgeInsets.symmetric(vertical: 10.r), @@ -414,16 +384,12 @@ class TopCount extends StatelessWidget { height: 28.r, decoration: BoxDecoration( color: Colors.white, - border: Border.all( - color: bgColor, - width: 1.r, - style: BorderStyle.solid), + border: Border.all(color: bgColor, width: 1.r, style: BorderStyle.solid), borderRadius: BorderRadius.circular(14.r)), child: Center( child: Text( item.title, - style: - TextStyle(color: bgColor, fontSize: 12.r), + style: TextStyle(color: bgColor, fontSize: 12.r), )), ), ], @@ -434,13 +400,11 @@ class TopCount extends StatelessWidget { ), Text( item.count.toString(), - style: TextStyle( - fontSize: 20.sp, color: Color(0xFF595959)), + style: TextStyle(fontSize: 20.sp, color: Color(0xFF595959)), ), Text( '人', - style: TextStyle( - fontSize: 14.sp, color: Color(0xFF595959)), + style: TextStyle(fontSize: 14.sp, color: Color(0xFF595959)), ), ], ), @@ -456,13 +420,12 @@ class TopCount extends StatelessWidget { } @swidget -Widget leftContainer(context,{required int count,required String name,required Color nameColor,required Color bgColor}){ - double leftWidth = (MediaQuery.of(context).size.width-40.r) * 0.7/3; - return Container( +Widget leftContainer(context, {required int count, required String name, required Color nameColor, required Color bgColor}) { + double leftWidth = (MediaQuery.of(context).size.width - 40.r) * 0.7 / 3; + return Container( width: leftWidth, height: 92.r, - padding: - EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r), + padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r), color: bgColor, child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -476,17 +439,11 @@ Widget leftContainer(context,{required int count,required String name,required C children: [ Text( count.toString(), - style: TextStyle( - fontSize: 18.sp, - color: Color(0xFF595959), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 18.sp, color: Color(0xFF595959), fontWeight: FontWeight.w600), ), Text( '人', - style: TextStyle( - fontSize: 10.sp, - color: Color(0xFF595959), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 10.sp, color: Color(0xFF595959), fontWeight: FontWeight.w600), ), ], ), @@ -495,10 +452,7 @@ Widget leftContainer(context,{required int count,required String name,required C ), Text( name, - style: TextStyle( - fontSize: 12.sp, - color: nameColor, - fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w500), ) ], ), @@ -506,9 +460,9 @@ Widget leftContainer(context,{required int count,required String name,required C } @swidget -Widget rightContainer({required int count,required Color bgColor,required Color nameColor,required String name}){ - return Container( - color:bgColor, +Widget rightContainer({required int count, required Color bgColor, required Color nameColor, required String name}) { + return Container( + color: bgColor, child: Column( children: [ SizedBox( @@ -520,17 +474,11 @@ Widget rightContainer({required int count,required Color bgColor,required Color children: [ Text( count.toString(), - style: TextStyle( - fontSize: 12.sp, - color: nameColor, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w600), ), Text( '人', - style: TextStyle( - fontSize: 8.sp, - color: nameColor, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 8.sp, color: nameColor, fontWeight: FontWeight.w600), ), ], ), @@ -539,10 +487,7 @@ Widget rightContainer({required int count,required Color bgColor,required Color ), Text( name, - style: TextStyle( - fontSize: 12.sp, - color: nameColor, - fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w500), ) ], ),