返回事件修改

This commit is contained in:
machuanyu 2024-06-18 10:21:39 +08:00
parent d62560184d
commit c5ec91b295
19 changed files with 202 additions and 233 deletions

View File

@ -1,19 +1,23 @@
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:making_school_asignment_app/common/job/annotated_class.dart';
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
import 'package:making_school_asignment_app/page/home_page/home_logic.dart';
import 'package:making_school_asignment_app/routes/app_pages.dart';
import 'annotate_class_state.dart';
class AnnotateClassLogic extends GetxController with RequestToolMixin {
final AnnotateClassState state = AnnotateClassState();
late final EasyRefreshController refreshController;
final HomeLogic homeController = Get.find();
@override
void onInit() {
super.onInit();
refreshController = EasyRefreshController();
state.homeworkId.value = Get.arguments['id'] ?? '';
state.name.value = Get.arguments['name'] ?? '';
state.grade = Get.arguments['grade'];
@ -64,4 +68,10 @@ class AnnotateClassLogic extends GetxController with RequestToolMixin {
Get.toNamed(Routes.jobReportPage,
arguments: {'title': state.name.value, 'homeworkId': state.homeworkId.value, 'grade': state.grade, 'className': item.className});
}
@override
void dispose() {
super.dispose();
refreshController.dispose();
}
}

View File

@ -1,15 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:get/get.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/utils.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/widget/annotate_item.dart';
import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart';
import 'package:making_school_asignment_app/routes/app_pages.dart';
import 'annotate_class_logic.dart';
import 'widget/completed_annotate_item.dart';
@ -37,7 +34,10 @@ class _AnnotateClassPageState extends State<AnnotateClassPage> {
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () {
logic.homeController.getList();
Get.back();
},
),
actions: const [
ReturnToHomepage(),
@ -46,7 +46,16 @@ class _AnnotateClassPageState extends State<AnnotateClassPage> {
body: Padding(
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r),
child: Obx(() {
return state.completed.value
return EasyRefresh(
firstRefresh: false,
taskIndependence: true,
controller: logic.refreshController,
header: MaterialHeader(),
footer: TaurusFooter(),
onRefresh: () async{
return logic.getList();
},
child: state.completed.value
? Utils.isPad()
? GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -101,7 +110,7 @@ class _AnnotateClassPageState extends State<AnnotateClassPage> {
name: state.name.value,
logic: logic,
);
});
}));
}),
),
);

View File

