登录修改

This commit is contained in:
machuanyu 2024-05-13 14:16:05 +08:00
parent 48e842f113
commit 4cf916e387
59 changed files with 1926 additions and 615 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 942 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

BIN
assets/images/login_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
assets/images/login_pwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,9 +1,11 @@
import 'package:dio/dio.dart' hide Headers; import 'package:dio/dio.dart' hide Headers;
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
import 'package:school_asignment_app/common/job/class_item.dart';
import 'package:school_asignment_app/common/job/common/app_version_model.dart'; import 'package:school_asignment_app/common/job/common/app_version_model.dart';
import 'package:school_asignment_app/common/job/common/base_app_version.dart'; import 'package:school_asignment_app/common/job/common/base_app_version.dart';
import 'package:school_asignment_app/common/job/common/base_page_data.dart'; import 'package:school_asignment_app/common/job/common/base_page_data.dart';
import 'package:school_asignment_app/common/job/enum_subject.dart'; import 'package:school_asignment_app/common/job/enum_subject.dart';
import 'package:school_asignment_app/common/job/student_item.dart';
import 'package:school_asignment_app/common/job/user_info_detail.dart'; import 'package:school_asignment_app/common/job/user_info_detail.dart';
import 'package:school_asignment_app/common/job/work_student.dart'; import 'package:school_asignment_app/common/job/work_student.dart';
import 'package:school_asignment_app/common/job/work_student_params.dart'; import 'package:school_asignment_app/common/job/work_student_params.dart';
@ -21,15 +23,25 @@ abstract class RetrofitClient {
/* start 系统系列接口 */ /* start 系统系列接口 */
@POST("/api/rbac/Auth/Login") @POST("/api/rbac/Auth/DcLogin")
Future toLogin(@Field() String account, @Field() String password); Future toLogin(@Field() String account, @Field() String password);
@GET("/api/rbac/User/GetUser") @GET("/api/rbac/User/GetUser")
Future<UserInfoDetail?> getUser(@Query('userId') String userId); Future<UserInfoDetail?> getUser(@Query('userId') String userId);
//
@GET("/api/hms/Homework/GetList") @GET("/api/hms/Homework/GetList")
Future<WorkStudent> getWorkList(@Queries() WorkStudentParams params); Future<WorkStudent> getWorkList(@Queries() WorkStudentParams params);
//,
@GET("/api/app/Common/GetEnumInfos") @GET("/api/app/Common/GetEnumInfos")
Future<Map<String, List<EnumSubject>>> getEnumSubjectList(@Query('enumNames') String enumNames); Future<Map<String, List<EnumSubject>>> getEnumSubjectList(@Query('enumNames') String enumNames);
//
@GET("/api/rbac/Class/GetTeacherClasses")
Future<List<ClassItem>> getStudentClass();
//
@GET("/api/rbac/Class/GetClassStudents")
Future<StudentItem> getStudentList(@Query('ClassId') String classId);
} }

View File

