待批阅已提交,未提交学生弹框

This commit is contained in:
machuanyu 2024-10-22 10:15:27 +08:00
parent 823da1ad0a
commit 5b202fd748
1 changed files with 34 additions and 7 deletions

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:making_school_asignment_app/page/global_widget/show_student_list.dart';
import 'package:percent_indicator/percent_indicator.dart';
import 'package:making_school_asignment_app/common/job/annotated_class.dart';
import 'package:making_school_asignment_app/common/utils/enum_untils.dart';
@ -79,7 +81,20 @@ class _AnnotateItemState extends State<AnnotateItem> {
),
);
}
void showStudentList(context, List<AnnotatedStudents> students, [bool submitted = false]) async {
showDialog(
context: context,
builder: (BuildContext context) {
return ShowStudentList(
title: '${widget.item.className ?? ''} ${submitted ? '已提交' : '未提交'}作业学生',
studentList: students,
homeworkId: widget.homeworkId,
subject:widget.logic.state.subject,
);
},
);
EasyLoading.dismiss();
}
@override
Widget build(BuildContext context) {
AnnotatedClass itemData = widget.item;
@ -102,16 +117,28 @@ class _AnnotateItemState extends State<AnnotateItem> {
style: TextStyle(fontSize: widget.font, color: const Color(0xFF000000)),
),
const Spacer(),
Text(
'已交:${widget.item.commitStudentCount}',
style: TextStyle(fontSize: widget.font - 2.sp, color: const Color(0xFF4CC793)),
InkWell(
onTap: (){
EasyLoading.show(status: 'loading...');
showStudentList(context, widget.item.commitStudent!, true);
},
child: Text(
'已交:${widget.item.commitStudentCount}',
style: TextStyle(fontSize: widget.font - 2.sp, color: const Color(0xFF4CC793)),
),
),
SizedBox(
width: 20.r,
),
Text(
'未交:${widget.item.noCommitStudentCount}',
style: TextStyle(fontSize: widget.font - 2.sp, color: const Color(0xFFFF5656)),
InkWell(
onTap: (){
EasyLoading.show(status: 'loading...');
showStudentList(context, widget.item.noCommitStudent!, true);
},
child: Text(
'未交:${widget.item.noCommitStudentCount}',
style: TextStyle(fontSize: widget.font - 2.sp, color: const Color(0xFFFF5656)),
),
),
],
),