@ -273,12 +273,16 @@ class _AnnotateItemState extends State<AnnotateItem> {
widget.logic.goQuickDataCheck(widget.item);
},
child: Container(
padding:EdgeInsets.symmetric(vertical:10.r),
decoration: BoxDecoration(
border: Border(right: BorderSide(width: 1.r,color:const Color.fromRGBO(221, 221, 221, 1) ))
),
alignment: Alignment.center,
child: quickText('数据快查', color: const Color.fromRGBO(118, 118, 118, 1), size: widget.font),
),
),
),
Container(width: 1.w, height: 30.h, color: const Color.fromRGBO(221, 221, 221, 1)),
// Container(width: 1.w, height: 30.h, color: const Color.fromRGBO(221, 221, 221, 1)),
Expanded(
child: InkWell(
onTap: () {
@ -303,12 +307,16 @@ class _AnnotateItemState extends State<AnnotateItem> {
});
},
child: Container(
padding:EdgeInsets.symmetric(vertical:10.r),
decoration: BoxDecoration(
border: Border(right: BorderSide(width: 1.r,color:const Color.fromRGBO(221, 221, 221, 1) ))
),
alignment: Alignment.center,
child: quickText('批阅', color: const Color.fromRGBO(118, 118, 118, 1), size: widget.font),
),
),
),
Container(width: 1.w, height: 30.h, color: const Color.fromRGBO(221, 221, 221, 1)),
// Container(width: 1.w, height: 30.h, color: const Color.fromRGBO(221, 221, 221, 1)),
Expanded(
child: InkWell(
onTap: () {},

View File

@ -35,7 +35,7 @@ class _AnswerTrajectoryPageState extends State<AnswerTrajectoryPage> {
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
actions: const [
ReturnToHomepage(),

View File

@ -43,7 +43,7 @@ class _AnswerTrajectoryDetailPageState
}),
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
actions: const [
ReturnToHomepage(),

View File

@ -37,7 +37,7 @@ class _ClassStudentPageState extends State<ClassStudentPage> {
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
actions: const [
ReturnToHomepage(),

View File

@ -5,11 +5,13 @@ import 'package:making_school_asignment_app/common/job/common/base_page_data.dar
import 'package:making_school_asignment_app/common/job/marking_models/favor_param.dart';
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
import 'package:making_school_asignment_app/page/home_page/children/annotate_class/annotate_class_logic.dart';
import 'fav_student_state.dart';
class FavStudentLogic extends GetxController with RequestToolMixin {
final FavStudentState state = FavStudentState();
final AnnotateClassLogic controller = Get.find();
@override
void onInit() {

View File

@ -102,7 +102,10 @@ class _FavStudentPageState extends State<FavStudentPage> {
elevation: 0.0,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios),
onPressed: () => Navigator.of(context).pop()),
onPressed: () {
logic.controller.getList();
Get.back();
}),
iconTheme: const IconThemeData(color: Colors.black),
title: quickText('收藏夹'),
centerTitle: true,

View File

@ -88,7 +88,7 @@ class _FavoriteStudentDialogState extends State<FavoriteStudentDialog> {
onTap: () async {
bool confim = await widget.confirmDialog();
if (confim) {
widget.deleteFav(currentStudent);
widget.deleteFav(currentStudent.value);
imageList.removeAt(defaultIndex.value);
if (imageList.isNotEmpty) {
if (defaultIndex.value < imageList.length) {

View File

@ -39,7 +39,7 @@ class _JobReportPageState extends State<JobReportPage> {
})),
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
actions: const [
ReturnToHomepage(),

View File

@ -35,7 +35,7 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
actions: const [
ReturnToHomepage(),

View File

@ -78,7 +78,7 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
actions: const [
ReturnToHomepage(),

View File

@ -53,7 +53,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> {
children: [
IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.white),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
Expanded(
child: Padding(

View File

@ -1,19 +1,14 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/job/enum_subject.dart';
import 'package:making_school_asignment_app/common/job/work_student.dart';
import 'package:making_school_asignment_app/common/job/work_student_params.dart';
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:making_school_asignment_app/common/store/user_store.dart';
import 'package:making_school_asignment_app/page/home_page/home_logic.dart';
import 'read_over_state.dart';
class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProviderStateMixin {
final ReadOverState state = ReadOverState();
late TabController tabController;
final HomeLogic homeController = Get.find();
@override
void onInit() {
@ -25,74 +20,10 @@ class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProvi
);
}
/* Future<void> showStudents(
BuildContext context, [
bool? submitted = false,
String? className,
]) async {
ToastUtils.showLoading();
List<JobConcernedWithStudent> students = [];
showModalBottomSheet(
context: context,
elevation: 10,
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20.r),
topRight: Radius.circular(20.r),
),
),
builder: (BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 2.w),
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 14.h),
child: quickText(
'${className ?? ''}${submitted! ? '已提交' : '未提交'}作业学生',
size: 18.sp,
fontWeight: FontWeight.bold,
color: Color.fromRGBO(60, 60, 60, 1),
),
),
Expanded(
child: ListView(
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 4.w),
children: [
Wrap(
spacing: 6.0, // ()
runSpacing: 4.0, //
alignment: WrapAlignment.spaceAround, //沿
children: students.map((e) {
return Chip(
backgroundColor: Color.fromRGBO(239, 242, 255, 1),
avatar: CircleAvatar(
backgroundColor: Colors.white,
child: quickText(e.studentName.substring(0, 1),
size: 12.sp, color: Theme.of(context).primaryColor),
),
label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp),
);
}).toList(),
),
],
),
)
],
),
);
},
);
}*/
@override
void dispose() {
super.dispose();
tabController.dispose();
/* tabController2.dispose();
refreshController1.dispose();
refreshController2.dispose();*/
}
}

View File

@ -60,14 +60,15 @@ class _ReadOverPageState extends State<ReadOverPage> {
children: [
Expanded(
flex: 1,
child: Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 10.w),
child: InkWell(
onTap: () {
// SystemNavigator.pop();
logic.homeController.getList();
Get.back();
},
child: Container(
height: 30.h,
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 10.w),
child: Icon(
Icons.arrow_back_ios_sharp,
size: 16.sp,

View File

@ -165,7 +165,7 @@ class _TaskListItemState extends State<TaskListItem> {
Container(
margin: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 10.w),
width: double.infinity,
width: Get.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: const Color.fromRGBO(255, 255, 255, 1),
@ -178,6 +178,9 @@ class _TaskListItemState extends State<TaskListItem> {
)
],
),
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
@ -224,8 +227,7 @@ class _TaskListItemState extends State<TaskListItem> {
size: 12.sp,
),
quickText(' / ', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
Container(
child: Row(
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
quickText('题量:', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp),
@ -236,7 +238,6 @@ class _TaskListItemState extends State<TaskListItem> {
),
],
),
),
quickText(' / ', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
quickText(DateTime.parse(widget.jobTaskItem.publishTime).toString().substring(0, 10),
color: const Color.fromRGBO(97, 97, 97, 1), size: 12.sp),
@ -267,6 +268,10 @@ class _TaskListItemState extends State<TaskListItem> {
],
),
),
SizedBox(width: 100.r,),
],
),
),
Container(
padding: EdgeInsets.all(9.r),
decoration: const BoxDecoration(shape: BoxShape.circle, color: Colors.white),

View File

@ -31,7 +31,7 @@ class _StudentHistoryWorkPageState extends State<StudentHistoryWorkPage> {
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
actions: const [
ReturnToHomepage(),

View File

@ -35,7 +35,7 @@ class _StudentPersonalPageState extends State<StudentPersonalPage> {
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
actions: const [
ReturnToHomepage(),

View File

@ -36,7 +36,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
onPressed: () => Get.back(),
),
actions: const [
ReturnToHomepage(),