@ -9,7 +9,7 @@
import 'package:school_asignment_app/common/job/common/base_page.dart'; import 'package:school_asignment_app/common/job/common/base_page.dart';
class RequestConfig { class RequestConfig {
static const _devBaseUrl = "https://dpc-teacher-api.23544.com"; // static const _devBaseUrl = "http://192.168.2.119:1091"; //
static const _proBaseUrl = "https://dpc-teacher-api.23544.com"; // static const _proBaseUrl = "https://dpc-teacher-api.23544.com"; //
static RequestConfig? _instance; static RequestConfig? _instance;

View File

@ -0,0 +1,32 @@
import 'package:json_annotation/json_annotation.dart';
part 'class_item.g.dart';
@JsonSerializable()
class ClassItem extends Object {
@JsonKey(name: 'id')
String id;
@JsonKey(name: 'schoolName')
String schoolName;
@JsonKey(name: 'grade')
int grade;
@JsonKey(name: 'className')
String className;
@JsonKey(name: 'subject')
int? subject;
ClassItem(this.id,this.schoolName,this.grade,this.className,this.subject,);
factory ClassItem.fromJson(Map<String, dynamic> srcJson) => _$ClassItemFromJson(srcJson);
Map<String, dynamic> toJson() => _$ClassItemToJson(this);
}

View File

@ -0,0 +1,104 @@
import 'package:json_annotation/json_annotation.dart';
part 'student_item.g.dart';
@JsonSerializable()
class StudentItem extends Object {
@JsonKey(name: 'items')
List<Items> items;
@JsonKey(name: 'totalCount')
int totalCount;
StudentItem(this.items,this.totalCount,);
factory StudentItem.fromJson(Map<String, dynamic> srcJson) => _$StudentItemFromJson(srcJson);
Map<String, dynamic> toJson() => _$StudentItemToJson(this);
}
@JsonSerializable()
class Items extends Object {
@JsonKey(name: 'id')
String id;
@JsonKey(name: 'studentCode')
String studentCode;
@JsonKey(name: 'name')
String name;
@JsonKey(name: 'gender')
int gender;
@JsonKey(name: 'guardianPhone')
String? guardianPhone;
@JsonKey(name: 'idCard')
String? idCard;
@JsonKey(name: 'penSerial')
String penSerial;
@JsonKey(name: 'isActive')
bool isActive;
@JsonKey(name: 'classStudentId')
String classStudentId;
@JsonKey(name: 'grade')
int grade;
@JsonKey(name: 'classId')
String classId;
@JsonKey(name: 'className')
String className;
@JsonKey(name: 'evaluationLevel')
int evaluationLevel;
@JsonKey(name: 'subjectStatus')
List<SubjectStatus> subjectStatus;
@JsonKey(name: 'creatorName')
String creatorName;
@JsonKey(name: 'creationTime')
String creationTime;
Items(this.id,this.studentCode,this.name,this.gender,this.guardianPhone,this.idCard,this.penSerial,this.isActive,this.classStudentId,this.grade,this.classId,this.className,this.evaluationLevel,this.subjectStatus,this.creatorName,this.creationTime,);
factory Items.fromJson(Map<String, dynamic> srcJson) => _$ItemsFromJson(srcJson);
Map<String, dynamic> toJson() => _$ItemsToJson(this);
}
@JsonSerializable()
class SubjectStatus extends Object {
@JsonKey(name: 'subject')
int subject;
@JsonKey(name: 'evaluationLevel')
int evaluationLevel;
@JsonKey(name: 'priorityAnnotate')
bool priorityAnnotate;
SubjectStatus(this.subject,this.evaluationLevel,this.priorityAnnotate,);
factory SubjectStatus.fromJson(Map<String, dynamic> srcJson) => _$SubjectStatusFromJson(srcJson);
Map<String, dynamic> toJson() => _$SubjectStatusToJson(this);
}

View File

@ -13,8 +13,8 @@ class UserInfo extends Object {
@JsonKey(name: 'is_admin') @JsonKey(name: 'is_admin')
String isAdmin; String isAdmin;
@JsonKey(name: 'admit_year') @JsonKey(name: 'term_year')
String admitYear; String termYear;
@JsonKey(name: 'nbf') @JsonKey(name: 'nbf')
int nbf; int nbf;
@ -32,7 +32,7 @@ class UserInfo extends Object {
this.nameidentifier, this.nameidentifier,
this.givenname, this.givenname,
this.isAdmin, this.isAdmin,
this.admitYear, this.termYear,
this.nbf, this.nbf,
this.exp, this.exp,
this.iss, this.iss,

View File

@ -11,34 +11,34 @@ class UserInfoDetail extends Object {
String name; String name;
@JsonKey(name: 'gender') @JsonKey(name: 'gender')
int gender; int? gender;
@JsonKey(name: 'schoolId') @JsonKey(name: 'schoolId')
String schoolId; String? schoolId;
@JsonKey(name: 'schoolName') @JsonKey(name: 'schoolName')
String schoolName; String schoolName;
@JsonKey(name: 'lastLoginTime') @JsonKey(name: 'lastLoginTime')
String lastLoginTime; String? lastLoginTime;
@JsonKey(name: 'isActive') @JsonKey(name: 'isActive')
bool isActive; bool? isActive;
@JsonKey(name: 'accessFailedCount') @JsonKey(name: 'accessFailedCount')
int accessFailedCount; int? accessFailedCount;
@JsonKey(name: 'lockoutEndDate') @JsonKey(name: 'lockoutEndDate')
String lockoutEndDate; String? lockoutEndDate;
@JsonKey(name: 'creatorName') @JsonKey(name: 'creatorName')
String creatorName; String? creatorName;
@JsonKey(name: 'creationTime') @JsonKey(name: 'creationTime')
String creationTime; String? creationTime;
@JsonKey(name: 'id') @JsonKey(name: 'id')
String id; int id;
UserInfoDetail( UserInfoDetail(
this.account, this.account,

View File

@ -46,7 +46,7 @@ class Items extends Object {
int state; int state;
@JsonKey(name: 'collectRate') @JsonKey(name: 'collectRate')
int collectRate; int? collectRate;
@JsonKey(name: 'annotateRate') @JsonKey(name: 'annotateRate')
double annotateRate; double annotateRate;

View File

@ -90,6 +90,10 @@ class AuthInterceptor extends Interceptor {
headers["x-Authorization"] = xToken!; headers["x-Authorization"] = xToken!;
} }
if ((userInfo?.isExpired() ?? false) && userInfo?.termYear != '') {
headers["term-year"] = userInfo!.termYear;
}
options.headers = headers; options.headers = headers;
return super.onRequest(options, handler); return super.onRequest(options, handler);
} }

View File

@ -22,8 +22,14 @@ class UserStore extends GetxController with RequestToolMixin {
/// ///
Rx<UserInfoDetail?> userDetailInfo = Rx(null); Rx<UserInfoDetail?> userDetailInfo = Rx(null);
//
RxList<EnumSubject> subjectList = RxList(); RxList<EnumSubject> subjectList = RxList();
//
RxList<EnumSubject> gradeList = RxList();
RxInt readOver = 0.obs;
UserStore init() { UserStore init() {
token = StorageService.to.read(AppStorageKey.token.value); token = StorageService.to.read(AppStorageKey.token.value);
xToken = StorageService.to.read(AppStorageKey.xToken.value); xToken = StorageService.to.read(AppStorageKey.xToken.value);
@ -51,9 +57,15 @@ class UserStore extends GetxController with RequestToolMixin {
} else { } else {
Get.toNamed(Routes.login); Get.toNamed(Routes.login);
} }
getEnum();
return this; return this;
} }
void getEnum() async{
await getSubjectList();
await getGradeList();
}
/// token /// token
void setToken(String token) { void setToken(String token) {
this.token = token; this.token = token;
@ -91,6 +103,13 @@ class UserStore extends GetxController with RequestToolMixin {
subjectList.value = res['EnumSubject']!; subjectList.value = res['EnumSubject']!;
} }
//
getGradeList() async {
var res = await getClient().getEnumSubjectList('EnumGrade');
gradeList.value = res['EnumGrade']!;
}
// //
updateUserInfo() async { updateUserInfo() async {
UserInfo? userInfo = UserStore.to.userInfo.value; UserInfo? userInfo = UserStore.to.userInfo.value;

View File

@ -0,0 +1,20 @@
import 'package:school_asignment_app/common/job/enum_subject.dart';
import 'package:school_asignment_app/common/store/user_store.dart';
class EnumUtils{
static String formatSubject(int id) {
if (UserStore.to.subjectList.isEmpty) {
return '';
}
EnumSubject item = UserStore.to.subjectList.firstWhere((element) => element.id == id);
return item.name ?? '';
}
static String formatGrade(int id) {
if (UserStore.to.gradeList.isEmpty) {
return '';
}
EnumSubject item = UserStore.to.gradeList.firstWhere((element) => element.id == id);
return item.name ?? '';
}
}

View File

@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:school_asignment_app/routes/app_pages.dart';
//
class ReturnToHomepage extends StatelessWidget {
final Color? bgColor;
const ReturnToHomepage({super.key,this.bgColor = const Color.fromRGBO(135, 135, 135, 1)});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: (){
// Navigator.of(context).popUntil(ModalRoute.withName(Routes.startPage));
Get.until((route) => route.settings.name == Routes.startPage);
},
child: Container(
padding: EdgeInsets.only(right: 4.5.w),
alignment: Alignment.center,
child: Icon(Icons.home_rounded, size: 22.sp, color: bgColor),
),
);
}
}

View File

@ -93,7 +93,7 @@ class _StartPageState extends State<StartPage> {
return BottomNavigationBar( return BottomNavigationBar(
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
label: '首页', label: '作业',
icon: getItemIcon('assets/images/ic_home_normal.png'), icon: getItemIcon('assets/images/ic_home_normal.png'),
activeIcon: getItemIcon('assets/images/ic_home_press.png'), activeIcon: getItemIcon('assets/images/ic_home_press.png'),
), ),

View File

@ -0,0 +1,10 @@
import 'package:get/get.dart';
import 'class_student_logic.dart';
class ClassStudentBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => ClassStudentLogic());
}
}

View File

@ -0,0 +1,37 @@
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:school_asignment_app/common/job/student_item.dart';
import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'class_student_state.dart';
class ClassStudentLogic extends GetxController with RequestToolMixin{
final ClassStudentState state = ClassStudentState();
late final EasyRefreshController refreshController;
@override
void onInit() {
super.onInit();
state.title.value = Get.arguments['title']??'';
state.classId = Get.arguments['classId']??'';
state.page = Get.arguments['page']??'';
EasyLoading.show(status: 'loading...');
refreshController = EasyRefreshController();
getList();
}
void getList() async{
StudentItem res = await getClient().getStudentList(state.classId);
state.studentList.value = res.items;
EasyLoading.dismiss();
refreshController.finishRefresh();
}
@override
void dispose() {
super.dispose();
refreshController.dispose();
}
}

View File

@ -0,0 +1,13 @@
import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/student_item.dart';
class ClassStudentState {
ClassStudentState() {
///Initialize variables
}
late RxString title = ''.obs;
late final String classId;
late RxList<Items> studentList = RxList();
late String page = '';
}

View File

@ -0,0 +1,340 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/student_item.dart';
import 'package:school_asignment_app/common/utils/utils.dart';
import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart';
import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart';
import 'class_student_logic.dart';
class ClassStudentPage extends StatefulWidget {
const ClassStudentPage({Key? key}) : super(key: key);
@override
State<ClassStudentPage> createState() => _ClassStudentPageState();
}
class _ClassStudentPageState extends State<ClassStudentPage> {
final logic = Get.find<ClassStudentLogic>();
final state = Get
.find<ClassStudentLogic>()
.state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar(
backgroundColor: Colors.white,
title: Obx(() {
return Text(
state.title.value,
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333)),
);
}),
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
actions: const [
ReturnToHomepage(),
],
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10.r,
),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r),
child: EasyRefresh(
firstRefresh: true,
taskIndependence: true,
controller: logic.refreshController,
header: MaterialHeader(),
footer: TaurusFooter(),
onRefresh: () async {
logic.getList();
},
child: Obx((){
return state.studentList.isNotEmpty
? Utils.isPad()
? GridView(
shrinkWrap: true,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 10.r,
crossAxisSpacing: 10.r,
childAspectRatio: 556 / 112,
),
children: List.generate(state.studentList.length, (index) {
Items item = state.studentList[index];
return InkWell(
onTap: (){
// RouterManager.router.navigateTo(context,
// '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
item.name,
style: TextStyle(
fontSize: 12.sp,
color: const Color(0xFF6888FD)),
)),
state.page == 'answerTrajectory'?Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
border: Border.all(width: 1.r,color: const Color(0xFFFFA41E)),
borderRadius: BorderRadius.all(Radius.circular(20.r)),
),
child: Center(child: Text('详情',style: TextStyle(fontSize: 10.r,color: Color(0xFFFFA41E))),
)):state.page == 'history'?Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
color: const Color(0xFF6888FD),
borderRadius: BorderRadius.all(Radius.circular(20.r))
),
child: Center(child: Text('历史作业',style: TextStyle(fontSize: 10.r,color: Colors.white),)),
):
item.evaluationLevel == 1
?
InkWell(
onTap: () {
/* isClicking = true;
setJobReadLevel(
item.studentGroupDetailId, 0);
EasyLoading.show(
status: 'loading...');*/
},
child:Container(
height: 20.r,
width: 80.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.r)),
color:const Color(0xFFB7FFE0),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 3.r),
child: Image.asset('assets/images/youx_icon_active.png',width: 14.r,height: 14.r,),
),
Padding(
padding: EdgeInsets.only(top: 2.r,left: 4.r),
child: Text(
'优先批阅',
style: TextStyle(
fontSize: 10.sp,
color: const Color(0xFF4CC793)),
),
),
],
),
),
)
:InkWell(
onTap: () {
/* isClicking = true;
setJobReadLevel(
item.studentGroupDetailId, 1);
EasyLoading.show(
status: 'loading...');*/
},
child: Container(
height: 20.r,
width: 80.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.r)),
color: const Color(0xFFE1E1E1),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 3.r),
child: Image.asset('assets/images/youx_icon_default.png',width: 14.r,height: 14.r,),
),
Padding(
padding: EdgeInsets.only(top: 2.r,left: 4.r),
child: Text(
'优先批阅',
style: TextStyle(
fontSize: 10.sp,
color: const Color(0xFF8A9691)),
),
),
],
),
),
),
],
),
),
);
}),
)
: ListView.builder(
itemBuilder: (context, index) {
Items item = state.studentList[index];
return InkWell(
onTap: (){
// RouterManager.router.navigateTo(context,
// '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 20.r, horizontal: 15.r),
margin: EdgeInsets.only(bottom: 15.r),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
item.name,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6888FD)),
)),
state.page == 'answerTrajectory'?Container(
height: 24.r,
width: 72.r,
decoration: BoxDecoration(
border: Border.all(width: 1.r,color: Color(0xFFFFA41E)),
borderRadius: BorderRadius.all(Radius.circular(20.r)),
),
child: Center(child: Text('详情',style: TextStyle(fontSize: 10.r,color: Color(0xFFFFA41E))),
)):state.page == 'history'?Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
color: Color(0xFF6888FD),
borderRadius: BorderRadius.all(Radius.circular(20.r))
),
child: Center(child: Text('历史作业',style: TextStyle(fontSize: 10.r,color: Colors.white),)),
):
item.evaluationLevel == 1
? InkWell(
onTap: () {
/*isClicking = true;
setJobReadLevel(
item.studentGroupDetailId, 0);
EasyLoading.show(
status: 'loading...');*/
},
child: Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.r)),
color:Color(0xFFB7FFE0),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 3.r),
child: Image.asset('assets/images/youx_icon_active.png',width: 14.r,height: 14.r,),
),
Padding(
padding: EdgeInsets.only(top: 2.r,left: 4.r),
child: Text(
'优先批阅',
style: TextStyle(
fontSize: 10.sp,
color: const Color(0xFF4CC793)),
),
),
],
),
),
)
: InkWell(
onTap: () {
/* setJobReadLevel(
item.studentGroupDetailId, 1);
EasyLoading.show(
status: 'loading...');*/
},
child: Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.r)),
color: const Color(0xFFE1E1E1),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 3.r),
child: Image.asset('assets/images/youx_icon_default.png',width: 14.r,height: 14.r,),
),
Padding(
padding: EdgeInsets.only(top: 2.r,left: 4.r),
child: Text(
'优先批阅',
style: TextStyle(
fontSize: 10.sp,
color: const Color(0xFF8A9691)),
),
),
],
),
),
),
],
),
),
);
},
itemCount: state.studentList.length,
)
: const MyEmptyWidget();
}),
),
),
)
],
),
);
}
@override
void dispose() {
Get.delete<ClassStudentLogic>();
super.dispose();
}
}

View File

@ -0,0 +1,10 @@
import 'package:get/get.dart';
import 'read_over_logic.dart';
class ReadOverBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => ReadOverLogic());
}
}

