no message
This commit is contained in:
parent
6e2010a7cc
commit
4e812bc5c0
|
|
@ -221,3 +221,4 @@ marking_app/lib/pages/homework_correction/job_knowledge_points.g.dart
|
||||||
marking_app/lib/pages/homework_correction/job_knowledge_points_detail.g.dart
|
marking_app/lib/pages/homework_correction/job_knowledge_points_detail.g.dart
|
||||||
marking_app/lib/common/model/job/job_knowledge_detail_student.g.dart
|
marking_app/lib/common/model/job/job_knowledge_detail_student.g.dart
|
||||||
marking_app/lib/common/model/job/job_knowledge_detail_student.g.dart
|
marking_app/lib/common/model/job/job_knowledge_detail_student.g.dart
|
||||||
|
marking_app/lib/pages/homework_correction/job_home.g.dart
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 229 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 467 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 724 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.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:marking_app/common/mixin/common.dart';
|
import 'package:marking_app/common/mixin/common.dart';
|
||||||
import 'package:marking_app/common/model/event_bus/job_home_refresh_bus.dart';
|
import 'package:marking_app/common/model/event_bus/job_home_refresh_bus.dart';
|
||||||
import 'package:marking_app/common/model/marking/marking_list_params.dart';
|
import 'package:marking_app/common/model/marking/marking_list_params.dart';
|
||||||
|
|
@ -13,6 +14,8 @@ import 'package:badges/badges.dart' as badges;
|
||||||
|
|
||||||
import '../../utils/my_future_builder.dart';
|
import '../../utils/my_future_builder.dart';
|
||||||
|
|
||||||
|
part 'job_home.g.dart';
|
||||||
|
|
||||||
class JobHome extends StatefulWidget {
|
class JobHome extends StatefulWidget {
|
||||||
const JobHome({super.key});
|
const JobHome({super.key});
|
||||||
|
|
||||||
|
|
@ -35,8 +38,7 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
||||||
title: '学生历史作业',
|
title: '学生历史作业',
|
||||||
image: '',
|
image: '',
|
||||||
navigationUrl: RouterManager.jobStudentGroupPath,
|
navigationUrl: RouterManager.jobStudentGroupPath,
|
||||||
page:'history',
|
page: 'history',
|
||||||
|
|
||||||
),
|
),
|
||||||
EntranceModel(
|
EntranceModel(
|
||||||
title: '知识点掌握',
|
title: '知识点掌握',
|
||||||
|
|
@ -52,7 +54,7 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
||||||
title: '优先批阅设定',
|
title: '优先批阅设定',
|
||||||
image: '',
|
image: '',
|
||||||
navigationUrl: RouterManager.jobStudentGroupPath,
|
navigationUrl: RouterManager.jobStudentGroupPath,
|
||||||
page:'set',
|
page: 'set',
|
||||||
),
|
),
|
||||||
EntranceModel(
|
EntranceModel(
|
||||||
title: '批阅设置',
|
title: '批阅设置',
|
||||||
|
|
@ -111,6 +113,7 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
||||||
centerTitle: true, // 标题居中
|
centerTitle: true, // 标题居中
|
||||||
title: quickText('我的作业管理'),
|
title: quickText('我的作业管理'),
|
||||||
systemOverlayStyle: SystemUiOverlayStyle.dark,
|
systemOverlayStyle: SystemUiOverlayStyle.dark,
|
||||||
|
elevation: 0,
|
||||||
),
|
),
|
||||||
backgroundColor: Color.fromRGBO(244, 244, 244, 1),
|
backgroundColor: Color.fromRGBO(244, 244, 244, 1),
|
||||||
body: RefreshIndicator(
|
body: RefreshIndicator(
|
||||||
|
|
@ -133,56 +136,97 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
||||||
);
|
);
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 40.h, horizontal: 20.w),
|
child: Column(
|
||||||
child: GridView(
|
children: [
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
Container(
|
||||||
crossAxisCount: 2,
|
height: 200.h,
|
||||||
mainAxisSpacing: 24.r,
|
width: double.infinity,
|
||||||
crossAxisSpacing: 24.r,
|
decoration: BoxDecoration(
|
||||||
childAspectRatio: 556 / 200,
|
image: DecorationImage(
|
||||||
),
|
image: AssetImage('assets/images/job_home_top_bgm.png'),
|
||||||
children: entrances.map((e) {
|
fit: BoxFit.fill, // 完全填充
|
||||||
bool isJob = e.title == '作业批阅';
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
$TermRow([
|
||||||
|
EntranceModel(
|
||||||
|
title: '答题轨迹',
|
||||||
|
image: '',
|
||||||
|
navigationUrl: '',
|
||||||
|
),
|
||||||
|
EntranceModel(
|
||||||
|
title: '优先批阅设定',
|
||||||
|
image: '',
|
||||||
|
navigationUrl: RouterManager.jobStudentGroupPath,
|
||||||
|
page: 'set',
|
||||||
|
),
|
||||||
|
], data)
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// Expanded(child: Container(
|
||||||
|
// child: ,
|
||||||
|
// )),
|
||||||
|
// Expanded(child: Container()),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// child:
|
||||||
|
// GridView(
|
||||||
|
// padding: EdgeInsets.symmetric(vertical: 30.h, horizontal: 20.w),
|
||||||
|
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
// crossAxisCount: 2,
|
||||||
|
// mainAxisSpacing: 24.r,
|
||||||
|
// crossAxisSpacing: 24.r,
|
||||||
|
// childAspectRatio: 556 / 200,
|
||||||
|
// ),
|
||||||
|
// children: entrances.map((e) {
|
||||||
|
// bool isJob = e.title == '作业批阅';
|
||||||
|
|
||||||
return InkWell(
|
// return InkWell(
|
||||||
onTap: () => easyThrottle('GO_TO_JOB_HOME_NAVIGATION', () {
|
// onTap: () => easyThrottle('GO_TO_JOB_HOME_NAVIGATION', () {
|
||||||
if(e.page != ''){
|
// if (e.page != '') {
|
||||||
RouterManager.router.navigateTo(context, '${e.navigationUrl}?page=${e.page}', transition: getTransition());
|
// RouterManager.router.navigateTo(context, '${e.navigationUrl}?page=${e.page}', transition: getTransition());
|
||||||
}else{
|
// } else {
|
||||||
RouterManager.router.navigateTo(context, e.navigationUrl, transition: getTransition());
|
// RouterManager.router.navigateTo(context, e.navigationUrl, transition: getTransition());
|
||||||
}
|
// }
|
||||||
|
// }),
|
||||||
}),
|
// child: badges.Badge(
|
||||||
child: badges.Badge(
|
// showBadge: isJob && data > 0,
|
||||||
showBadge: isJob && data > 0,
|
// ignorePointer: false,
|
||||||
ignorePointer: false,
|
// badgeContent: quickText(data, color: Colors.white),
|
||||||
badgeContent: quickText(data, color: Colors.white),
|
// badgeAnimation: badges.BadgeAnimation.rotation(
|
||||||
badgeAnimation: badges.BadgeAnimation.rotation(
|
// animationDuration: Duration(seconds: 1),
|
||||||
animationDuration: Duration(seconds: 1),
|
// colorChangeAnimationDuration: Duration(seconds: 1),
|
||||||
colorChangeAnimationDuration: Duration(seconds: 1),
|
// loopAnimation: false,
|
||||||
loopAnimation: false,
|
// curve: Curves.fastOutSlowIn,
|
||||||
curve: Curves.fastOutSlowIn,
|
// colorChangeAnimationCurve: Curves.easeInCubic,
|
||||||
colorChangeAnimationCurve: Curves.easeInCubic,
|
// ),
|
||||||
),
|
// child: Container(
|
||||||
child: Container(
|
// decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
// borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
// border: Border.all(
|
||||||
border: Border.all(
|
// width: 0.5.w,
|
||||||
width: 0.5.w,
|
// color: Color.fromARGB(255, 219, 226, 250),
|
||||||
color: Color.fromARGB(255, 219, 226, 250),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// alignment: Alignment.center,
|
||||||
alignment: Alignment.center,
|
// child: Row(
|
||||||
child: Row(
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
// children: [
|
||||||
children: [
|
// // Image(image: e.image),
|
||||||
// Image(image: e.image),
|
// Icon(
|
||||||
quickText(e.title, size: 12.sp),
|
// const IconData(0xe642, fontFamily: "AlibabaIcon"),
|
||||||
],
|
// size: 12.sp,
|
||||||
),
|
// ),
|
||||||
),
|
// quickText(e.title, size: 12.sp),
|
||||||
));
|
// ],
|
||||||
}).toList(),
|
// ),
|
||||||
|
// ),
|
||||||
|
// ));
|
||||||
|
// }).toList(),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|
@ -197,5 +241,157 @@ class EntranceModel extends Object {
|
||||||
String image;
|
String image;
|
||||||
String navigationUrl;
|
String navigationUrl;
|
||||||
String? page;
|
String? page;
|
||||||
EntranceModel({required this.title, required this.image, required this.navigationUrl,this.page = ''});
|
EntranceModel({required this.title, required this.image, required this.navigationUrl, this.page = ''});
|
||||||
|
}
|
||||||
|
|
||||||
|
@swidget
|
||||||
|
Widget $termRow(BuildContext context, List<EntranceModel> items, int data) {
|
||||||
|
var leng = items.length;
|
||||||
|
Widget childWidget;
|
||||||
|
switch (leng) {
|
||||||
|
case 1:
|
||||||
|
var e = items[0];
|
||||||
|
bool isJob = e.title == '作业批阅';
|
||||||
|
childWidget = InkWell(
|
||||||
|
onTap: () => easyThrottle('GO_TO_JOB_HOME_NAVIGATION', () {
|
||||||
|
if (e.page != '') {
|
||||||
|
RouterManager.router.navigateTo(context, '${e.navigationUrl}?page=${e.page}', transition: getTransition());
|
||||||
|
} else {
|
||||||
|
RouterManager.router.navigateTo(context, e.navigationUrl, transition: getTransition());
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
child: badges.Badge(
|
||||||
|
showBadge: isJob && data > 0,
|
||||||
|
ignorePointer: false,
|
||||||
|
badgeContent: quickText(data, color: Colors.white),
|
||||||
|
badgeAnimation: badges.BadgeAnimation.rotation(
|
||||||
|
animationDuration: Duration(seconds: 1),
|
||||||
|
colorChangeAnimationDuration: Duration(seconds: 1),
|
||||||
|
loopAnimation: false,
|
||||||
|
curve: Curves.fastOutSlowIn,
|
||||||
|
colorChangeAnimationCurve: Curves.easeInCubic,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 0.5.w,
|
||||||
|
color: Color.fromARGB(255, 219, 226, 250),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// Image(image: e.image),
|
||||||
|
Icon(
|
||||||
|
const IconData(0xe642, fontFamily: "AlibabaIcon"),
|
||||||
|
size: 12.sp,
|
||||||
|
),
|
||||||
|
quickText(e.title, size: 12.sp),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
childWidget = Row(
|
||||||
|
children: items.map((e) {
|
||||||
|
var e = items[0];
|
||||||
|
bool isJob = e.title == '作业批阅';
|
||||||
|
return InkWell(
|
||||||
|
onTap: () => easyThrottle('GO_TO_JOB_HOME_NAVIGATION', () {
|
||||||
|
if (e.page != '') {
|
||||||
|
RouterManager.router.navigateTo(context, '${e.navigationUrl}?page=${e.page}', transition: getTransition());
|
||||||
|
} else {
|
||||||
|
RouterManager.router.navigateTo(context, e.navigationUrl, transition: getTransition());
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
child: badges.Badge(
|
||||||
|
showBadge: isJob && data > 0,
|
||||||
|
ignorePointer: false,
|
||||||
|
badgeContent: quickText(data, color: Colors.white),
|
||||||
|
badgeAnimation: badges.BadgeAnimation.rotation(
|
||||||
|
animationDuration: Duration(seconds: 1),
|
||||||
|
colorChangeAnimationDuration: Duration(seconds: 1),
|
||||||
|
loopAnimation: false,
|
||||||
|
curve: Curves.fastOutSlowIn,
|
||||||
|
colorChangeAnimationCurve: Curves.easeInCubic,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 0.5.w,
|
||||||
|
color: Color.fromARGB(255, 219, 226, 250),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// Image(image: e.image),
|
||||||
|
Icon(
|
||||||
|
const IconData(0xe642, fontFamily: "AlibabaIcon"),
|
||||||
|
size: 12.sp,
|
||||||
|
),
|
||||||
|
quickText(e.title, size: 12.sp),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
var e = items[0];
|
||||||
|
bool isJob = e.title == '作业批阅';
|
||||||
|
childWidget = InkWell(
|
||||||
|
onTap: () => easyThrottle('GO_TO_JOB_HOME_NAVIGATION', () {
|
||||||
|
if (e.page != '') {
|
||||||
|
RouterManager.router.navigateTo(context, '${e.navigationUrl}?page=${e.page}', transition: getTransition());
|
||||||
|
} else {
|
||||||
|
RouterManager.router.navigateTo(context, e.navigationUrl, transition: getTransition());
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
child: badges.Badge(
|
||||||
|
showBadge: isJob && data > 0,
|
||||||
|
ignorePointer: false,
|
||||||
|
badgeContent: quickText(data, color: Colors.white),
|
||||||
|
badgeAnimation: badges.BadgeAnimation.rotation(
|
||||||
|
animationDuration: Duration(seconds: 1),
|
||||||
|
colorChangeAnimationDuration: Duration(seconds: 1),
|
||||||
|
loopAnimation: false,
|
||||||
|
curve: Curves.fastOutSlowIn,
|
||||||
|
colorChangeAnimationCurve: Curves.easeInCubic,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 0.5.w,
|
||||||
|
color: Color.fromARGB(255, 219, 226, 250),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// Image(image: e.image),
|
||||||
|
Icon(
|
||||||
|
const IconData(0xe642, fontFamily: "AlibabaIcon"),
|
||||||
|
size: 12.sp,
|
||||||
|
),
|
||||||
|
quickText(e.title, size: 12.sp),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
childWidget = Container();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Container(child: childWidget);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue