Compare commits

..

2 Commits

Author SHA1 Message Date
豌杂 96203b02ae no message 2024-03-29 19:09:36 +08:00
1147192855@qq.com aeb318f9d5 no message 2024-03-29 18:29:12 +08:00
5 changed files with 177 additions and 264 deletions

2
.gitignore vendored
View File

@ -209,3 +209,5 @@ marking_app/lib/common/model/job/job_favorite_item_model.g.dart
marking_app/lib/pages/homework_correction/pages/job_favorite.g.dart marking_app/lib/pages/homework_correction/pages/job_favorite.g.dart
marking_app/lib/common/model/job/job_fav_student.g.dart 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_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

View File

@ -352,7 +352,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_TEAM = CYDU583KN6; DEVELOPMENT_TEAM = CYDU583KN6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -360,7 +360,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.98; MARKETING_VERSION = 1.0.102;
PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -490,7 +490,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_TEAM = CYDU583KN6; DEVELOPMENT_TEAM = CYDU583KN6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -498,7 +498,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.98; MARKETING_VERSION = 1.0.102;
PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -520,7 +520,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_TEAM = CYDU583KN6; DEVELOPMENT_TEAM = CYDU583KN6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -528,7 +528,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.98; MARKETING_VERSION = 1.0.102;
PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart'; import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:marking_app/common/mixin/common.dart'; import 'package:marking_app/common/mixin/common.dart';
@ -15,20 +16,19 @@ import 'package:marking_app/utils/request/rest_client.dart';
import 'package:percent_indicator/percent_indicator.dart'; import 'package:percent_indicator/percent_indicator.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart'; import 'package:syncfusion_flutter_datepicker/datepicker.dart';
part 'job_personal_detail.g.dart';
class JobPersonalDetail extends StatefulWidget { class JobPersonalDetail extends StatefulWidget {
final String studentName; final String studentName;
final int studentId; final int studentId;
const JobPersonalDetail( const JobPersonalDetail({Key? key, required this.studentName, required this.studentId}) : super(key: key);
{Key? key, required this.studentName, required this.studentId})
: super(key: key);
@override @override
_JobPersonalDetailState createState() => _JobPersonalDetailState(); _JobPersonalDetailState createState() => _JobPersonalDetailState();
} }
class _JobPersonalDetailState extends State<JobPersonalDetail> class _JobPersonalDetailState extends State<JobPersonalDetail> with CommonMixin, TickerProviderStateMixin {
with CommonMixin, TickerProviderStateMixin {
@override @override
int page = 1; int page = 1;
int pageSize = 10; int pageSize = 10;
@ -60,8 +60,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
void getList() async { void getList() async {
RestClient _client = await getClient(); RestClient _client = await getClient();
BaseStructureResult<JobStudentHistory> res = BaseStructureResult<JobStudentHistory> res =
await _client.getStudentJobHistory(widget.studentId, !isJob, await _client.getStudentJobHistory(widget.studentId, !isJob, startDataTime, endDataTime, page, pageSize);
startDataTime, endDataTime, page, pageSize);
if (res.success) { if (res.success) {
res.data!.pagedList.items.forEach((element) { res.data!.pagedList.items.forEach((element) {
int num = 0; int num = 0;
@ -75,8 +74,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
num = num + 1; num = num + 1;
} }
}); });
if (num == if (num == (element.objectiveDtls.length + element.subjectiveDtls.length)) {
(element.objectiveDtls.length + element.subjectiveDtls.length)) {
element.allNotDone = true; element.allNotDone = true;
} }
}); });
@ -106,8 +104,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
backgroundColor: Color.fromRGBO(245, 245, 245, 1), backgroundColor: Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.white, backgroundColor: Colors.white,
title: Text('${widget.studentName}作业详情', title: Text('${widget.studentName}作业详情', style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))),
style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))),
centerTitle: true, centerTitle: true,
leading: IconButton( leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black), icon: Icon(Icons.arrow_back_ios, color: Colors.black),
@ -143,9 +140,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
child: Center( child: Center(
child: Text( child: Text(
'作业', '作业',
style: TextStyle( style: TextStyle(fontSize: 14.sp, color: isJob ? Color(0xFF7491FD) : Color(0xFF505E6E)),
fontSize: 14.sp,
color: isJob ? Color(0xFF7491FD) : Color(0xFF505E6E)),
)), )),
), ),
), ),
@ -170,10 +165,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
child: Center( child: Center(
child: Text( child: Text(
'考试', '考试',
style: TextStyle( style: TextStyle(fontSize: 14.sp, color: !isJob ? Color(0xFF7491FD) : Color(0xFF505E6E)),
fontSize: 14.sp,
color:
!isJob ? Color(0xFF7491FD) : Color(0xFF505E6E)),
)), )),
), ),
), ),
@ -181,17 +173,16 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
), ),
), ),
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r),
vertical: 10.r, horizontal: 14.r), padding: EdgeInsets.only(top: 10.r, left: 10.r, right: 10.r, bottom: 10.r),
padding: EdgeInsets.only(top: 10.r,left: 10.r,right: 10.r,bottom: 10.r), decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10.r)), color: Colors.white),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('总览:',style: TextStyle(fontSize: 12.sp,color: Color(0xFF7491FD),fontWeight: FontWeight.w600),), Text(
'总览:',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF7491FD), fontWeight: FontWeight.w600),
),
progressBar(context, progressBar(context,
title: '客观题正确率:', title: '客观题正确率:',
color: Color(0xFFB8C7FF), color: Color(0xFFB8C7FF),
@ -214,7 +205,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
), ),
), ),
/* SizedBox( /* SizedBox(
height: 5.r, height: 5.r,
),*/ ),*/
jobConditionFilter(context, jobConditionFilter(context,
@ -222,16 +213,11 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
jobType: isJob ? 1 : 2, jobType: isJob ? 1 : 2,
customTimeStr: customTimeStr, customTimeStr: customTimeStr,
customTime: tabController.index != 3 || customTime: tabController.index != 3 ||
((endDataTime == null || endDataTime == '') && ((endDataTime == null || endDataTime == '') && (startDataTime == null || startDataTime == ''))
(startDataTime == null || startDataTime == ''))
? null ? null
: PickerDateRange( : PickerDateRange(
startDataTime == null || startDataTime == '' startDataTime == null || startDataTime == '' ? null : DateTime.parse(startDataTime!),
? null endDataTime == null || endDataTime == '' ? null : DateTime.parse(endDataTime!),
: DateTime.parse(startDataTime!),
endDataTime == null || endDataTime == ''
? null
: DateTime.parse(endDataTime!),
), onTimeFilter: (String? startTime, String? endTime) { ), onTimeFilter: (String? startTime, String? endTime) {
EasyLoading.show(status: 'loading...'); EasyLoading.show(status: 'loading...');
if (startTime == null && endTime == null) { if (startTime == null && endTime == null) {
@ -253,73 +239,76 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
// _refreshController2.callRefresh(); // _refreshController2.callRefresh();
}, refreshTime: (value) { }, refreshTime: (value) {
if (value != null && value.startDate != null) { if (value != null && value.startDate != null) {
customTimeStr = customTimeStr = value.startDate?.toString().substring(0, 10) ?? '';
value.startDate?.toString().substring(0, 10) ?? '';
setState(() {}); setState(() {});
if (value.endDate != null) { if (value.endDate != null) {
if (!isPad() && value.startDate!.year == value.endDate!.year) { if (!isPad() && value.startDate!.year == value.endDate!.year) {
customTimeStr = value.startDate.toString().substring(5, 10) + customTimeStr =
'~${value.endDate.toString().substring(5, 10)}'; value.startDate.toString().substring(5, 10) + '~${value.endDate.toString().substring(5, 10)}';
setState(() {}); setState(() {});
} else { } else {
customTimeStr = customTimeStr = '$customTimeStr~${value.endDate?.toString().substring(0, 10)}';
'$customTimeStr~${value.endDate?.toString().substring(0, 10)}';
setState(() {}); setState(() {});
} }
} }
} }
}), }),
Padding( Padding(
padding: EdgeInsets.only(top: 14.r,right: 14.r), padding: EdgeInsets.only(top: 14.r, right: 14.r),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Text( Text(
'注:', '注:',
style: TextStyle( style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)),
fontSize: 8.sp, color: Color(0xFF8B8B8B)),
), ),
Container( Container(
width:10.r, width: 10.r,
height: 10.r, height: 10.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.r)), borderRadius: BorderRadius.all(Radius.circular(5.r)),
// color: Color(0xFF4CC793), // color: Color(0xFF4CC793),
border: Border.all(width: 1.r,color: Color(0xFF4CC793)), border: Border.all(width: 1.r, color: Color(0xFF4CC793)),
), ),
), ),
SizedBox(width: 2.r,), SizedBox(
width: 2.r,
),
Text( Text(
'正确', '正确',
style: TextStyle( style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)),
fontSize: 8.sp, color: Color(0xFF8B8B8B)), ),
SizedBox(
width: 15.r,
), ),
SizedBox(width: 15.r,),
Container( Container(
width:10.r, width: 10.r,
height: 10.r, height: 10.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.r)), borderRadius: BorderRadius.all(Radius.circular(5.r)),
// color: Color(0xFFFF7474), // color: Color(0xFFFF7474),
border: Border.all(width: 1.r,color: Color(0xFFFF7474)), border: Border.all(width: 1.r, color: Color(0xFFFF7474)),
), ),
), ),
SizedBox(width: 2.r,), SizedBox(
width: 2.r,
),
Text( Text(
'错误', '错误',
style: TextStyle( style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)),
fontSize: 8.sp, color: Color(0xFF8B8B8B)), ),
SizedBox(
width: 15.r,
), ),
SizedBox(width: 15.r,),
Container( Container(
width:10.r, width: 10.r,
height: 10.r, height: 10.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.r)), borderRadius: BorderRadius.all(Radius.circular(5.r)),
// color: Color(0xFF666666), // color: Color(0xFF666666),
border: Border.all(width: 1.r,color: Color(0xFF666666)), border: Border.all(width: 1.r, color: Color(0xFF666666)),
// border: Border.all(width: 1.r,color: Colors.grey), // border: Border.all(width: 1.r,color: Colors.grey),
/* boxShadow: [ /* boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey, color: Colors.grey,
offset: Offset(1.w, 1.h), //y轴偏移量 offset: Offset(1.w, 1.h), //y轴偏移量
@ -329,27 +318,31 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
],*/ ],*/
), ),
), ),
SizedBox(width: 2.r,), SizedBox(
width: 2.r,
),
Text( Text(
'已作答未批阅', '已作答未批阅',
style: TextStyle( style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)),
fontSize: 8.sp, color: Color(0xFF8B8B8B)), ),
SizedBox(
width: 15.r,
), ),
SizedBox(width: 15.r,),
Container( Container(
width:10.r, width: 10.r,
height: 10.r, height: 10.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.r)), borderRadius: BorderRadius.all(Radius.circular(5.r)),
border: Border.all(width: 1.r,color: Color(0xFFDDDDDD)), border: Border.all(width: 1.r, color: Color(0xFFDDDDDD)),
// color: Color(0xFFDDDDDD), // color: Color(0xFFDDDDDD),
), ),
), ),
SizedBox(width: 2.r,), SizedBox(
width: 2.r,
),
Text( Text(
'未做', '未做',
style: TextStyle( style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)),
fontSize: 8.sp, color: Color(0xFF8B8B8B)),
), ),
], ],
), ),
@ -383,8 +376,8 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
itemBuilder: (context, index) { itemBuilder: (context, index) {
Items item = dataList[index]; Items item = dataList[index];
return InkWell( return InkWell(
onTap: (){ onTap: () {
/* RouterManager.router.navigateTo( /* RouterManager.router.navigateTo(
context, context,
RouterManager.quickDataCheckPath + RouterManager.quickDataCheckPath +
'?gradeName=${Uri.encodeComponent(item.gradeName)}&className=${Uri.encodeComponent(item.className)}&jobId=${item.id}', '?gradeName=${Uri.encodeComponent(item.gradeName)}&className=${Uri.encodeComponent(item.className)}&jobId=${item.id}',
@ -398,16 +391,11 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
); );
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r),
vertical: 5.r, horizontal: 14.r), padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r),
padding: EdgeInsets.symmetric(
vertical: 14.r, horizontal: 10.r),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(10.r)),
BorderRadius.all(Radius.circular(10.r)), color: item.allNotDone ? Color(0xFFFFEDD3) : Colors.white),
color: item.allNotDone
? Color(0xFFFFEDD3)
: Colors.white),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -422,10 +410,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.only(left: 2.w), padding: EdgeInsets.only(left: 2.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isJob color: isJob ? const Color.fromRGBO(104, 136, 253, 1) : Color(0xFFFFA116),
? const Color.fromRGBO(
104, 136, 253, 1)
: Color(0xFFFFA116),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(14.r), topLeft: Radius.circular(14.r),
topRight: Radius.circular(3.r), topRight: Radius.circular(3.r),
@ -436,17 +421,13 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
margin: EdgeInsets.only(right: 4.w), margin: EdgeInsets.only(right: 4.w),
child: Text( child: Text(
isJob ? '作业' : '考试', isJob ? '作业' : '考试',
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: Colors.white),
fontSize: 10.sp,
color: Colors.white),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
item.name, item.name,
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF464646)),
fontSize: 12.sp,
color: Color(0xFF464646)),
)), )),
// SizedBox(width: 5.r,), // SizedBox(width: 5.r,),
// Text('2024.1',style: TextStyle(fontSize: 12.sp,color: Color(0xFF5B5B5B)),), // Text('2024.1',style: TextStyle(fontSize: 12.sp,color: Color(0xFF5B5B5B)),),
@ -455,18 +436,13 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
width: 40.r, width: 40.r,
height: 20.r, height: 20.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(4.r)),
Radius.circular(4.r)), border: Border.all(width: 1.r, color: Color(0xFF4CC793)),
border: Border.all(
width: 1.r,
color: Color(0xFF4CC793)),
), ),
child: Center( child: Center(
child: Text( child: Text(
item.subjectName, item.subjectName,
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: Color(0xFF4CC793)),
fontSize: 10.sp,
color: Color(0xFF4CC793)),
)), )),
), ),
], ],
@ -479,9 +455,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
children: [ children: [
Text( Text(
'客:', '客:',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF5B5B5B)),
fontSize: 12.sp,
color: Color(0xFF5B5B5B)),
), ),
SizedBox( SizedBox(
width: 5.r, width: 5.r,
@ -493,11 +467,8 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
alignment: WrapAlignment.start, alignment: WrapAlignment.start,
spacing: 8, spacing: 8,
runSpacing: 5, runSpacing: 5,
children: List.generate( children: List.generate(item.objectiveDtls.length, (i) {
item.objectiveDtls.length, SubjectiveDtls subjective = item.objectiveDtls[i];
(i) {
SubjectiveDtls subjective =
item.objectiveDtls[i];
return Container( return Container(
width: 20.r, width: 20.r,
height: 20.r, height: 20.r,
@ -505,44 +476,26 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
color: Colors.transparent, color: Colors.transparent,
border: Border.all( border: Border.all(
width: 1.r, width: 1.r,
color: subjective color: subjective.state == 0
.state == ? Color(0xFFDDDDDD)
0 : subjective.state == 3
? Color( ? Color(0xFF666666)
0xFFDDDDDD) : subjective.state == 1
: subjective.state == ? Color(0xFFFF7474)
3 : Color(0xFF4CC793)),
? Color( borderRadius: BorderRadius.all(Radius.circular(10.r))),
0xFF666666)
: subjective.state ==
1
? Color(
0xFFFF7474)
: Color(
0xFF4CC793)),
borderRadius:
BorderRadius.all(
Radius.circular(
10.r))),
child: Center( child: Center(
child: Text( child: Text(
subjective.questionNo, subjective.questionNo,
style: TextStyle( style: TextStyle(
fontSize: 10.r, fontSize: 10.r,
color: subjective color: subjective.state == 0
.state ==
0
? Color(0xFFDDDDDD) ? Color(0xFFDDDDDD)
: subjective.state == : subjective.state == 3
3 ? Color(0xFF666666)
? Color( : subjective.state == 1
0xFF666666) ? Color(0xFFFF7474)
: subjective.state == : Color(0xFF4CC793)),
1
? Color(
0xFFFF7474)
: Color(
0xFF4CC793)),
)), )),
); );
}), }),
@ -550,9 +503,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
) )
: Text( : Text(
'', '',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF5B5B5B)),
fontSize: 12.sp,
color: Color(0xFF5B5B5B)),
), ),
], ],
), ),
@ -564,9 +515,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
children: [ children: [
Text( Text(
'主:', '主:',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF5B5B5B)),
fontSize: 12.sp,
color: Color(0xFF5B5B5B)),
), ),
SizedBox( SizedBox(
width: 5.r, width: 5.r,
@ -578,11 +527,8 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
alignment: WrapAlignment.start, alignment: WrapAlignment.start,
spacing: 8, spacing: 8,
runSpacing: 5, runSpacing: 5,
children: List.generate( children: List.generate(item.subjectiveDtls.length, (i) {
item.subjectiveDtls.length, SubjectiveDtls subjective = item.subjectiveDtls[i];
(i) {
SubjectiveDtls subjective =
item.subjectiveDtls[i];
return Container( return Container(
width: 20.r, width: 20.r,
height: 20.r, height: 20.r,
@ -590,44 +536,26 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
color: Colors.transparent, color: Colors.transparent,
border: Border.all( border: Border.all(
width: 1.r, width: 1.r,
color: subjective color: subjective.state == 0
.state == ? Color(0xFFDDDDDD)
0 : subjective.state == 3
? Color( ? Color(0xFF666666)
0xFFDDDDDD) : subjective.state == 1
: subjective.state == ? Color(0xFFFF7474)
3 : Color(0xFF4CC793)),
? Color( borderRadius: BorderRadius.all(Radius.circular(10.r))),
0xFF666666)
: subjective.state ==
1
? Color(
0xFFFF7474)
: Color(
0xFF4CC793)),
borderRadius:
BorderRadius.all(
Radius.circular(
10.r))),
child: Center( child: Center(
child: Text( child: Text(
subjective.questionNo, subjective.questionNo,
style: TextStyle( style: TextStyle(
fontSize: 10.r, fontSize: 10.r,
color: subjective color: subjective.state == 0
.state ==
0
? Color(0xFFDDDDDD) ? Color(0xFFDDDDDD)
: subjective.state == : subjective.state == 3
3 ? Color(0xFF666666)
? Color( : subjective.state == 1
0xFF666666) ? Color(0xFFFF7474)
: subjective.state == : Color(0xFF4CC793)),
1
? Color(
0xFFFF7474)
: Color(
0xFF4CC793)),
)), )),
); );
}), }),
@ -635,9 +563,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
) )
: Text( : Text(
'', '',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF5B5B5B)),
fontSize: 12.sp,
color: Color(0xFF5B5B5B)),
), ),
], ],
), ),
@ -695,8 +621,7 @@ Widget progressBar(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
if (title == '总正确率:') if (title == '总正确率:') quickText('确率', color: Colors.transparent, size: fontSize),
quickText('确率', color: Colors.transparent, size: fontSize),
quickText(title, color: Color(0xFF8B8B8B), size: fontSize), quickText(title, color: Color(0xFF8B8B8B), size: fontSize),
Expanded( Expanded(
flex: 1, flex: 1,
@ -761,8 +686,7 @@ Widget jobConditionFilter(BuildContext context,
var customTimeState = PickerDateRange(null, null); var customTimeState = PickerDateRange(null, null);
print('customTime=${customTime}'); print('customTime=${customTime}');
if (customTime != null) { if (customTime != null) {
customTimeState = PickerDateRange( customTimeState = PickerDateRange(customTime!.startDate != null ? customTime!.startDate : null,
customTime!.startDate != null ? customTime!.startDate : null,
customTime!.endDate != null ? customTime!.endDate : null); customTime!.endDate != null ? customTime!.endDate : null);
} }
@ -798,9 +722,7 @@ Widget jobConditionFilter(BuildContext context,
nextMonth = 1; nextMonth = 1;
now = now.add(Duration(days: 31 - now.day)); // now = now.add(Duration(days: 31 - now.day)); //
} else { } else {
now = now.add(Duration( now = now.add(Duration(days: DateTime(now.year, nextMonth, 0).day - now.day)); //
days: DateTime(now.year, nextMonth, 0).day -
now.day)); //
} }
return now; return now;
} }
@ -839,9 +761,7 @@ Widget jobConditionFilter(BuildContext context,
return Center( return Center(
child: Container( child: Container(
color: Colors.white, color: Colors.white,
width: isPad() width: isPad() ? ScreenUtil().screenWidth / 2 : ScreenUtil().screenWidth / 1.3,
? ScreenUtil().screenWidth / 2
: ScreenUtil().screenWidth / 1.3,
height: ScreenUtil().screenHeight / 2, height: ScreenUtil().screenHeight / 2,
child: SfDateRangePicker( child: SfDateRangePicker(
showActionButtons: true, showActionButtons: true,

View File

@ -1,70 +1,61 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AutoDrawer extends StatefulWidget { class AutoDrawer extends StatefulWidget {
final double elevation;
final Widget child;
final String? semanticLabel;
// 60%
final double widthPercent;
final DrawerCallback? callback;
const AutoDrawer({
Key? key,
this.elevation = 16.0,
required this.child,
this.semanticLabel,
this.widthPercent = 0.6,
this.callback,
}) : super(key: key);
@override
_AutoDrawerState createState() => _AutoDrawerState();
}
final double elevation; class _AutoDrawerState extends State<AutoDrawer> {
final Widget child; @override
final String? semanticLabel; void initState() {
// 60% if (widget.callback != null) {
final double widthPercent; //
final DrawerCallback? callback; widget.callback!(true);
const AutoDrawer({ }
Key? key, super.initState();
this.elevation = 16.0,
required this.child,
this.semanticLabel,
this.widthPercent = 0.6,
this.callback,
}) :super(key: key);
@override
_AutoDrawerState createState() => _AutoDrawerState();
} }
class _AutoDrawerState extends State<AutoDrawer> { @override
void dispose() {
@override if (widget.callback != null) {
void initState() { //
if(widget.callback!=null){ widget.callback!(false);
//
widget.callback!(true);
}
super.initState();
}
@override
void dispose() {
if(widget.callback!=null){
//
widget.callback!(false);
}
super.dispose();
} }
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
assert(debugCheckHasMaterialLocalizations(context)); assert(debugCheckHasMaterialLocalizations(context));
String? label = widget.semanticLabel; String? label = widget.semanticLabel ?? MaterialLocalizations.of(context).drawerLabel;
switch (defaultTargetPlatform) { final double _width = MediaQuery.of(context).size.width * widget.widthPercent;
case TargetPlatform.iOS: return Semantics(
label = widget.semanticLabel; scopesRoute: true,
break; namesRoute: true,
case TargetPlatform.android: explicitChildNodes: true,
case TargetPlatform.fuchsia: label: label,
label = widget.semanticLabel ?? MaterialLocalizations.of(context)?.drawerLabel; child: ConstrainedBox(
} constraints: BoxConstraints.expand(width: _width),
final double _width = MediaQuery.of(context).size.width * widget.widthPercent; child: Material(
return Semantics( elevation: widget.elevation,
scopesRoute: true, child: widget.child,
namesRoute: true,
explicitChildNodes: true,
label: label,
child: ConstrainedBox(
constraints: BoxConstraints.expand(width: _width),
child: Material(
elevation: widget.elevation,
child: widget.child,
),
), ),
); ),
} );
} }
}

View File

@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.101 version: 1.0.102
environment: environment:
sdk: ">=2.17.1 <3.0.0" sdk: ">=2.17.1 <3.0.0"