View File

@ -0,0 +1,133 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/enum_subject.dart';
import 'package:school_asignment_app/common/job/work_student.dart';
import 'package:school_asignment_app/common/job/work_student_params.dart';
import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:school_asignment_app/common/store/user_store.dart';
import 'read_over_state.dart';
class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProviderStateMixin{
final ReadOverState state = ReadOverState();
late TabController tabController;
/* 待阅卷 */
late final EasyRefreshController refreshController1;
late final EasyRefreshController refreshController2;
@override
void onInit() {
super.onInit();
refreshController1 = EasyRefreshController();
refreshController2 = EasyRefreshController();
tabController = TabController(
length: 2,
vsync: this,
);
getList();
}
void getList() async {
WorkStudentParams params = WorkStudentParams(
assessType: state.tabIndex.value,
);
WorkStudent data = await getClient().getWorkList(params);
state.workList.value = data.items;
refreshController1.finishRefresh();
refreshController2.finishRefresh();
print('state.workList.length=');
print(state.workList.length);
}
///
Future<void> onMyRefresh(EasyRefreshController controller, int tab) async {
/* params.page = RequestConfig.basePage.page;
List<JobTaskItem> lists = await getData(controller, params, isReFresh: true);
try {
tab == 1 ? (markingDatas1 = lists) : (markingDatas2 = lists);
} catch (e) {}
toUpState(setState, () {}, mounted);*/
getList();
}
///
Future<void> onMyLoad(EasyRefreshController controller, int tab) async {
/*params.page++;
List<JobTaskItem> lists = await getData(controller, params);
if (lists.isNotEmpty) {
tab == 1 ? markingDatas1.addAll(lists) : markingDatas2.addAll(lists);
toUpState(setState, () {}, mounted);
}*/
}
/* 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();
refreshController1.dispose();
refreshController2.dispose();
}
}

View File

@ -0,0 +1,13 @@
import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/work_student.dart';
class ReadOverState {
ReadOverState() {
///Initialize variables
}
int active = 1;
late RxList<Items> workList = RxList();
late RxInt tabIndex = 0.obs;
late bool completedToRefresh = true;
}

View File

@ -0,0 +1,421 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/work_student.dart';
import 'package:school_asignment_app/common/utils/enum_untils.dart';
import 'package:school_asignment_app/common/utils/utils.dart';
import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart';
import 'package:school_asignment_app/page/global_widget/my_text.dart';
import 'package:school_asignment_app/page/home_page/children/read_over/widget/task_list_item.dart';
import 'read_over_logic.dart';
class ReadOverPage extends StatefulWidget {
const ReadOverPage({Key? key}) : super(key: key);
@override
State<ReadOverPage> createState() => _ReadOverPageState();
}
class _ReadOverPageState extends State<ReadOverPage> {
final logic = Get.find<ReadOverLogic>();
final state = Get.find<ReadOverLogic>().state;
@override
Widget build(BuildContext context) {
return AnnotatedRegion(
value: const SystemUiOverlayStyle(
systemNavigationBarColor: Color(0xFF000000),
systemNavigationBarDividerColor: null,
statusBarColor: Colors.white,
systemNavigationBarIconBrightness: Brightness.light,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.light,
),
child: Scaffold(
backgroundColor: const Color.fromRGBO(244, 244, 244, 1),
body: OrientationBuilder(
builder: (BuildContext context, Orientation orientation) {
return Column(
children: <Widget>[
Container(
color: Colors.white,
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
padding: EdgeInsets.only(bottom: 9.h, top: 4.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 10.w),
child: InkWell(
onTap: () {
Get.back();
},
child: Icon(
Icons.arrow_back_ios_sharp,
size: 16.sp,
),
),
)),
Expanded(
flex: 4,
child: Container(
padding: EdgeInsets.symmetric(vertical: 2.h),
alignment: Alignment.center,
decoration: BoxDecoration(
color: const Color.fromRGBO(243, 243, 243, 1),
borderRadius: BorderRadius.circular(8.r),
),
child: TabBar(
padding: EdgeInsets.zero,
indicatorPadding: EdgeInsets.zero,
indicatorWeight: 0,
labelPadding: EdgeInsets.symmetric(horizontal: 2.w),
controller: logic.tabController,
unselectedLabelStyle: TextStyle(
fontSize: 14.sp,
color: const Color.fromRGBO(69, 83, 100, 1),
),
labelStyle: TextStyle(
fontSize: 14.sp,
color: const Color.fromRGBO(104, 136, 253, 1),
),
// labelColor: const Color.fromRGBO(45, 56, 76, 1),
indicator: const BoxDecoration(),
onTap: (index) {
state.tabIndex.value = index;
if (index == 1 && state.completedToRefresh) {
//
// _refreshController2.callRefresh();
state.completedToRefresh = false;
}
logic.getList();
},
tabs: <Widget>[
Tab(
iconMargin: EdgeInsets.zero,
height: 34.h,
child: Obx(() {
return Container(
width: 140.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: state.tabIndex.value == 0 ? const Color.fromRGBO(255, 255, 255, 1) : null,
borderRadius: BorderRadius.all(Radius.circular(8.r)),
),
child: quickText(
'待批阅',
size: 14.sp,
color: state.tabIndex.value == 0 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
fontWeight: state.tabIndex.value == 0 ? FontWeight.bold : null,
),
);
}),
),
Tab(
iconMargin: EdgeInsets.zero,
height: 34.h,
child: Obx(() {
return Container(
width: 140.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: state.tabIndex.value == 1 ? const Color.fromRGBO(255, 255, 255, 1) : null,
borderRadius: BorderRadius.all(Radius.circular(8.r)),
),
child: quickText(
'已批阅',
size: 14.sp,
color: state.tabIndex.value == 1 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
fontWeight: state.tabIndex.value == 1 ? FontWeight.bold : null,
),
);
}),
),
],
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
/* RouterManager.router
.navigateTo(
context, RouterManager.jobStudentGroupPath,
transition: getTransition());*/
},
child: Icon(const IconData(0xe63e, fontFamily: "AlibabaIcon"), color: const Color.fromRGBO(44, 48, 63, 1), size: 24.sp),
),
),
],
),
),
/* if (state.tabIndex.value == 1)
$CompletedJobConditionFilter(
controller: _tabController2,
jobType: params2.markingType ?? 1,
customTime: _tabController2.index != 3 ||
(params2.startTime == null && params2.endTime == null)
? null
: PickerDateRange(
params2.startTime == null ? null : DateTime.parse(
params2.startTime!),
params2.endTime == null ? null : DateTime.parse(params2
.endTime!),
),
onJobTypeTap: (int jobTypeVal) {
params2.markingType = jobTypeVal;
_refreshController2.callRefresh();
},
onTimeFilter: (String? startTime, String? endTime) {
if (startTime == null && endTime == null &&
_tabController2.index == 3) {
_tabController2.animateTo(0);
}
params2.endTime = endTime;
params2.startTime = startTime;
_refreshController2.callRefresh();
},
),*/
Expanded(
child: IndexedStack(
index: state.tabIndex.value,
children: <Widget>[
$easyRefresh(
controller: logic.refreshController1,
tab: 1,
type: state.active,
data: state.workList,
onLoad: logic.onMyLoad,
onRefresh: logic.onMyRefresh,
logic: logic),
$easyRefresh(
controller: logic.refreshController2,
tab: 2,
type: state.active,
data: state.workList,
onLoad: logic.onMyLoad,
onRefresh: logic.onMyRefresh,
logic: logic),
],
)),
],
);
},
),
),
);
}
@override
void dispose() {
Get.delete<ReadOverLogic>();
super.dispose();
}
}
///
/// OnRefreshCallback? onRefresh
///
@swidget
Widget $easyRefresh({
required EasyRefreshController controller,
required Future<void> Function(EasyRefreshController controller, int tab) onRefresh,
required Future<void> Function(EasyRefreshController controller, int tab) onLoad,
required List<Items> data,
required int tab,
required int type,
required ReadOverLogic logic,
}) {
bool completed = tab == 2; //
bool isPadFlag = Utils.isPad();
return Obx(() {
return EasyRefresh(
firstRefresh: false,
taskIndependence: true,
/*enableControlFinishLoad: true,
enableControlFinishRefresh: true,*/
emptyWidget: data.isEmpty ? const MyEmptyWidget() : null,
controller: controller,
header: MaterialHeader(),
footer: TaurusFooter(),
child: completed && isPadFlag
? GridView(
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, //widget
mainAxisSpacing: 10.h,
crossAxisSpacing: 6.w,
childAspectRatio: 1.81 //1widget
),
children: List.generate(data.length, (index) {
Items item = data[index];
String subjectName = EnumUtils.formatSubject(item.subject);
return $reviewedItem(jobTaskItem: item, type: type, subjectName: subjectName);
}),
)
: ListView.builder(
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
itemBuilder: (context, index) {
Items item = data[index];
return TaskListItem(
completed: completed,
jobTaskItem: item,
type: type,
);
/*HomeworkTasksViewItem(
completed: completed,
jobTaskItem: data[index],
call: () => controller.callRefresh(),
);*/
},
itemCount: data.length,
),
onRefresh: () => onRefresh(controller, tab),
onLoad: () => onLoad(controller, tab),
);
});
}
@swidget
Widget $reviewedItem({required Items jobTaskItem, required int type, required String subjectName}) {
EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w);
return InkWell(
onTap: () {
/* String url =
'${RouterManager.jobListParticipateInClassPath}?&jobId=${jobTaskItem.id}&genderName=${Uri.encodeComponent(jobTaskItem.genderName)}&jobName=${Uri.encodeComponent(jobTaskItem.title)}&completed=${true}';
RouterManager.router.navigateTo(context, url, transition: getTransition());*/
},
child: Container(
padding: EdgeInsets.only(top: 10.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: Colors.white,
boxShadow: const [
BoxShadow(
color: Color.fromRGBO(210, 216, 241, 1),
offset: Offset.zero, //y轴偏移量
blurRadius: 5.8, //
spreadRadius: 0, //
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Padding(
padding: padEdg,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 32.w,
height: 18.h,
alignment: Alignment.center,
padding: EdgeInsets.only(left: 2.w),
decoration: BoxDecoration(
color: type == 1 ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(14.r),
topRight: Radius.circular(3.r),
bottomLeft: Radius.circular(4.r),
bottomRight: Radius.circular(4.r),
),
),
margin: EdgeInsets.only(right: 4.w),
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(jobTaskItem.name, size: 14.sp, color: const Color.fromRGBO(70, 70, 70, 1), maxLines: 2),
)
],
),
),
Padding(
padding: padEdg,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
quickText(
jobTaskItem.publishTime.substring(0, 10),
color: const Color.fromRGBO(97, 97, 97, 1),
size: 10.sp,
fontWeight: FontWeight.w500,
),
quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500),
quickText(
'参与班级:',
color: const Color.fromRGBO(76, 199, 147, 1),
size: 9.sp,
),
quickText(
'${jobTaskItem.classCount}',
color: const Color.fromRGBO(76, 199, 147, 1),
size: 10.sp,
),
quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 10.sp, fontWeight: FontWeight.w500),
quickText(
'科目:$subjectName',
color: const Color.fromRGBO(116, 145, 253, 1),
size: 9.sp,
),
],
),
),
/*Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: FavoriteButton(
jobTaskItem.id,
jobTaskItem.title,
margin: EdgeInsets.only(top: 4.h, bottom: 6.h),
),
),*/
GestureDetector(
onTap: () {
/* RouterManager.router.navigateTo(
context,
RouterManager.jobReportPagePath +
'?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}',
transition: getTransition(),
);*/
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
color: Colors.white,
boxShadow: const [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.15),
offset: Offset(0, -0.0001), //y轴偏移量
blurRadius: 4, //
spreadRadius: 0, //
)
],
),
child: Row(children: [
Expanded(
child: Container(
alignment: Alignment.center,
child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 11.sp),
),
),
]),
),
),
],
),
),
);
}

