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/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/services.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/model/event_bus/job_home_refresh_bus.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';
|
||||
|
||||
part 'job_home.g.dart';
|
||||
|
||||
class JobHome extends StatefulWidget {
|
||||
const JobHome({super.key});
|
||||
|
||||
|
|
@ -35,8 +38,7 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
|||
title: '学生历史作业',
|
||||
image: '',
|
||||
navigationUrl: RouterManager.jobStudentGroupPath,
|
||||
page:'history',
|
||||
|
||||
page: 'history',
|
||||
),
|
||||
EntranceModel(
|
||||
title: '知识点掌握',
|
||||
|
|
@ -52,7 +54,7 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
|||
title: '优先批阅设定',
|
||||
image: '',
|
||||
navigationUrl: RouterManager.jobStudentGroupPath,
|
||||
page:'set',
|
||||
page: 'set',
|
||||
),
|
||||
EntranceModel(
|
||||
title: '批阅设置',
|
||||
|
|
@ -111,6 +113,7 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
|||
centerTitle: true, // 标题居中
|
||||
title: quickText('我的作业管理'),
|
||||
systemOverlayStyle: SystemUiOverlayStyle.dark,
|
||||
elevation: 0,
|
||||
),
|
||||
backgroundColor: Color.fromRGBO(244, 244, 244, 1),
|
||||
body: RefreshIndicator(
|
||||
|
|
@ -133,56 +136,97 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
|||
);
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 40.h, horizontal: 20.w),
|
||||
child: GridView(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 24.r,
|
||||
crossAxisSpacing: 24.r,
|
||||
childAspectRatio: 556 / 200,
|
||||
),
|
||||
children: entrances.map((e) {
|
||||
bool isJob = e.title == '作业批阅';
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 200.h,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/job_home_top_bgm.png'),
|
||||
fit: BoxFit.fill, // 完全填充
|
||||
),
|
||||
),
|
||||
),
|
||||
$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(
|
||||
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),
|
||||
quickText(e.title, size: 12.sp),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}).toList(),
|
||||
// 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(),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
|
@ -197,5 +241,157 @@ class EntranceModel extends Object {
|
|||
String image;
|
||||
String navigationUrl;
|
||||
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