View File

@ -1,19 +1,17 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:percent_indicator/percent_indicator.dart'; import 'package:percent_indicator/percent_indicator.dart';
import 'package:school_asignment_app/common/job/work_student.dart'; import 'package:school_asignment_app/common/job/work_student.dart';
import 'package:school_asignment_app/common/utils/enum_untils.dart';
import 'package:school_asignment_app/page/global_widget/my_text.dart'; import 'package:school_asignment_app/page/global_widget/my_text.dart';
import 'package:school_asignment_app/page/home_page/home_logic.dart';
import 'package:school_asignment_app/common/utils/utils.dart'; import 'package:school_asignment_app/common/utils/utils.dart';
class TaskListItem extends StatefulWidget { class TaskListItem extends StatefulWidget {
final bool completed; final bool completed;
final Items jobTaskItem; final Items jobTaskItem;
final int type; final int type;
final HomeLogic logic;
const TaskListItem({Key? key,required this.completed,required this.jobTaskItem,required this.type,required this.logic}) : super(key: key); const TaskListItem({Key? key,required this.completed,required this.jobTaskItem,required this.type}) : super(key: key);
@override @override
State<TaskListItem> createState() => _TaskListItemState(); State<TaskListItem> createState() => _TaskListItemState();
@ -106,7 +104,7 @@ class _TaskListItemState extends State<TaskListItem> {
), ),
quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 12.sp, fontWeight: FontWeight.w500), quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 12.sp, fontWeight: FontWeight.w500),
quickText( quickText(
'科目:${widget.logic.formatSubject(widget.jobTaskItem.subject)}' , '科目:${EnumUtils.formatSubject(widget.jobTaskItem.subject)}' ,
color: const Color.fromRGBO(116, 145, 253, 1), color: const Color.fromRGBO(116, 145, 253, 1),
size: 12.sp, size: 12.sp,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -225,7 +223,7 @@ class _TaskListItemState extends State<TaskListItem> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
quickText( quickText(
widget.logic.formatSubject(widget.jobTaskItem.subject), EnumUtils.formatSubject(widget.jobTaskItem.subject),
color: const Color.fromRGBO(97, 97, 97, 1), color: const Color.fromRGBO(97, 97, 97, 1),
size: 12.sp, size: 12.sp,
), ),

View File

@ -0,0 +1,72 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:school_asignment_app/page/home_page/home_logic.dart';
import 'package:school_asignment_app/routes/app_pages.dart';
class TopUserInfo extends StatelessWidget {
TopUserInfo({Key? key}) : super(key: key);
final controller = Get.find<HomeLogic>;
final state = Get.find<HomeLogic>().state;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Get.toNamed(Routes.myInfo);
},
child: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 4.h,
left: 14.w,
right: 14.w,
bottom: 19.h),
child: Row(
children: [
Container(
decoration: BoxDecoration(
color: const Color.fromRGBO(245, 246, 251, 1),
borderRadius: BorderRadius.circular(30.r),
),
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(50.w),
child: Container(
alignment: Alignment.center,
color: const Color.fromRGBO(163, 211, 255, 1),
padding: EdgeInsets.all(1.r),
child: Image.asset('assets/images/login_logo.png',
width: 32.w, height: 32.w),
),
),
Container(
margin: EdgeInsets.only(left: 10.h),
child: Text(
state.userInfo.value!.givenname,
style: TextStyle(
fontSize: 15.sp,
color: const Color.fromRGBO(45, 56, 76, 0.9)),
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 4.w),
child: Icon(
Icons.arrow_forward_ios_rounded,
size: 12.sp,
color: const Color.fromRGBO(45, 56, 76, 0.9),
),
),
SizedBox(width: 5.w)
],
),
),
const Expanded(child: SizedBox())
],
),
),
);
}
}

View File

@ -0,0 +1,10 @@
import 'package:get/get.dart';
import 'student_history_work_logic.dart';
class StudentHistoryWorkBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => StudentHistoryWorkLogic());
}
}

View File

@ -0,0 +1,40 @@
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:school_asignment_app/common/job/class_item.dart';
import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:school_asignment_app/routes/app_pages.dart';
import 'student_history_work_state.dart';
class StudentHistoryWorkLogic extends GetxController with RequestToolMixin {
final StudentHistoryWorkState state = StudentHistoryWorkState();
late final EasyRefreshController refreshController;
String nextPage = '';
@override
void onInit() {
super.onInit();
nextPage = Get.arguments['page']??'';
EasyLoading.show(status: 'loading...');
refreshController = EasyRefreshController();
getList();
}
void getList() async {
List<ClassItem> data = await getClient().getStudentClass();
state.clssList.value = data;
EasyLoading.dismiss();
refreshController.finishRefresh();
}
void goNextPage(String id,String title) {
Get.toNamed(Routes.classStudentPage,arguments: {'title':title,'classId':id,'page':nextPage});
}
@override
void dispose() {
super.dispose();
refreshController.dispose();
}
}

View File

@ -0,0 +1,9 @@
import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/class_item.dart';
class StudentHistoryWorkState {
StudentHistoryWorkState() {
///Initialize variables
}
late RxList<ClassItem> clssList = RxList();
}

View File

@ -0,0 +1,62 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart';
import 'package:school_asignment_app/page/home_page/widget/student_group_list.dart';
import 'student_history_work_logic.dart';
class StudentHistoryWorkPage extends StatefulWidget {
const StudentHistoryWorkPage({Key? key}) : super(key: key);
@override
State<StudentHistoryWorkPage> createState() => _StudentHistoryWorkPageState();
}
class _StudentHistoryWorkPageState extends State<StudentHistoryWorkPage> {
final logic = Get.find<StudentHistoryWorkLogic>();
final state = Get.find<StudentHistoryWorkLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar(
backgroundColor: Colors.white,
title: Text(
'我的学生分组',
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333)),
),
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
actions: const [
ReturnToHomepage(),
],
),
body: Padding(
padding: EdgeInsets.only(top: 15.r, left: 14.r, right: 14.r),
child: EasyRefresh(
firstRefresh: false,
taskIndependence: true,
controller: logic.refreshController,
header: MaterialHeader(),
footer: TaurusFooter(),
onRefresh: () async{
logic.getList();
},
child: StudentGroupList(state.clssList,logic.goNextPage),
),
),
);
}
@override
void dispose() {
Get.delete<StudentHistoryWorkLogic>();
super.dispose();
}
}

View File

@ -1,145 +1,28 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/enum_subject.dart';
import 'package:school_asignment_app/common/job/work_student.dart'; import 'package:school_asignment_app/common/job/work_student.dart';
import 'package:school_asignment_app/common/job/work_student_params.dart'; import 'package:school_asignment_app/common/job/work_student_params.dart';
import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:school_asignment_app/common/store/user_store.dart'; import 'package:school_asignment_app/common/store/user_store.dart';
import 'package:school_asignment_app/common/utils/toast_utils.dart';
import 'package:school_asignment_app/page/global_widget/my_text.dart';
import 'home_state.dart'; import 'home_state.dart';
class HomeLogic extends GetxController with RequestToolMixin, GetTickerProviderStateMixin { class HomeLogic extends GetxController with RequestToolMixin, GetTickerProviderStateMixin {
final HomeState state = HomeState(); final HomeState state = HomeState();
late TabController tabController;
/* 待阅卷 */
late final EasyRefreshController refreshController1;
late final EasyRefreshController refreshController2;
@override @override
void onInit() { void onInit() {
super.onInit(); super.onInit();
state.userInfo = UserStore.to.userInfo;
state.active = Get.arguments ?? 1;
refreshController1 = EasyRefreshController();
refreshController2 = EasyRefreshController();
tabController = TabController(
length: 2,
vsync: this,
);
getList(); getList();
} }
void getList() async { void getList() async {
WorkStudentParams params = WorkStudentParams( WorkStudentParams params = WorkStudentParams(
assessType: state.tabIndex.value, assessType: 0,
); );
WorkStudent data = await getClient().getWorkList(params); WorkStudent data = await getClient().getWorkList(params);
state.workList.value = data.items; UserStore.to.readOver.value = data.items.length;
refreshController1.finishRefresh();
refreshController2.finishRefresh();
print('state.workList.length=');
print(state.workList.length);
} }
///
Future<void> onMyRefresh(EasyRefreshController controller, int tab) async {
/* params.page = RequestConfig.basePage.page;
List<JobTaskItem> lists = await getData(controller, params, isReFresh: true);
try {
tab == 1 ? (markingDatas1 = lists) : (markingDatas2 = lists);
} catch (e) {}
toUpState(setState, () {}, mounted);*/
getList();
}
///
Future<void> onMyLoad(EasyRefreshController controller, int tab) async {
/*params.page++;
List<JobTaskItem> lists = await getData(controller, params);
if (lists.isNotEmpty) {
tab == 1 ? markingDatas1.addAll(lists) : markingDatas2.addAll(lists);
toUpState(setState, () {}, mounted);
}*/
}
String formatSubject(int id) {
if (UserStore.to.subjectList.isEmpty) {
return '';
}
EnumSubject item = UserStore.to.subjectList.firstWhere((element) => element.id == id);
return item.name ?? '';
}
/* 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 @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
tabController.dispose();
refreshController1.dispose();
refreshController2.dispose();
} }
} }

View File

@ -1,8 +1,5 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/enum_subject.dart';
import 'package:school_asignment_app/common/job/user_info.dart'; import 'package:school_asignment_app/common/job/user_info.dart';
import 'package:school_asignment_app/common/job/work_student.dart';
import 'package:school_asignment_app/common/store/user_store.dart'; import 'package:school_asignment_app/common/store/user_store.dart';
class HomeState { class HomeState {
@ -11,8 +8,6 @@ class HomeState {
} }
late Rx<UserInfo?> userInfo; late Rx<UserInfo?> userInfo;
int active = 1; late RxInt readOver = UserStore.to.readOver;
late RxList<Items> workList = RxList();
late RxInt tabIndex = 0.obs;
late bool completedToRefresh = true;
} }

View File

@ -1,19 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_easyrefresh/easy_refresh.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:get/get.dart'; import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart'; import 'package:badges/badges.dart' as badges;
import 'package:school_asignment_app/common/job/work_student.dart';
import 'package:school_asignment_app/common/store/app_storage_key.dart';
import 'package:school_asignment_app/common/utils/storage.dart';
import 'package:school_asignment_app/common/utils/utils.dart'; import 'package:school_asignment_app/common/utils/utils.dart';
import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart';
import 'package:school_asignment_app/page/global_widget/global_scaffold.dart';
import 'package:school_asignment_app/page/global_widget/my_text.dart'; import 'package:school_asignment_app/page/global_widget/my_text.dart';
import 'package:school_asignment_app/page/home_page/widget/task_list_item.dart';
import 'package:school_asignment_app/page/home_page/widget/top_user_info.dart';
import 'package:school_asignment_app/routes/app_pages.dart'; import 'package:school_asignment_app/routes/app_pages.dart';
import 'home_logic.dart'; import 'home_logic.dart';
@ -25,7 +17,8 @@ class HomePage extends StatefulWidget {
State<HomePage> createState() => _HomePageState(); State<HomePage> createState() => _HomePageState();
} }
class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin { class _HomePageState extends State<HomePage>
with AutomaticKeepAliveClientMixin {
final logic = Get.find<HomeLogic>(); final logic = Get.find<HomeLogic>();
final state = Get.find<HomeLogic>().state; final state = Get.find<HomeLogic>().state;
@ -35,7 +28,7 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
var spaceWidth = SizedBox(height: ScreenUtil().screenWidth / 19);
return AnnotatedRegion( return AnnotatedRegion(
value: const SystemUiOverlayStyle( value: const SystemUiOverlayStyle(
systemNavigationBarColor: Color(0xFF000000), systemNavigationBarColor: Color(0xFF000000),
@ -45,167 +38,67 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
statusBarIconBrightness: Brightness.dark, statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.light, statusBarBrightness: Brightness.light,
), ),
child: Scaffold( child: ListView(
backgroundColor: const Color.fromRGBO(244, 244, 244, 1), children: [
body: OrientationBuilder( Container(
builder: (BuildContext context, Orientation orientation) { height: 200.h,
return Column( width: double.infinity,
children: <Widget>[ decoration: const BoxDecoration(
Container( image: DecorationImage(
color: Colors.white, image: AssetImage('assets/images/job_home_top_bgm.png'),
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), fit: BoxFit.fill, //
padding: EdgeInsets.only(bottom: 9.h, top: 4.h), ),
child: Row( ),
crossAxisAlignment: CrossAxisAlignment.center, ),
children: [ SizedBox(height: 30.h),
const Expanded(flex: 1, child: SizedBox()), Obx(() {
Expanded( return $TermRow(
flex: 4, context,
child: Container( [
padding: EdgeInsets.symmetric(vertical: 2.h), EntranceModel(
alignment: Alignment.center, title: '作业批阅',
decoration: BoxDecoration( image: 'assets/images/job_home_marking.png',
color: const Color.fromRGBO(243, 243, 243, 1), navigationUrl: Routes.readOverPage),
borderRadius: BorderRadius.circular(8.r), EntranceModel(
), title: '学生历史作业',
child: TabBar( image: 'assets/images/job_home_history.png',
padding: EdgeInsets.zero, navigationUrl: Routes.studentHistoryWorkPage,
indicatorPadding: EdgeInsets.zero, page: 'history',
indicatorWeight: 0,
labelPadding: EdgeInsets.symmetric(horizontal: 2.w),
controller: logic.tabController,
unselectedLabelStyle: TextStyle(
fontSize: 14.sp,
color: const Color.fromRGBO(69, 83, 100, 1),
),
labelStyle: TextStyle(
fontSize: 14.sp,
color: const Color.fromRGBO(104, 136, 253, 1),
),
// labelColor: const Color.fromRGBO(45, 56, 76, 1),
indicator: const BoxDecoration(),
onTap: (index) {
state.tabIndex.value = index;
if (index == 1 && state.completedToRefresh) {
//
// _refreshController2.callRefresh();
state.completedToRefresh = false;
}
logic.getList();
},
tabs: <Widget>[
Tab(
iconMargin: EdgeInsets.zero,
height: 34.h,
child: Obx(() {
return Container(
width: 140.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: state.tabIndex.value == 0 ? const Color.fromRGBO(255, 255, 255, 1) : null,
borderRadius: BorderRadius.all(Radius.circular(8.r)),
),
child: quickText(
'待批阅',
size: 14.sp,
color: state.tabIndex.value == 0 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
fontWeight: state.tabIndex.value == 0 ? FontWeight.bold : null,
),
);
}),
),
Tab(
iconMargin: EdgeInsets.zero,
height: 34.h,
child: Obx(() {
return Container(
width: 140.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: state.tabIndex.value == 1 ? const Color.fromRGBO(255, 255, 255, 1) : null,
borderRadius: BorderRadius.all(Radius.circular(8.r)),
),
child: quickText(
'已批阅',
size: 14.sp,
color: state.tabIndex.value == 1 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
fontWeight: state.tabIndex.value == 1 ? FontWeight.bold : null,
),
);
}),
),
],
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
/* RouterManager.router
.navigateTo(
context, RouterManager.jobStudentGroupPath,
transition: getTransition());*/
},
child: Icon(const IconData(0xe63e, fontFamily: "AlibabaIcon"), color: const Color.fromRGBO(44, 48, 63, 1), size: 24.sp),
),
),
],
), ),
), EntranceModel(
/* if (state.tabIndex.value == 1) title: '知识点点掌握',
$CompletedJobConditionFilter( image: 'assets/images/job_home_knowledge.png',
controller: _tabController2, navigationUrl: '')
jobType: params2.markingType ?? 1, ],
customTime: _tabController2.index != 3 || state.readOver.value);
(params2.startTime == null && params2.endTime == null) }),
? null spaceWidth,
: PickerDateRange( $TermRow(
params2.startTime == null ? null : DateTime.parse( context,
params2.startTime!), [
params2.endTime == null ? null : DateTime.parse(params2 EntranceModel(
.endTime!), title: '答题轨迹',
), image: 'assets/images/job_home_answer_record.png',
onJobTypeTap: (int jobTypeVal) { navigationUrl: ''),
params2.markingType = jobTypeVal; EntranceModel(
_refreshController2.callRefresh(); title: '优先批阅设定',
}, image: 'assets/images/job_home_youxian.png',
onTimeFilter: (String? startTime, String? endTime) { navigationUrl: Routes.studentHistoryWorkPage,
if (startTime == null && endTime == null && page: 'set',
_tabController2.index == 3) { )
_tabController2.animateTo(0);
}
params2.endTime = endTime;
params2.startTime = startTime;
_refreshController2.callRefresh();
},
),*/
Expanded(
child: IndexedStack(
index: state.tabIndex.value,
children: <Widget>[
$easyRefresh(
controller: logic.refreshController1,
tab: 1,
type: state.active,
data: state.workList,
onLoad: logic.onMyLoad,
onRefresh: logic.onMyRefresh,
logic: logic),
$easyRefresh(
controller: logic.refreshController2,
tab: 2,
type: state.active,
data: state.workList,
onLoad: logic.onMyLoad,
onRefresh: logic.onMyRefresh,
logic: logic),
],
)),
], ],
); 0),
}, spaceWidth,
), $TermRow(
context,
[
EntranceModel(
title: '批阅设置',
image: 'assets/images/job_home_marking_set.png',
navigationUrl: '')
],
0),
],
), ),
); );
} }
@ -217,201 +110,148 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
} }
} }
/// class EntranceModel extends Object {
/// OnRefreshCallback? onRefresh String title;
/// String image;
@swidget String navigationUrl;
Widget $easyRefresh({ String? page;
required EasyRefreshController controller,
required Future<void> Function(EasyRefreshController controller, int tab) onRefresh, EntranceModel(
required Future<void> Function(EasyRefreshController controller, int tab) onLoad, {required this.title,
required List<Items> data, required this.image,
required int tab, required this.navigationUrl,
required int type, this.page});
required HomeLogic logic,
}) {
bool completed = tab == 2; //
bool isPadFlag = Utils.isPad();
return Obx(() {
return EasyRefresh(
firstRefresh: false,
taskIndependence: true,
/*enableControlFinishLoad: true,
enableControlFinishRefresh: true,*/
emptyWidget: data.isEmpty ? const MyEmptyWidget() : null,
controller: controller,
header: MaterialHeader(),
footer: TaurusFooter(),
child: completed && isPadFlag
? GridView(
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, //widget
mainAxisSpacing: 10.h,
crossAxisSpacing: 6.w,
childAspectRatio: 1.81 //1widget
),
children: List.generate(data.length, (index) {
Items item = data[index];
String subjectName = logic.formatSubject(item.subject);
return $reviewedItem(jobTaskItem: item, type: type, subjectName: subjectName);
}),
)
: ListView.builder(
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
itemBuilder: (context, index) {
Items item = data[index];
return TaskListItem(
completed: completed,
jobTaskItem: item,
type: type,
logic: logic,
);
/*HomeworkTasksViewItem(
completed: completed,
jobTaskItem: data[index],
call: () => controller.callRefresh(),
);*/
},
itemCount: data.length,
),
onRefresh: () => onRefresh(controller, tab),
onLoad: () => onLoad(controller, tab),
);
});
} }
@swidget @swidget
Widget $reviewedItem({required Items jobTaskItem, required int type, required String subjectName}) { Widget $TermRow(BuildContext context, List<EntranceModel> items, int? data) {
EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w); var leng = items.length;
Widget childWidget;
return InkWell( switch (leng) {
onTap: () { case 1:
/* String url = childWidget =
'${RouterManager.jobListParticipateInClassPath}?&jobId=${jobTaskItem.id}&genderName=${Uri.encodeComponent(jobTaskItem.genderName)}&jobName=${Uri.encodeComponent(jobTaskItem.title)}&completed=${true}'; Row(children: [Expanded(child: $TermItem(context, items[0], data!))]);
RouterManager.router.navigateTo(context, url, transition: getTransition());*/ break;
}, case 2:
child: Container( childWidget = Row(children: [
padding: EdgeInsets.only(top: 10.h), Expanded(flex: 9, child: $TermItem(context, items[0], data!)),
decoration: BoxDecoration( const Expanded(flex: 1, child: SizedBox()),
borderRadius: BorderRadius.circular(6.r), Expanded(flex: 9, child: $TermItem(context, items[1], data!)),
color: Colors.white, ]);
boxShadow: const [ break;
BoxShadow( case 3:
color: Color.fromRGBO(210, 216, 241, 1), double theHeight = ScreenUtil().screenWidth / 19 + 54.h * 2;
offset: Offset.zero, //y轴偏移量 childWidget = Row(
blurRadius: 5.8, //
spreadRadius: 0, //
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
// Expanded(
Padding( child: $TermItem(context, items[0], data!, theHeight: theHeight)),
padding: padEdg, SizedBox(width: ScreenUtil().screenWidth / 19),
child: Row( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: SizedBox(
children: [ height: theHeight,
Container( child: Column(
width: 32.w, mainAxisAlignment: MainAxisAlignment.spaceBetween,
height: 18.h, children: [
alignment: Alignment.center, $TermItem(context, items[1], data),
padding: EdgeInsets.only(left: 2.w), $TermItem(context, items[2], data),
decoration: BoxDecoration(
color: type == 1 ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(14.r),
topRight: Radius.circular(3.r),
bottomLeft: Radius.circular(4.r),
bottomRight: Radius.circular(4.r),
),
),
margin: EdgeInsets.only(right: 4.w),
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(jobTaskItem.name, size: 14.sp, color: const Color.fromRGBO(70, 70, 70, 1), maxLines: 2),
)
],
),
),
Padding(
padding: padEdg,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
quickText(
jobTaskItem.publishTime.substring(0, 10),
color: const Color.fromRGBO(97, 97, 97, 1),
size: 10.sp,
fontWeight: FontWeight.w500,
),
quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500),
quickText(
'参与班级:',
color: const Color.fromRGBO(76, 199, 147, 1),
size: 9.sp,
),
quickText(
'${jobTaskItem.classCount}',
color: const Color.fromRGBO(76, 199, 147, 1),
size: 10.sp,
),
quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 10.sp, fontWeight: FontWeight.w500),
quickText(
'科目:$subjectName',
color: const Color.fromRGBO(116, 145, 253, 1),
size: 9.sp,
),
],
),
),
/*Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: FavoriteButton(
jobTaskItem.id,
jobTaskItem.title,
margin: EdgeInsets.only(top: 4.h, bottom: 6.h),
),
),*/
GestureDetector(
onTap: () {
/* RouterManager.router.navigateTo(
context,
RouterManager.jobReportPagePath +
'?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}',
transition: getTransition(),
);*/
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
color: Colors.white,
boxShadow: const [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.15),
offset: Offset(0, -0.0001), //y轴偏移量
blurRadius: 4, //
spreadRadius: 0, //
)
], ],
), ),
child: Row(children: [
Expanded(
child: Container(
alignment: Alignment.center,
child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 11.sp),
),
),
]),
), ),
), ),
], ],
), );
), break;
default:
childWidget = Container();
}
return Container(
padding: EdgeInsets.symmetric(horizontal: 14.w), child: childWidget);
}
@swidget
Widget $TermItem(BuildContext context, EntranceModel e, int data,
{double? theHeight}) {
bool isJob = e.title == '作业批阅';
return Material(
color: Colors.white,
elevation: 3.r,
shadowColor: const Color.fromRGBO(231, 231, 231, 1),
borderRadius: BorderRadius.all(Radius.circular(8.r)),
child: InkWell(
onTap: () {
Get.toNamed(e.navigationUrl,arguments: {'page':e.page??''});
},
// splashColor: splashColor,
borderRadius: BorderRadius.all(Radius.circular(8.r)),
child: badges.Badge(
showBadge: isJob && data > 0,
ignorePointer: false,
badgeContent: quickText(data, color: Colors.white, size: 10.sp),
badgeAnimation: const badges.BadgeAnimation.rotation(
animationDuration: Duration(seconds: 1),
colorChangeAnimationDuration: Duration(seconds: 1),
loopAnimation: false,
curve: Curves.fastOutSlowIn,
colorChangeAnimationCurve: Curves.easeInCubic,
),
badgeStyle: badges.BadgeStyle(
badgeColor: const Color.fromRGBO(255, 105, 105, 1),
shape: badges.BadgeShape.square,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.r),
topRight: Radius.circular(8.5.r),
bottomRight: Radius.circular(8.5.r)),
// borderSide: BorderSide(color: Colors.white, width: 2),
elevation: 1,
padding: EdgeInsets.symmetric(
horizontal: Utils.isPad() ? 11.w : 16.w, vertical: 2.h),
),
position: badges.BadgePosition.topEnd(top: 10.r, end: 10.r),
child: Container(
height: theHeight,
padding: EdgeInsets.symmetric(vertical: 12.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8.r)),
// boxShadow: [
// BoxShadow(
// color: const Color.fromRGBO(231, 231, 231, 1),
// offset: Offset(4.w, 6.h), //y轴偏移量
// blurRadius: 8, //
// spreadRadius: 0.2, //
// )
// ],
// border: Border.all(width: 0.5.w, color: Color.fromARGB(255, 219, 226, 250)),
),
alignment: Alignment.center,
child: isJob
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(e.image,
height: 32.r, width: 32.r, fit: BoxFit.cover),
SizedBox(height: 6.r),
quickText(e.title,
size: 12.sp,
color: const Color.fromRGBO(79, 79, 79, 1),
fontWeight: FontWeight.w500),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(e.image,
height: 32.r, width: 32.r, fit: BoxFit.cover),
SizedBox(width: 6.r),
quickText(e.title,
size: 12.sp,
color: const Color.fromRGBO(79, 79, 79, 1),
fontWeight: FontWeight.w500),
],
),
),
)),
); );
} }

View File

@ -0,0 +1,163 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/class_item.dart';
import 'package:school_asignment_app/common/utils/enum_untils.dart';
import 'package:school_asignment_app/common/utils/utils.dart';
import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart';
class StudentGroupList extends StatelessWidget {
final List<ClassItem> studentGroups;
final Function goNextPage;
final Widget? rightBtn;
const StudentGroupList(this.studentGroups, this.goNextPage,
{Key? key,this.rightBtn})
: super(key: key);
@override
Widget build(BuildContext context) {
return Obx(() {
return studentGroups != null && studentGroups.isNotEmpty
? Utils.isPad()
? GridView(
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 10.r,
crossAxisSpacing: 10.r,
childAspectRatio: 556 / 112,
),
children: List.generate(studentGroups.length, (index) {
ClassItem item = studentGroups[index];
return InkWell(
onTap: () {
goNextPage(item.id,'${EnumUtils.formatGrade(item.grade)}${item.className}');
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(right: 8.r),
child: Text(
'${EnumUtils.formatGrade(item.grade)}${item.className}',
style: TextStyle(
fontSize: 10.sp, color: Color(0xFF6888FD)),
),
),
const Spacer(),
/*Expanded(
child: Text(
classNames,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF999999),
overflow: TextOverflow.ellipsis,
),
textAlign: TextAlign.end,
),
),*/
rightBtn != null
? rightBtn!
: Container(
margin: EdgeInsets.only(left: 5.r),
height: 20.r,
width: 55.r,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20.r)),
color: const Color(0xFF6888FD),
),
child: Center(
child: Text(
'详情',
style: TextStyle(
fontSize: 10.sp, color: Colors.white),
),
),
)
],
),
),
);
}),
)
: ListView.builder(
shrinkWrap: true,
itemBuilder: (context, index) {
ClassItem item = studentGroups[index];
return InkWell(
onTap: () {
// goNextPage(item.groupId, item.groupName);
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15.r, horizontal: 10.r),
margin: EdgeInsets.only(bottom: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(right: 8.r),
child: Text(
'${EnumUtils.formatGrade(item.grade)}${item.className}',
style: TextStyle(
fontSize: 14.sp, color: Color(0xFF6888FD)),
),
),
const Spacer(),
/* Expanded(
child: Text(
classNames,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF999999),
overflow: TextOverflow.ellipsis,
),
textAlign: TextAlign.end,
),
),*/
rightBtn != null
? rightBtn!
: Container(
margin: EdgeInsets.only(left: 5.r),
height: 24.r,
width: 55.r,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20.r)),
color: const Color(0xFF6888FD),
),
child: Center(
child: Text(
'详情',
style: TextStyle(
fontSize: 10.sp, color: Colors.white),
),
),
)
],
),
),
);
},
itemCount: studentGroups.length,
)
: Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height / 2 - 200.r),
child: const MyEmptyWidget(),
);
});
}
}

View File

@ -38,7 +38,7 @@ class TopUserInfo extends StatelessWidget {
alignment: Alignment.center, alignment: Alignment.center,
color: const Color.fromRGBO(163, 211, 255, 1), color: const Color.fromRGBO(163, 211, 255, 1),
padding: EdgeInsets.all(1.r), padding: EdgeInsets.all(1.r),
child: Image.asset('assets/images/logo.png', child: Image.asset('assets/images/login_logo.png',
width: 32.w, height: 32.w), width: 32.w, height: 32.w),
), ),
), ),

View File

@ -22,7 +22,7 @@ class LoginLogic extends GetxController with RequestToolMixin {
@override @override
void onInit() { void onInit() {
super.onInit(); super.onInit();
state.userNameController = TextEditingController(text: 'wangyang')..addListener(userNameListener); state.userNameController = TextEditingController(text: 'longyunfei')..addListener(userNameListener);
state.passwordController = TextEditingController(text: '123@abc'); state.passwordController = TextEditingController(text: '123@abc');
state.pwdFocus = FocusNode(); state.pwdFocus = FocusNode();
state.theFocus = FocusNode(); state.theFocus = FocusNode();
@ -63,6 +63,7 @@ class LoginLogic extends GetxController with RequestToolMixin {
if (!state.readAgreement.value) return toMsg('请阅读用户协议'); if (!state.readAgreement.value) return toMsg('请阅读用户协议');
EasyLoading.show(status: 'loading...'); EasyLoading.show(status: 'loading...');
try { try {
await getClient().toLogin(userName, userPwd); await getClient().toLogin(userName, userPwd);
String? nameidentifier = UserStore.to.userInfo.value?.nameidentifier; String? nameidentifier = UserStore.to.userInfo.value?.nameidentifier;
@ -74,7 +75,6 @@ class LoginLogic extends GetxController with RequestToolMixin {
throw Exception('用户信息获取失败'); throw Exception('用户信息获取失败');
} }
UserStore.to.setUserDetailInfo(data); UserStore.to.setUserDetailInfo(data);
UserStore.to.getSubjectList();
EasyLoading.dismiss(); EasyLoading.dismiss();
Get.offAllNamed(Routes.startPage); Get.offAllNamed(Routes.startPage);
// if (resultData.code != 200 || userData?.accessToken == null || userData?.accessToken == '') { // if (resultData.code != 200 || userData?.accessToken == null || userData?.accessToken == '') {

View File

@ -7,7 +7,6 @@ import 'package:school_asignment_app/common/utils/utils.dart';
import 'package:school_asignment_app/page/global_widget/my_text.dart'; import 'package:school_asignment_app/page/global_widget/my_text.dart';
import 'package:school_asignment_app/routes/app_pages.dart'; import 'package:school_asignment_app/routes/app_pages.dart';
import 'login_logic.dart'; import 'login_logic.dart';
class LoginPage extends StatefulWidget { class LoginPage extends StatefulWidget {
@ -19,9 +18,7 @@ class LoginPage extends StatefulWidget {
class _LoginPageState extends State<LoginPage> { class _LoginPageState extends State<LoginPage> {
final logic = Get.find<LoginLogic>(); final logic = Get.find<LoginLogic>();
final state = Get final state = Get.find<LoginLogic>().state;
.find<LoginLogic>()
.state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -47,7 +44,7 @@ class _LoginPageState extends State<LoginPage> {
alignment: Alignment.center, alignment: Alignment.center,
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage('assets/images/login_bgi.png'), image: AssetImage('assets/images/login_bg.png'),
fit: BoxFit.fill, // fit: BoxFit.fill, //
), ),
), ),
@ -61,8 +58,8 @@ class _LoginPageState extends State<LoginPage> {
child: SizedBox( child: SizedBox(
height: 86.w, height: 86.w,
width: 86.w, width: 86.w,
child: Image.asset( child: Image.asset('assets/images/login_logo.png',
'assets/images/logo.png', fit: BoxFit.cover), fit: BoxFit.cover),
), ),
), ),
Container( Container(
@ -70,9 +67,10 @@ class _LoginPageState extends State<LoginPage> {
horizontal: 32.w, vertical: 24.h), horizontal: 32.w, vertical: 24.h),
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 34.h, bottom: 16.h, left: 22.w, right: 22.w), top: 34.h, bottom: 16.h, left: 22.w, right: 22.w),
decoration: BoxDecoration( color: Colors.transparent,
color: Colors.white, /* decoration: BoxDecoration(
border: Border.all(width: 1.w, color: Colors.white), color: Colors.transparent,
border: Border.all(width: 1.w, color: Colors.white),
borderRadius: BorderRadius.all(Radius.circular(10.w)), borderRadius: BorderRadius.all(Radius.circular(10.w)),
boxShadow: const [ boxShadow: const [
BoxShadow( BoxShadow(
@ -82,105 +80,130 @@ class _LoginPageState extends State<LoginPage> {
spreadRadius: 100, // spreadRadius: 100, //
) )
], ],
), ),*/
child: Column(children: [ child: Column(children: [
TextField( Container(
controller: state.userNameController, padding: EdgeInsets.symmetric(horizontal: 10.r),
maxLines: 1, decoration: BoxDecoration(
maxLength: 20, color: Colors.transparent,
textInputAction: TextInputAction.next, border: Border.all(width: 1.w, color: const Color(0xFFAECBFF)),
onEditingComplete: () { borderRadius: BorderRadius.all(Radius.circular(17.w)),
Get.focusScope?.nextFocus(); ),
// FocusScope.of(context).requestFocus(_pwdFocus); child: Center(
}, child: TextField(
style: TextStyle( controller: state.userNameController,
color: const Color.fromRGBO(80, 87, 103, 1), /* maxLines: 1,
fontSize: 15.sp, maxLength: 20,*/
), textInputAction: TextInputAction.next,
decoration: InputDecoration( onEditingComplete: () {
hintText: "请输入账号", Get.focusScope?.nextFocus();
hintStyle: TextStyle(fontSize: 16.sp, // FocusScope.of(context).requestFocus(_pwdFocus);
color: const Color.fromRGBO(153, 153, 153, 1)), },
labelText: "账号", style: TextStyle(
labelStyle: TextStyle(fontSize: 16.sp, color: Colors.white,
color: const Color.fromRGBO(148, 163, 182, 1)), fontSize: 14.sp,
suffixIcon: !state.hasNameVal ),
? null decoration: InputDecoration(
: Transform.translate( hintText: "请输入账号",
offset: Offset(10, 10), // padding值来设置偏移量 hintStyle: TextStyle(
child: IconButton( fontSize: 14.sp,
alignment: Alignment.center, color: Colors.white,),
padding: EdgeInsets.zero, // labelText: "账号",
icon: Icon( labelStyle: TextStyle(
Icons.highlight_off_sharp, fontSize: 14.sp,
color: Colors.grey, color: Colors.white,),
size: 16.r, border: InputBorder.none,
), prefixIcon:Image.asset('assets/images/login_account.png',width: 20.r,height: 20.r,),
onPressed: () { /* suffixIcon: !state.hasNameVal
state.userNameController.clear(); // ? null
state.passwordController.clear(); : Transform.translate(
}, offset:
Offset(10, 10), // padding值来设置偏移量
child: IconButton(
alignment: Alignment.center,
padding: EdgeInsets.zero,
icon: Icon(
Icons.highlight_off_sharp,
color: Colors.grey,
size: 16.r,
),
onPressed: () {
state.userNameController
.clear(); //
state.passwordController.clear();
},
),
),*/
), ),
), ),
), ),
), ),
SizedBox(height: 15.r,),
Obx(() { Obx(() {
return TextField( return Container(
focusNode: state.pwdFocus, padding: EdgeInsets.symmetric(horizontal: 10.r),
controller: state.passwordController, decoration: BoxDecoration(
keyboardType: TextInputType.number, color: Colors.transparent,
maxLines: 1, border: Border.all(width: 1.w, color: const Color(0xFFAECBFF)),
obscureText: state.isShowPwd.value, borderRadius: BorderRadius.all(Radius.circular(17.w)),
//
textInputAction: TextInputAction.go,
// onSubmitted: (val) => toLogin(),
style: TextStyle(
color: const Color.fromRGBO(80, 87, 103, 1),
fontSize: 15.sp,
), ),
decoration: InputDecoration( child: TextField(
hintText: "请输入密码", focusNode: state.pwdFocus,
suffix: GestureDetector( controller: state.passwordController,
onTap: logic.showPassword, keyboardType: TextInputType.number,
child: Icon( maxLines: 1,
Icons.remove_red_eye, obscureText: state.isShowPwd.value,
color: state.isShowPwd.value ? Theme //
.of(context) textInputAction: TextInputAction.go,
.primaryColor : Colors.grey, // onSubmitted: (val) => toLogin(),
), style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
),
decoration: InputDecoration(
hintText: "请输入密码",
/* suffix: GestureDetector(
onTap: logic.showPassword,
child: Icon(
Icons.remove_red_eye,
color: state.isShowPwd.value
? Theme.of(context).primaryColor
: Colors.grey,
),
),*/
prefixIcon: Image.asset('assets/images/login_pwd.png',width: 20.r,height: 20.r,),
hintStyle: TextStyle(
fontSize: 14.sp,
color: Colors.white,),
border: InputBorder.none,
// labelText: "密码",
isDense: true,
labelStyle: TextStyle(
fontSize: 14.sp,
color: Colors.white,),
), ),
hintStyle: TextStyle(fontSize: 16.sp,
color: const Color.fromRGBO(
153, 153, 153, 1)),
labelText: "密码",
isDense: true,
labelStyle: TextStyle(fontSize: 16.sp,
color: const Color.fromRGBO(
148, 163, 182, 1)),
), ),
); );
}), }),
SizedBox( SizedBox(
height: 12.h, height: 22.h,
), ),
Row( /* Row(
children: [ children: [
Container( Container(
width: 30.w, width: 30.w,
padding: EdgeInsets.only(right: 10.w), padding: EdgeInsets.only(right: 10.w),
child: Obx(() { child: Obx(() {
return Checkbox( return Checkbox(
activeColor: Theme activeColor: Theme.of(context).primaryColor,
.of(context)
.primaryColor,
checkColor: Colors.white, checkColor: Colors.white,
value: state.keepPwd.value, value: state.keepPwd.value,
onChanged: (value) { onChanged: (value) {
Get.focusScope?.nextFocus(); Get.focusScope?.nextFocus();
/* FocusScope.of(context).requestFocus( *//* FocusScope.of(context).requestFocus(
state.pwdFocus); state.pwdFocus);
FocusScope.of(context).requestFocus( FocusScope.of(context).requestFocus(
state.theFocus);*/ state.theFocus);*//*
state.keepPwd.value = value ?? false; state.keepPwd.value = value ?? false;
}, },
); );
@ -189,25 +212,25 @@ class _LoginPageState extends State<LoginPage> {
InkWell( InkWell(
onTap: () { onTap: () {
Utils.hideKeyboard(); Utils.hideKeyboard();
/*Get.focusScope?.nextFocus(); *//*Get.focusScope?.nextFocus();
Get.focusScope?.nextFocus();*/ Get.focusScope?.nextFocus();*//*
/* FocusScope.of(context).requestFocus( *//* FocusScope.of(context).requestFocus(
state.pwdFocus); state.pwdFocus);
FocusScope.of(context).requestFocus( FocusScope.of(context).requestFocus(
state.theFocus);*/ state.theFocus);*//*
state.keepPwd.value = !state.keepPwd.value; state.keepPwd.value = !state.keepPwd.value;
}, },
child: Text( child: Text(
'记住密码', '记住密码',
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: const Color.fromRGBO(148, 163, 182, 1), color: Colors.white,
), ),
), ),
), ),
], ],
), ),*/
InkWell( InkWell(
onTap: () { onTap: () {
logic.toLogin(); logic.toLogin();
@ -217,19 +240,20 @@ class _LoginPageState extends State<LoginPage> {
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 10.h), margin: EdgeInsets.symmetric(vertical: 10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: state.canLogin.value ? const Color.fromRGBO( color: state.canLogin.value
9, 105, 246, 1) : Colors.grey, ? const Color.fromRGBO(107, 104, 252, 1)
: const Color(0xFFdddddd),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: const Color.fromRGBO( color:
46, 91, 255, 0.5), const Color.fromRGBO(46, 91, 255, 0.5),
offset: Offset(6.w, 10.h), //y轴偏移量 offset: Offset(6.w, 10.h), //y轴偏移量
blurRadius: 14, // blurRadius: 14, //
spreadRadius: 0.5, // spreadRadius: 0.5, //
) )
], ],
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(8.w), Radius.circular(17.w),
), ),
), ),
alignment: Alignment.center, alignment: Alignment.center,
@ -250,12 +274,12 @@ class _LoginPageState extends State<LoginPage> {
padding: EdgeInsets.only(right: 10.w), padding: EdgeInsets.only(right: 10.w),
child: Obx(() { child: Obx(() {
return Checkbox( return Checkbox(
activeColor: Colors.deepOrangeAccent, activeColor: Theme.of(context).primaryColor,
checkColor: Colors.white, checkColor: Colors.white,
value: state.readAgreement.value, value: state.readAgreement.value,
onChanged: (value) { onChanged: (value) {
Utils.hideKeyboard(); Utils.hideKeyboard();
/* FocusScope.of(context).requestFocus( /* FocusScope.of(context).requestFocus(
state.pwdFocus); state.pwdFocus);
FocusScope.of(context).requestFocus( FocusScope.of(context).requestFocus(
state.theFocus);*/ state.theFocus);*/
@ -266,21 +290,22 @@ class _LoginPageState extends State<LoginPage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Get.toNamed(Routes.agreementPage, Get.toNamed(Routes.agreementPage, arguments: {
arguments: {"type": AGREEMENT_KEY "type": AGREEMENT_KEY.USER_AGREEMENT.name
.USER_AGREEMENT.name}); });
}, },
child: quickText('请仔细阅读', size: 13.sp), child: quickText('请仔细阅读', size: 13.sp),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Get.toNamed(Routes.agreementPage, Get.toNamed(Routes.agreementPage, arguments: {
arguments: {"type": AGREEMENT_KEY "type": AGREEMENT_KEY.USER_AGREEMENT.name
.USER_AGREEMENT.name}); });
}, },
child: Text( child: Text(
'《用户协议》', '《用户协议》',
style: TextStyle(fontSize: 14.r, style: TextStyle(
fontSize: 14.r,
color: Colors.deepOrangeAccent), color: Colors.deepOrangeAccent),
), ),
), ),
@ -301,4 +326,4 @@ class _LoginPageState extends State<LoginPage> {
Get.delete<LoginLogic>(); Get.delete<LoginLogic>();
super.dispose(); super.dispose();
} }
} }

View File

@ -1,7 +1,13 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:school_asignment_app/page/global_widget/other_page.dart'; import 'package:school_asignment_app/page/global_widget/other_page.dart';
import 'package:school_asignment_app/page/global_widget/start_page.dart'; import 'package:school_asignment_app/page/global_widget/start_page.dart';
import 'package:school_asignment_app/page/home_page/children/class_student/class_student_binding.dart';
import 'package:school_asignment_app/page/home_page/children/class_student/class_student_view.dart';
import 'package:school_asignment_app/page/home_page/children/my_info.dart'; import 'package:school_asignment_app/page/home_page/children/my_info.dart';
import 'package:school_asignment_app/page/home_page/children/read_over/read_over_binding.dart';
import 'package:school_asignment_app/page/home_page/children/read_over/read_over_view.dart';
import 'package:school_asignment_app/page/home_page/children/student_history_work/student_history_work_binding.dart';
import 'package:school_asignment_app/page/home_page/children/student_history_work/student_history_work_view.dart';
import 'package:school_asignment_app/page/home_page/home_binding.dart'; import 'package:school_asignment_app/page/home_page/home_binding.dart';
import 'package:school_asignment_app/page/home_page/home_view.dart'; import 'package:school_asignment_app/page/home_page/home_view.dart';
import 'package:school_asignment_app/page/login_page/children/agreement_page.dart'; import 'package:school_asignment_app/page/login_page/children/agreement_page.dart';
@ -17,8 +23,11 @@ abstract class AppPages {
GetPage(name: Routes.agreementPage, page: () => const AgreementPage(), binding: LoginBinding(), transition: Transition.noTransition), GetPage(name: Routes.agreementPage, page: () => const AgreementPage(), binding: LoginBinding(), transition: Transition.noTransition),
GetPage(name: Routes.home, page: () => const HomePage(), binding: HomeBinding(), transition: Transition.noTransition), GetPage(name: Routes.home, page: () => const HomePage(), binding: HomeBinding(), transition: Transition.noTransition),
GetPage(name: Routes.startPage, page: () => const StartPage(), binding: StartPageIndexBinding(), transition: Transition.noTransition), GetPage(name: Routes.startPage, page: () => const StartPage(), binding: StartPageIndexBinding(), transition: Transition.noTransition),
GetPage(name: Routes.myInfo, page: () => MyInfo(), transition: Transition.noTransition), GetPage(name: Routes.myInfo, page: () => const MyInfo(), transition: Transition.noTransition),
GetPage(name: Routes.work, page: () => const WorkPage(), binding: WorkBinding(), transition: Transition.noTransition), GetPage(name: Routes.work, page: () => const WorkPage(), binding: WorkBinding(), transition: Transition.noTransition),
GetPage(name: Routes.otherPage, page: () => const OhterPage(), transition: Transition.noTransition), GetPage(name: Routes.otherPage, page: () => const OhterPage(), transition: Transition.noTransition),
GetPage(name: Routes.readOverPage, page: () => const ReadOverPage(), binding: ReadOverBinding(), transition: Transition.noTransition),
GetPage(name: Routes.studentHistoryWorkPage, page: () => const StudentHistoryWorkPage(), binding: StudentHistoryWorkBinding(), transition: Transition.noTransition),
GetPage(name: Routes.classStudentPage, page: () => const ClassStudentPage(), binding: ClassStudentBinding(), transition: Transition.noTransition),
]; ];
} }

View File

@ -8,4 +8,7 @@ abstract class Routes {
static const myInfo = '/myInfo'; static const myInfo = '/myInfo';
static const work = '/work'; static const work = '/work';
static const otherPage = '/otherPage'; static const otherPage = '/otherPage';
static const readOverPage = '/readOverPage';
static const studentHistoryWorkPage = '/studentHistoryWorkPage';
static const classStudentPage = '/classStudentPage';
} }

View File

@ -33,6 +33,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.11.0" version: "2.11.0"
badges:
dependency: "direct main"
description:
name: badges
sha256: a7b6bbd60dce418df0db3058b53f9d083c22cdb5132a052145dc267494df0b84
url: "https://pub.dev"
source: hosted
version: "3.1.2"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:

View File

@ -69,6 +69,7 @@ dependencies:
# end retrofit请求封装 # end retrofit请求封装
# 进度条 # 进度条
percent_indicator: ^4.2.3 percent_indicator: ^4.2.3
badges: ^3.1.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: