diff --git a/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_view.dart b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_view.dart index 968a650..bfbfa01 100644 --- a/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_view.dart @@ -24,94 +24,98 @@ class _AnnotateClassPageState extends State { @override Widget build(BuildContext context) { String homeworkId = state.homeworkId.value; - return Scaffold( - backgroundColor: const Color.fromRGBO(245, 245, 245, 1), - appBar: AppBar( - backgroundColor: Colors.white, - title: Obx(() { - return Text(state.name.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: () { - Get.back(); - }, - ), - actions: const [ - ReturnToHomepage(), - ], - ), - body: Padding( - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), - child: Obx(() { - return EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async{ - return logic.getList(); - }, - child: state.completed.value - ? Utils.isPad() - ? GridView( - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, //横轴三个子widget - mainAxisSpacing: 10.h, - crossAxisSpacing: 6.w, - childAspectRatio: 1.48 //宽高比为1时,子widget + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation){ + return Scaffold( + backgroundColor: const Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + title: Obx(() { + return Text(state.name.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: () { + Get.back(); + }, + ), + actions: const [ + ReturnToHomepage(), + ], ), - children: state.classList.map((taskItem) { - return CompletedAnnotateItem( - taskItem: taskItem, - logic: logic, - name: state.name.value, - ); - }).toList(), - ) - : ListView.builder( - itemCount: state.classList.length, - itemBuilder: (context, index) { - AnnotatedClass taskItem = state.classList[index]; - return CompletedAnnotateItem( - taskItem: taskItem, - logic: logic, - name: state.name.value, - ); - }) - : Utils.isPad() - ? MasonryGridView.count( - crossAxisCount: 2, //几列 - mainAxisSpacing: 4.w, // 间距 - crossAxisSpacing: 4.h, // 纵向间距? - itemCount: state.classList.length, - itemBuilder: (context, index) { - AnnotatedClass item = state.classList[index]; - return AnnotateItem( - homeworkId: homeworkId, - item: item, - font: 11.sp, - name: state.name.value, - logic: logic, - ); - }, - ) - : ListView.builder( - itemCount: state.classList.length, - itemBuilder: (context, index) { - AnnotatedClass item = state.classList[index]; - return AnnotateItem( - homeworkId: homeworkId, - item: item, - font: 12.sp, - name: state.name.value, - logic: logic, - ); - })); - }), - ), + body: Padding( + padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), + child: Obx(() { + return EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async{ + return logic.getList(); + }, + child: state.completed.value + ? Utils.isPad() + ? GridView( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, //横轴三个子widget + mainAxisSpacing: 10.h, + crossAxisSpacing: 6.w, + childAspectRatio: 1.48 //宽高比为1时,子widget + ), + children: state.classList.map((taskItem) { + return CompletedAnnotateItem( + taskItem: taskItem, + logic: logic, + name: state.name.value, + ); + }).toList(), + ) + : ListView.builder( + itemCount: state.classList.length, + itemBuilder: (context, index) { + AnnotatedClass taskItem = state.classList[index]; + return CompletedAnnotateItem( + taskItem: taskItem, + logic: logic, + name: state.name.value, + ); + }) + : Utils.isPad() + ? MasonryGridView.count( + crossAxisCount: 2, //几列 + mainAxisSpacing: 4.w, // 间距 + crossAxisSpacing: 4.h, // 纵向间距? + itemCount: state.classList.length, + itemBuilder: (context, index) { + AnnotatedClass item = state.classList[index]; + return AnnotateItem( + homeworkId: homeworkId, + item: item, + font: 11.sp, + name: state.name.value, + logic: logic, + ); + }, + ) + : ListView.builder( + itemCount: state.classList.length, + itemBuilder: (context, index) { + AnnotatedClass item = state.classList[index]; + return AnnotateItem( + homeworkId: homeworkId, + item: item, + font: 12.sp, + name: state.name.value, + logic: logic, + ); + })); + }), + ), + ); + } ); } diff --git a/making_school_asignment_app/lib/page/home_page/children/answer_trajectory/answer_trajectory_view.dart b/making_school_asignment_app/lib/page/home_page/children/answer_trajectory/answer_trajectory_view.dart index 28dd3ae..28a581e 100644 --- a/making_school_asignment_app/lib/page/home_page/children/answer_trajectory/answer_trajectory_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/answer_trajectory/answer_trajectory_view.dart @@ -24,147 +24,153 @@ class _AnswerTrajectoryPageState extends State { @override Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Color.fromRGBO(245, 245, 245, 1), - appBar: AppBar( - backgroundColor: Colors.white, - title: Text( - '答题轨迹', - style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)), - ), - centerTitle: true, - leading: IconButton( - icon: Icon(Icons.arrow_back_ios, color: Colors.black), - onPressed: () => Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10.r, - ), - Container( - padding: EdgeInsets.symmetric(horizontal: 14.r), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide(width: 1.r, color: Color(0xFFCCCCCC)))), - child: TabBar( - dividerHeight: 0, - tabAlignment: TabAlignment.start, - indicator: const UnderlineTabIndicator( - borderSide: BorderSide( - color: const Color.fromRGBO(104, 136, 253, 1), - ), - + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation){ + return Scaffold( + backgroundColor: Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + title: Text( + '答题轨迹', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)), ), - onTap: (int val) { - state.tabIndex.value = val; - // EasyLoading.show(status: 'loading...'); - /* if(val == 0){ + centerTitle: true, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), + ], + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10.r, + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 14.r), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide(width: 1.r, color: Color(0xFFCCCCCC)))), + child: TabBar( + dividerHeight: 0, + tabAlignment: TabAlignment.start, + indicator: const UnderlineTabIndicator( + borderSide: BorderSide( + color: const Color.fromRGBO(104, 136, 253, 1), + ), + + ), + onTap: (int val) { + state.tabIndex.value = val; + // EasyLoading.show(status: 'loading...'); + /* if(val == 0){ logic.getStudentGroups(); }else{ logic.getWorkList(); }*/ - }, - tabs: [ - SizedBox( - width: (MediaQuery - .of(context) - .size - .width - 28.r) / 2, - child: const Tab( - text: '按学生', + }, + tabs: [ + SizedBox( + width: (MediaQuery + .of(context) + .size + .width - 28.r) / 2, + child: const Tab( + text: '按学生', + ), + ), + SizedBox( + width: (MediaQuery + .of(context) + .size + .width - 28.r) / 2, + child: const Tab( + text: '按作业', + ), + ) + ], + controller: logic.tabController, + unselectedLabelStyle: + TextStyle(fontSize: 14.sp, color: Color(0xFF666666)), + labelStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFF6888FD), + ), + isScrollable: true, + labelColor: Color(0xFF6888FD), + unselectedLabelColor: Color(0xFF666666), + indicatorSize: TabBarIndicatorSize.label, + labelPadding: const EdgeInsets.all(0), ), ), - SizedBox( - width: (MediaQuery - .of(context) - .size - .width - 28.r) / 2, - child: const Tab( - text: '按作业', - ), - ) + Obx(() { + return Expanded( + child: Padding( + padding: + EdgeInsets.only(top: 15.r, left: 14.r, right: 14.r), + child: + state.tabIndex.value == 0 + ? + EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + logic.getStudentGroups(); + }, + child: StudentGroupList( + state.studentGroups, logic.goNextPage, + rightBtn: Container( + margin: EdgeInsets.only(left: 5.r), + height: 20.r, + width: 55.r, + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(20.r)), + border: Border.all( + width: 1.r, color: Color(0xFFFF9800)), + ), + child: Center( + child: Text( + '详情', + style: TextStyle( + fontSize: 10.sp, color: Color(0xFFFF9800)), + ), + ), + )), + ) : EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController2, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + state.page = 1; + logic.getWorkList(); + }, + onLoad: () async { + if (state.jobList.length < state.total) { + EasyLoading.show(status: 'loading...'); + state.page = state.page + 1; + logic.getWorkList(); + } + }, + child: AnswerTrajectoryJob(state.jobList.value)), + ), + ); + }) ], - controller: logic.tabController, - unselectedLabelStyle: - TextStyle(fontSize: 14.sp, color: Color(0xFF666666)), - labelStyle: TextStyle( - fontSize: 14.sp, - color: Color(0xFF6888FD), - ), - isScrollable: true, - labelColor: Color(0xFF6888FD), - unselectedLabelColor: Color(0xFF666666), - indicatorSize: TabBarIndicatorSize.label, - labelPadding: const EdgeInsets.all(0), ), - ), - Obx(() { - return Expanded( - child: Padding( - padding: - EdgeInsets.only(top: 15.r, left: 14.r, right: 14.r), - child: - state.tabIndex.value == 0 - ? - EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - logic.getStudentGroups(); - }, - child: StudentGroupList( - state.studentGroups, logic.goNextPage, - rightBtn: Container( - margin: EdgeInsets.only(left: 5.r), - height: 20.r, - width: 55.r, - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(20.r)), - border: Border.all( - width: 1.r, color: Color(0xFFFF9800)), - ), - child: Center( - child: Text( - '详情', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFFFF9800)), - ), - ), - )), - ) : EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController2, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - state.page = 1; - logic.getWorkList(); - }, - onLoad: () async { - if (state.jobList.length < state.total) { - EasyLoading.show(status: 'loading...'); - state.page = state.page + 1; - logic.getWorkList(); - } - }, - child: AnswerTrajectoryJob(state.jobList.value)), - ), - ); - }) - ], - ), + ); + } ); + + } @override diff --git a/making_school_asignment_app/lib/page/home_page/children/answer_trajectory_detail/answer_trajectory_detail_view.dart b/making_school_asignment_app/lib/page/home_page/children/answer_trajectory_detail/answer_trajectory_detail_view.dart index aa3c368..6b05ed5 100644 --- a/making_school_asignment_app/lib/page/home_page/children/answer_trajectory_detail/answer_trajectory_detail_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/answer_trajectory_detail/answer_trajectory_detail_view.dart @@ -29,213 +29,217 @@ class _AnswerTrajectoryDetailPageState @override Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Color(0xFFF5F5F5), - appBar: AppBar( - centerTitle: true, - backgroundColor: Colors.white, - title: Obx(() { - return Text( - state.title.value, - style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)), - overflow: TextOverflow.ellipsis, - ); - }), - leading: IconButton( - icon: Icon(Icons.arrow_back_ios, color: Colors.black), - onPressed: () => Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - ), - body: Column( - children: [ - SizedBox( - height: 10.r, - ), - Obx(() { - return state.classList.isNotEmpty?Padding( - padding: EdgeInsets.symmetric(horizontal: 14.r), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - children: List.generate(state.classList.length, ( - index) { - AnnotatedClass item = state.classList[index]; + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation){ + return Scaffold( + backgroundColor: Color(0xFFF5F5F5), + appBar: AppBar( + centerTitle: true, + backgroundColor: Colors.white, + title: Obx(() { + return Text( + state.title.value, + style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)), + overflow: TextOverflow.ellipsis, + ); + }), + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), + ], + ), + body: Column( + children: [ + SizedBox( + height: 10.r, + ), + Obx(() { + return state.classList.isNotEmpty?Padding( + padding: EdgeInsets.symmetric(horizontal: 14.r), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: List.generate(state.classList.length, ( + index) { + AnnotatedClass item = state.classList[index]; + return InkWell( + onTap: () { + if (state.currentClass.value.classId != + item.classId) { + state.currentClass.value = item; + } + }, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 5.r, horizontal: 10.r), + margin: EdgeInsets.only( + right: index < state.classList.length + ? 8.r + : 0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(4.r), + ), + child: Center( + child: Text( + '${EnumUtils.formatGrade(state.grade)}${item + .className}', + style: TextStyle( + fontSize: 10.sp, + color: state.currentClass.value + .classId == item.classId + ? Color(0xFF6888FD) + : Color(0xFF686868)), + ), + ), + ), + ); + })), + ), + ], + ), + ):Container(); + }), + SizedBox( + height: 10.r, + ), + Container( + height: 1.r, + color: const Color(0xFFCCCCCC), + ), + Obx((){ + return state.currentClass.value.students.isNotEmpty ? 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 { + // getStudentList(); + }, + child: state.currentClass.value.students.isNotEmpty + ? Utils.isPad() + ? GridView( + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + mainAxisSpacing: 10.r, + crossAxisSpacing: 10.r, + childAspectRatio: 556 / 112, + ), + children: List.generate( + state.currentClass.value.students.length, (index) { + AnnotatedStudents item = state.currentClass.value.students[index]; return InkWell( onTap: () { - if (state.currentClass.value.classId != - item.classId) { - state.currentClass.value = item; - } + Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': item.studentId, 'homeworkId': state.homeworkId.value}); }, child: Container( - padding: EdgeInsets.symmetric( - vertical: 5.r, horizontal: 10.r), - margin: EdgeInsets.only( - right: index < state.classList.length - ? 8.r - : 0), + padding: EdgeInsets.symmetric(horizontal: 10.r), decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10.r)), color: Colors.white, - borderRadius: BorderRadius.circular(4.r), ), - child: Center( - child: Text( - '${EnumUtils.formatGrade(state.grade)}${item - .className}', - style: TextStyle( - fontSize: 10.sp, - color: state.currentClass.value - .classId == item.classId - ? Color(0xFF6888FD) - : Color(0xFF686868)), - ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + item.studentName, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF6888FD)), + )), + + Container( + height: 20.r, + width: 70.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))), + )), + ], ), ), ); - })), + }), + ) + : ListView.builder( + itemBuilder: (context, index) { + AnnotatedStudents item = state.currentClass.value + .students[index]; + return InkWell( + onTap: () { + Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': item.studentId, 'homeworkId': state.homeworkId.value}); + }, + 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.studentName, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF6888FD)), + )), + 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))), + )), + ], + ), + ), + ); + }, + itemCount: state.currentClass.value.students.length, + ) + : const MyEmptyWidget(), + ), ), - ], - ), - ):Container(); - }), - SizedBox( - height: 10.r, - ), - Container( - height: 1.r, - color: const Color(0xFFCCCCCC), - ), - Obx((){ - return state.currentClass.value.students.isNotEmpty ? 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 { - // getStudentList(); - }, - child: state.currentClass.value.students.isNotEmpty - ? Utils.isPad() - ? GridView( - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - mainAxisSpacing: 10.r, - crossAxisSpacing: 10.r, - childAspectRatio: 556 / 112, - ), - children: List.generate( - state.currentClass.value.students.length, (index) { - AnnotatedStudents item = state.currentClass.value.students[index]; - return InkWell( - onTap: () { - Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': item.studentId, 'homeworkId': state.homeworkId.value}); - }, - 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.studentName, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF6888FD)), - )), - - Container( - height: 20.r, - width: 70.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))), - )), - ], - ), - ), - ); - }), - ) - : ListView.builder( - itemBuilder: (context, index) { - AnnotatedStudents item = state.currentClass.value - .students[index]; - return InkWell( - onTap: () { - Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': item.studentId, 'homeworkId': state.homeworkId.value}); - }, - 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.studentName, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF6888FD)), - )), - 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))), - )), - ], - ), - ), - ); - }, - itemCount: state.currentClass.value.students.length, - ) - : const MyEmptyWidget(), - ), - ), - ) : const MyEmptyWidget(); - }), - ], - ), + ) : const MyEmptyWidget(); + }), + ], + ), + ); + } ); } diff --git a/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart index 0ee1941..23b4bba 100644 --- a/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart @@ -24,400 +24,404 @@ class _ClassStudentPageState extends 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: () => Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - ), - body: Padding( - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), - child: Obx(() { - return EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - logic.getList(); - }, - child: 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) { - StudentItem item = state.studentList[index]; - return InkWell( - onTap: () { - // RouterManager.router.navigateTo(context, - // '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); - Get.toNamed(Routes.studentWorkDetailPage, - arguments: { - 'studentName': item.name, - 'studentId': item.id - }); - }, - 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( + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation){ + 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: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), + ], + ), + body: Padding( + padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), + child: Obx(() { + return EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + logic.getList(); + }, + child: 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) { + StudentItem item = state.studentList[index]; + return InkWell( + onTap: () { + // RouterManager.router.navigateTo(context, + // '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); + Get.toNamed(Routes.studentWorkDetailPage, + arguments: { + 'studentName': item.name, + 'studentId': item.id + }); + }, + 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.priorityAnnotate - ? InkWell( - onTap: () { - logic.setJobReadLevel( - item.id, false); - 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: () { - logic.setJobReadLevel( - item.id, true); - 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)), - ), - ), - ], - ), - ), - ), - ], + 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.priorityAnnotate + ? InkWell( + onTap: () { + logic.setJobReadLevel( + item.id, false); + 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: () { + logic.setJobReadLevel( + item.id, true); + 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) { - StudentItem item = state.studentList[index]; - return InkWell( - onTap: () { - // RouterManager.router.navigateTo(context, - // '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); - Get.toNamed(Routes.studentWorkDetailPage, - arguments: { - 'studentName': item.name, - 'studentId': item.id - }); - }, - 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( + ], + ), + ), + ); + }), + ) + : ListView.builder( + itemBuilder: (context, index) { + StudentItem item = state.studentList[index]; + return InkWell( + onTap: () { + // RouterManager.router.navigateTo(context, + // '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); + Get.toNamed(Routes.studentWorkDetailPage, + arguments: { + 'studentName': item.name, + 'studentId': item.id + }); + }, + 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.priorityAnnotate - ? InkWell( - onTap: () { - logic.setJobReadLevel( - item.id, false); - 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: 5.r, - left: 4.r), - child: Text( - '优先批阅', - style: TextStyle( - fontSize: 10.sp, - color: const Color( - 0xFF4CC793)), - ), - ), - ], - ), - ), - ) - : InkWell( - onTap: () { - logic.setJobReadLevel( - item.id, true); - 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: 5.r, - left: 4.r), - child: Text( - '优先批阅', - style: TextStyle( - fontSize: 10.sp, - color: const Color( - 0xFF8A9691)), - ), - ), - ], - ), - ), - ), - ], + 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.priorityAnnotate + ? InkWell( + onTap: () { + logic.setJobReadLevel( + item.id, false); + 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: 5.r, + left: 4.r), + child: Text( + '优先批阅', + style: TextStyle( + fontSize: 10.sp, + color: const Color( + 0xFF4CC793)), + ), + ), + ], + ), + ), + ) + : InkWell( + onTap: () { + logic.setJobReadLevel( + item.id, true); + 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: 5.r, + left: 4.r), + child: Text( + '优先批阅', + style: TextStyle( + fontSize: 10.sp, + color: const Color( + 0xFF8A9691)), + ), + ), + ], + ), + ), ), - ), - ); - }, - itemCount: state.studentList.length, - ) - : const MyEmptyWidget(), + ], + ), + ), + ); + }, + itemCount: state.studentList.length, + ) + : const MyEmptyWidget(), + ); + }), + ), ); - }), - ), + } ); } diff --git a/making_school_asignment_app/lib/page/home_page/children/fav_student/fav_student_view.dart b/making_school_asignment_app/lib/page/home_page/children/fav_student/fav_student_view.dart index f4867b9..05fd3b7 100644 --- a/making_school_asignment_app/lib/page/home_page/children/fav_student/fav_student_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/fav_student/fav_student_view.dart @@ -113,7 +113,9 @@ class _FavStudentPageState extends State { ReturnToHomepage(), ], ), - body: Column( + body:OrientationBuilder( + builder: (BuildContext context, Orientation orientation){ + return Column( children: [ Padding( padding: EdgeInsets.symmetric(vertical: 0.r, horizontal: 14.r), @@ -139,7 +141,7 @@ class _FavStudentPageState extends State { children: [ Obx(() { return DropdownSelection( - bgColor: Colors.white, + bgColor: Colors.white, involveClasses: state.involveClasses.value, classData: state.classData.value, call: (AnnotatedClass item) { @@ -221,7 +223,7 @@ class _FavStudentPageState extends State { child: InkWell( onTap: () { showStudentDialog(context, - student, state.favList); + student, state.favList); }, child: Row( mainAxisAlignment: @@ -249,12 +251,12 @@ class _FavStudentPageState extends State { ), InkWell( onTap: () async { - var confim = - await confirmDialog(); - if (confim) { - logic.getDelete( - student); - } + var confim = + await confirmDialog(); + if (confim) { + logic.getDelete( + student); + } }, child: Image.asset( 'assets/images/favorite_delete_icon.png', @@ -300,8 +302,8 @@ class _FavStudentPageState extends State { HomeworkFavs student = item['list'][i]; return InkWell( onTap: () { - showStudentDialog( - context, student, state.favList); + showStudentDialog( + context, student, state.favList); }, child: Container( padding: EdgeInsets.symmetric( @@ -336,10 +338,10 @@ class _FavStudentPageState extends State { InkWell( onTap: () async { var confim = - await confirmDialog(); - if (confim) { - logic.getDelete(student); - } + await confirmDialog(); + if (confim) { + logic.getDelete(student); + } }, child: Image.asset( 'assets/images/favorite_delete_icon.png', @@ -373,7 +375,9 @@ class _FavStudentPageState extends State { }), ], - ), + ); + } + ) ); } diff --git a/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart index 46f4934..a974dee 100644 --- a/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart @@ -25,93 +25,97 @@ class _JobReportPageState extends State { @override Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Color.fromRGBO(245, 245, 245, 1), - appBar: AppBar( - backgroundColor: Colors.white, - centerTitle: true, - title: Center(child: Obx(() { - return quickText( - '${state.title.value}作业报告', - size: 14.sp, - color: const Color.fromRGBO(51, 51, 51, 1), - ); - })), - leading: IconButton( - icon: const Icon(Icons.arrow_back_ios, color: Colors.black), - onPressed: () => Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - ), - body: Obx(() { - if (state.hasData.value) { - return SingleChildScrollView( - child: Column( - children: [ - // 下拉框 - Container( - padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w), - decoration: const BoxDecoration( - color: Colors.white, - ), - child: Row( + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation){ + return Scaffold( + backgroundColor: Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + centerTitle: true, + title: Center(child: Obx(() { + return quickText( + '${state.title.value}作业报告', + size: 14.sp, + color: const Color.fromRGBO(51, 51, 51, 1), + ); + })), + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), + ], + ), + body: Obx(() { + if (state.hasData.value) { + return SingleChildScrollView( + child: Column( children: [ - Obx(() { - return DropdownSelection( - involveClasses: state.involveClasses.value, - classData: state.classData.value, - call: (AnnotatedClass item) { - state.classData.value = item; - if (item.grade == -1) state.classData.value = state.defaultClass; - logic.getWorkData(); - }); - }), - // Expanded(child: Text('')), - ], - ), - ), - //完成率、正确率 - /* TopCount( + // 下拉框 + Container( + padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w), + decoration: const BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Obx(() { + return DropdownSelection( + involveClasses: state.involveClasses.value, + classData: state.classData.value, + call: (AnnotatedClass item) { + state.classData.value = item; + if (item.grade == -1) state.classData.value = state.defaultClass; + logic.getWorkData(); + }); + }), + // Expanded(child: Text('')), + ], + ), + ), + //完成率、正确率 + /* TopCount( data, classData == null ? '' : classData!.className, widget.id),*/ - //客观题、主观题 - KgtZgtTable( - studentCount: state.dataCount.studentCount!, - homeworkId: state.homeworkId.value, - kgReport: state.kgReport, - zgReport: state.zgReport, - kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0), - zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0)), - // 掌握知识点的情况 - Container( - margin: EdgeInsets.symmetric(horizontal: 10.r), - child: KnowledgePoint( - knowsList: state.knowsList, - data: state.homeData, - className: state.classData.value.className, - homeworkId: state.homeworkId.value)), - // 掌握知识点的情况 - /* Container( + //客观题、主观题 + KgtZgtTable( + studentCount: state.dataCount.studentCount!, + homeworkId: state.homeworkId.value, + kgReport: state.kgReport, + zgReport: state.zgReport, + kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0), + zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0)), + // 掌握知识点的情况 + Container( + margin: EdgeInsets.symmetric(horizontal: 10.r), + child: KnowledgePoint( + knowsList: state.knowsList, + data: state.homeData, + className: state.classData.value.className, + homeworkId: state.homeworkId.value)), + // 掌握知识点的情况 + /* Container( margin: EdgeInsets.symmetric(horizontal: 10.r), child: $OverallPerformance(data.studentCount, data.overallTitles)), // 单位时间答题情况 Container( margin: EdgeInsets.symmetric(horizontal: 10.r), child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)),*/ - // 人员数据概况 - Container(margin: EdgeInsets.symmetric(horizontal: 10.r), child: PersonnelDataOverview(studentList: state.studentList.value)), + // 人员数据概况 + Container(margin: EdgeInsets.symmetric(horizontal: 10.r), child: PersonnelDataOverview(studentList: state.studentList.value)), - SizedBox( - height: 30.r, - ), - ], - ), + SizedBox( + height: 30.r, + ), + ], + ), + ); + } else { + return Padding(padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), child: const MyEmptyWidget()); + } + }), ); - } else { - return Padding(padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), child: const MyEmptyWidget()); } - }), ); } diff --git a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart index 3e25a76..cadb486 100644 --- a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart @@ -27,218 +27,221 @@ class _KnowledgePointsGraspPageState extends State { @override Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Color.fromRGBO(245, 245, 245, 1), - appBar: AppBar( - backgroundColor: Colors.white, - title: Text('知识点掌握', style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))), - centerTitle: true, - leading: IconButton( - icon: Icon(Icons.arrow_back_ios, color: Colors.black), - onPressed: () => Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - elevation: 0, - ), - body: Column( - children: [ - Container( - margin: EdgeInsets.all(15.r), - // height: 30.r, - child: Row( - children: [ - Expanded( - child: Container( - padding: EdgeInsets.only(left: 10.r, right: 10.r), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.r), - border: Border.all(width: 1.r, color: Color(0xFFDDDDDD)), - color: Colors.white, - ), - child: TextField( - controller: logic.textController, - textInputAction: TextInputAction.next, - style: TextStyle( - color: const Color.fromRGBO(80, 87, 103, 1), - fontSize: 10.sp, - ), - decoration: InputDecoration( - hintText: "请输入知识点名称", - hintStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(153, 153, 153, 1)), - labelStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(148, 163, 182, 1)), - border: InputBorder.none, - ), - ), - ), - ), - SizedBox( - width: 10.r, - ), - InkWell( - onTap: () { - state.page = 1; - logic.getList(); - }, - child: Container( - width: 50.r, - height: 30.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.r), - color: Color(0xFF6888FD), - ), - child: Center( - child: Text( - '查询', - style: TextStyle(fontSize: 12.sp, color: Colors.white), - ), - ), - ), - ) + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation){ + return Scaffold( + backgroundColor: Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + title: Text('知识点掌握', style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))), + centerTitle: true, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), ], + elevation: 0, ), - ), - Obx(() { - return JobConditionFilter( - jobType: 1, - controller: logic.tabController, - customTimeStr: state.customTimeStr.value, - customTime: logic.tabController.index != 2 || - ((state.dateEnd == null || state.dateEnd == '') && (state.dateStart == null || state.dateStart == '')) - ? null - : PickerDateRange( + body: Column( + children: [ + Container( + margin: EdgeInsets.all(15.r), + // height: 30.r, + child: Row( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10.r, right: 10.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.r), + border: Border.all(width: 1.r, color: Color(0xFFDDDDDD)), + color: Colors.white, + ), + child: TextField( + controller: logic.textController, + textInputAction: TextInputAction.next, + style: TextStyle( + color: const Color.fromRGBO(80, 87, 103, 1), + fontSize: 10.sp, + ), + decoration: InputDecoration( + hintText: "请输入知识点名称", + hintStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(153, 153, 153, 1)), + labelStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(148, 163, 182, 1)), + border: InputBorder.none, + ), + ), + ), + ), + SizedBox( + width: 10.r, + ), + InkWell( + onTap: () { + state.page = 1; + logic.getList(); + }, + child: Container( + width: 50.r, + height: 30.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.r), + color: Color(0xFF6888FD), + ), + child: Center( + child: Text( + '查询', + style: TextStyle(fontSize: 12.sp, color: Colors.white), + ), + ), + ), + ) + ], + ), + ), + Obx(() { + return JobConditionFilter( + jobType: 1, + controller: logic.tabController, + customTimeStr: state.customTimeStr.value, + customTime: logic.tabController.index != 2 || + ((state.dateEnd == null || state.dateEnd == '') && (state.dateStart == null || state.dateStart == '')) + ? null + : PickerDateRange( state.dateStart == null || state.dateStart == '' ? null : DateTime.parse(state.dateStart!), state.dateEnd == null || state.dateEnd == '' ? null : DateTime.parse(state.dateEnd!), ), - onTimeFilter: (String? startTime, String? endTime) { - EasyLoading.show(status: 'loading...'); - if (startTime == null && endTime == null) { - if (logic.tabController.index == 2) { - logic.tabController.animateTo(0); - } - state.dateStart = Utils.getWeekStartDate().toString().substring(0, 10); - state.dateEnd = Utils.getWeekEndDate().toString().substring(0, 10); - state.customTimeStr.value = '自定义'; - } else { - state.dateStart = startTime ?? ''; - state.dateEnd = endTime ?? ''; - } - state.page = 1; - logic.getList(); - // _refreshController2.callRefresh(); - }, - refreshTime: (value) { - if (value != null && value.startDate != null) { - state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? ''; - if (value.endDate != null) { - if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) { - state.customTimeStr.value = '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}'; - } else { - state.customTimeStr.value = '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}'; - } - } - } - }, - ); - }), - Expanded( - child: Padding( - padding: EdgeInsets.symmetric(vertical: 10.r), - child: Obx(() { - return EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - state.page = 1; - logic.getList(); - }, - onLoad: () async { - if (state.page < state.totalPages) { - state.page += 1; + onTimeFilter: (String? startTime, String? endTime) { + EasyLoading.show(status: 'loading...'); + if (startTime == null && endTime == null) { + if (logic.tabController.index == 2) { + logic.tabController.animateTo(0); + } + state.dateStart = Utils.getWeekStartDate().toString().substring(0, 10); + state.dateEnd = Utils.getWeekEndDate().toString().substring(0, 10); + state.customTimeStr.value = '自定义'; + } else { + state.dateStart = startTime ?? ''; + state.dateEnd = endTime ?? ''; + } + state.page = 1; logic.getList(); - } - }, - child: state.dataList.isNotEmpty - ? ListView.builder( - itemCount: state.dataList.value.length, - itemBuilder: (context, index) { - KnowledgePointsGrasp item = state.dataList[index]; - return InkWell( - onTap: () { - Get.toNamed(Routes.knowledgePointsGraspDetailPage, arguments: { - 'dateStart': state.dateStart, - 'dateEnd': state.dateEnd, - 'knowledgeId': item.knowledgeId, - 'knowledgeName': item.knowledgeName - }); - }, - child: Container( - margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r), - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), - decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10.r)), color: Colors.white), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Text( - item.knowledgeName, - style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), - )), - Container( - width: 49.r, - height: 22.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20.r)), - border: Border.all(width: 1.r, color: Color(0xFF6888FD)), + // _refreshController2.callRefresh(); + }, + refreshTime: (value) { + if (value != null && value.startDate != null) { + state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? ''; + if (value.endDate != null) { + if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) { + state.customTimeStr.value = '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}'; + } else { + state.customTimeStr.value = '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}'; + } + } + } + }, + ); + }), + Expanded( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 10.r), + child: Obx(() { + return EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + state.page = 1; + logic.getList(); + }, + onLoad: () async { + if (state.page < state.totalPages) { + state.page += 1; + logic.getList(); + } + }, + child: state.dataList.isNotEmpty + ? ListView.builder( + itemCount: state.dataList.value.length, + itemBuilder: (context, index) { + KnowledgePointsGrasp item = state.dataList[index]; + return InkWell( + onTap: () { + Get.toNamed(Routes.knowledgePointsGraspDetailPage, arguments: { + 'dateStart': state.dateStart, + 'dateEnd': state.dateEnd, + 'knowledgeId': item.knowledgeId, + 'knowledgeName': item.knowledgeName + }); + }, + child: Container( + margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r), + padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10.r)), color: Colors.white), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Text( + item.knowledgeName, + style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), + )), + Container( + width: 49.r, + height: 22.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.r)), + border: Border.all(width: 1.r, color: Color(0xFF6888FD)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '${item.count}次', + style: TextStyle(fontSize: 10.sp, color: Color(0xFF6888FD)), + ), + Image.asset( + 'assets/images/right_icon_blue.png', + width: 8.r, + height: 8.r, + ), + ], + ), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - '${item.count}次', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF6888FD)), - ), - Image.asset( - 'assets/images/right_icon_blue.png', - width: 8.r, - height: 8.r, - ), - ], - ), - ), - ], - ), - SizedBox( - height: 10.r, - ), - ProgressBar( - title: '正确率:', - color: Color(0xFF90E0BE), - percent: item.correctRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - ], + ], + ), + SizedBox( + height: 10.r, + ), + ProgressBar( + title: '正确率:', + color: Color(0xFF90E0BE), + percent: item.correctRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ], + ), ), - ), - ); - }) - : const MyEmptyWidget(), - ); - }), + ); + }) + : const MyEmptyWidget(), + ); + }), + ), + ), + ], ), - ), - ], - ), - ); + ); + }); } @override diff --git a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart index 7a58767..15c891d 100644 --- a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart @@ -68,165 +68,167 @@ class _KnowledgePointsGraspDetailPageState extends State Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - elevation: 0, - ), - body: Padding( - padding: EdgeInsets.symmetric(vertical: 10.r), - child: Obx(() { - return EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - logic.getList(); - }, - onLoad: () async { - // getList(); - }, - child: state.dataList.isNotEmpty - ? ListView.builder( - itemCount: state.dataList.length, - itemBuilder: (context, index) { - KnowledgeReportDetail item = state.dataList[index]; - return InkWell( - onTap: () { - /* RouterManager.router.navigateTo( + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation){ + return Scaffold( + backgroundColor: Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + title: Obx(() { + return Text(state.knowledgeName.value, style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))); + }), + centerTitle: true, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), + ], + elevation: 0, + ), + body: Padding( + padding: EdgeInsets.symmetric(vertical: 10.r), + child: Obx(() { + return EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + logic.getList(); + }, + onLoad: () async { + // getList(); + }, + child: state.dataList.isNotEmpty + ? ListView.builder( + itemCount: state.dataList.length, + itemBuilder: (context, index) { + KnowledgeReportDetail item = state.dataList[index]; + return InkWell( + onTap: () { + /* RouterManager.router.navigateTo( context, RouterManager.quickCheckPersonalPath + '?jobId=${item.jobName}&studentId=$studentId', transition: getTransition(), );*/ - }, - child: Container( - margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r), - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), - decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10.r)), color: Colors.white), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - item.publishTime.substring(0, 10), - style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), - ), - SizedBox( - width: 10.r, - ), - Expanded( - child: Text( - item.homeworkName, - style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), - )), - InkWell( - onTap: () { - EasyLoading.show(status: 'loading...'); - showImg(item.questionPicture, context); - }, - child: Container( - width: 49.r, - height: 22.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20.r)), - border: Border.all(width: 1.r, color: Color(0xFF8B8B8B)), - ), - child: Center( - child: Text( - '第${item.questionNo}题', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)), - ), - ), - ), - ), - ], - ), - SizedBox( - height: 10.r, - ), - Container( - margin: EdgeInsets.only(top: 8.h), - padding: EdgeInsets.zero, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.spaceBetween, + }, + child: Container( + margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r), + padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10.r)), color: Colors.white), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, children: [ + Text( + item.publishTime.substring(0, 10), + style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), + ), + SizedBox( + width: 10.r, + ), + Expanded( + child: Text( + item.homeworkName, + style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), + )), InkWell( onTap: () { EasyLoading.show(status: 'loading...'); - showStudent(item.homeworkId, item.templateId, item.questionNo, item.homeworkName); + showImg(item.questionPicture, context); }, child: Container( - margin: EdgeInsets.only(right: 6.r), - width: 56.r, - height: 20.r, - decoration: BoxDecoration( - color: Color(0xFFD4FFED), - borderRadius: BorderRadius.circular(20.r), + width: 49.r, + height: 22.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.r)), + border: Border.all(width: 1.r, color: Color(0xFF8B8B8B)), + ), + child: Center( + child: Text( + '第${item.questionNo}题', + style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - quickText('正确率', color: Color(0xFF4CC793), size: 10.sp), - Image.asset( - 'assets/images/icon_back_green.png', - width: 8.r, - height: 8.r, - ) - ], - )), - ), - Expanded( - flex: 1, - child: Container( - child: Row( - children: [ - Expanded( - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.r), - ), - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 8.h, - animationDuration: 2500, - percent: item.correctRate / 100, - progressColor: Color(0xFF90E0BE), - backgroundColor: Color(0xFFE8E8E8), - barRadius: Radius.circular(10.r), - ), - ), - ), - SizedBox(width: 4.w), - quickText('${item.correctRate.toStringAsFixed(0)}%', size: 10.sp, color: Color(0xFF606060)) - ], ), ), ), ], ), - ), - /* progressBar(context, + SizedBox( + height: 10.r, + ), + Container( + margin: EdgeInsets.only(top: 8.h), + padding: EdgeInsets.zero, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: () { + EasyLoading.show(status: 'loading...'); + showStudent(item.homeworkId, item.templateId, item.questionNo, item.homeworkName); + }, + child: Container( + margin: EdgeInsets.only(right: 6.r), + width: 56.r, + height: 20.r, + decoration: BoxDecoration( + color: Color(0xFFD4FFED), + borderRadius: BorderRadius.circular(20.r), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + quickText('正确率', color: Color(0xFF4CC793), size: 10.sp), + Image.asset( + 'assets/images/icon_back_green.png', + width: 8.r, + height: 8.r, + ) + ], + )), + ), + Expanded( + flex: 1, + child: Container( + child: Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.r), + ), + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 8.h, + animationDuration: 2500, + percent: item.correctRate / 100, + progressColor: Color(0xFF90E0BE), + backgroundColor: Color(0xFFE8E8E8), + barRadius: Radius.circular(10.r), + ), + ), + ), + SizedBox(width: 4.w), + quickText('${item.correctRate.toStringAsFixed(0)}%', size: 10.sp, color: Color(0xFF606060)) + ], + ), + ), + ), + ], + ), + ), + /* progressBar(context, title: '正确率 >', color: Color(0xFF90E0BE), percent: item.correctRate / 100, @@ -234,16 +236,17 @@ class _KnowledgePointsGraspDetailPageState extends 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: () => Get.back(), - ), - 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), - ), - ), - ); + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation){ + 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: () => Get.back(), + ), + 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 diff --git a/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_view.dart b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_view.dart index 0f4e9fc..fb5229e 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_view.dart @@ -24,189 +24,222 @@ class _StudentPersonalPageState extends 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.studentInfo.value.studentName, - style: TextStyle(fontSize: 14.sp, color: const Color(0xFF000000)), - ); - }), - centerTitle: true, - leading: IconButton( - icon: const Icon(Icons.arrow_back_ios, color: Colors.black), - onPressed: () => Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - ), - body: SingleChildScrollView( - child: Column( - children: [ - Padding( - padding: EdgeInsets.only(top: 14.r, left: 14.r), - child: Row( - children: [ - InkWell( - onTap: () { - // RouterManager.router.navigateTo(context, - // '${RouterManager.jobPersonalDetailPath}?studentId=${widget.studentId}&studentName=${Uri.encodeComponent(state.studentInfo.studentName!)}'); - Get.toNamed(Routes.studentWorkDetailPage, - arguments: {'studentId': state.studentInfo.value.studentId, 'studentName': state.studentInfo.value.studentName}); - }, - child: Container( - width: 93.r, - height: 28.r, - decoration: BoxDecoration( - color: const Color(0xFFEAF3FF), - borderRadius: BorderRadius.circular(4.r), - ), - child: Center( - child: Text( - '历史作业', - style: TextStyle(fontSize: 10.r, color: const Color(0xFF2080F7)), - ), - ), - ), - ), - SizedBox( - width: 10.r, - ), - InkWell( - onTap: () => - showAnswerHandwriting(context, homeworkId: state.homeworkId, studentId: state.studentId).then((e) => ToastUtils.dismiss()), - child: Container( - width: 93.r, - height: 28.r, - decoration: BoxDecoration( - color: const Color(0xFFEDFFF7), - borderRadius: BorderRadius.circular(4.r), - ), - child: Center( - child: Text( - '原稿笔迹', - style: TextStyle(fontSize: 10.r, color: const Color(0xFF4CC793)), - ), - ), - ), - ), - ], - ), - ), - //客观题 - Container( - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), - margin: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(6.r)), - ), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - '客观题', - style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600), - ), - SizedBox( - width: 10.r, - ), - Obx(() { - return Text( - '${state.studentInfo.value.kgtCorrectRate}%', - style: TextStyle(fontSize: 14.sp, color: const Color(0xFF6888FD), fontWeight: FontWeight.w600), - ); - }), - ], - ), - SizedBox( - height: 10.r, - ), - Obx(() { - return SizedBox( - height: state.studentInfo.value.kgtList.length > 8 ? 300.r : state.studentInfo.value.kgtList.length * 40.r + 40.r, - child: StudentKgTable( - headList: const ['题号', '学生答案', '标准答案'], - bodyList: state.studentInfo.value.kgtList, - questionNumCall: (questionNo, templateId) { - showAnswerHandwriting(context, - homeworkId: state.homeworkId, studentId: state.studentId, questionNo: questionNo, templateId: templateId) - .then((e) => ToastUtils.dismiss()); - // showAnswerHandwriting(context, jobId: widget.jobId, studentId: widget.studentId, questionNo: int.parse(no)).then((value) { - // ref.read(jobHandwritingDrawingTrajectoryProvider.notifier).setVal([]); - // }); - }, - ), - ); - }) - ], - ), - ), - SizedBox( - height: 15.r, - ), - //主观题 - Container( - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), - margin: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(6.r)), - ), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - '主观题', - style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600), - ), - SizedBox( - width: 10.r, - ), - Obx(() { - return Text( - '${state.studentInfo.value.zgtCorrectRate}%', - style: TextStyle(fontSize: 14.sp, color: const Color(0xFF6888FD), fontWeight: FontWeight.w600), - ); - }), - ], - ), - SizedBox( - height: 10.r, - ), - Obx(() { - return SizedBox( - height: state.studentInfo.value.zgtList.length > 8 ? 300.r : state.studentInfo.value.zgtList.length * 40.r + 40.r, - child: StudentZgTable( - headList: const ['题号', '用时', '批注结果', '答案'], - bodyList: state.studentInfo.value.zgtList, - questionNumCall: (questionNo, templateId) { - /* showAnswerHandwriting(context, jobId: widget.jobId, studentId: widget.studentId, questionNo: int.parse(no)).then((value) { - ref.read(jobHandwritingDrawingTrajectoryProvider.notifier).setVal([]); - });*/ - showAnswerHandwriting(context, - homeworkId: state.homeworkId, studentId: state.studentId, questionNo: questionNo, templateId: templateId) - .then((e) => ToastUtils.dismiss()); - }, - ), - ); - }) - ], - ), - ), + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation) { + return Scaffold( + backgroundColor: const Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + title: Obx(() { + return Text( + state.studentInfo.value.studentName, + style: TextStyle(fontSize: 14.sp, color: const Color(0xFF000000)), + ); + }), + centerTitle: true, + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), ], ), - ), - ); + body: SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(top: 14.r, left: 14.r), + child: Row( + children: [ + InkWell( + onTap: () { + // RouterManager.router.navigateTo(context, + // '${RouterManager.jobPersonalDetailPath}?studentId=${widget.studentId}&studentName=${Uri.encodeComponent(state.studentInfo.studentName!)}'); + Get.toNamed(Routes.studentWorkDetailPage, arguments: { + 'studentId': state.studentInfo.value.studentId, + 'studentName': state.studentInfo.value.studentName + }); + }, + child: Container( + width: 93.r, + height: 28.r, + decoration: BoxDecoration( + color: const Color(0xFFEAF3FF), + borderRadius: BorderRadius.circular(4.r), + ), + child: Center( + child: Text( + '历史作业', + style: TextStyle( + fontSize: 10.r, color: const Color(0xFF2080F7)), + ), + ), + ), + ), + SizedBox( + width: 10.r, + ), + InkWell( + onTap: () => showAnswerHandwriting(context, + homeworkId: state.homeworkId, + studentId: state.studentId) + .then((e) => ToastUtils.dismiss()), + child: Container( + width: 93.r, + height: 28.r, + decoration: BoxDecoration( + color: const Color(0xFFEDFFF7), + borderRadius: BorderRadius.circular(4.r), + ), + child: Center( + child: Text( + '原稿笔迹', + style: TextStyle( + fontSize: 10.r, color: const Color(0xFF4CC793)), + ), + ), + ), + ), + ], + ), + ), + //客观题 + Container( + padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), + margin: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(6.r)), + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + '客观题', + style: TextStyle( + fontSize: 14.sp, + color: const Color(0xFF5C5C5C), + fontWeight: FontWeight.w600), + ), + SizedBox( + width: 10.r, + ), + Obx(() { + return Text( + '${state.studentInfo.value.kgtCorrectRate}%', + style: TextStyle( + fontSize: 14.sp, + color: const Color(0xFF6888FD), + fontWeight: FontWeight.w600), + ); + }), + ], + ), + SizedBox( + height: 10.r, + ), + Obx(() { + return SizedBox( + height: state.studentInfo.value.kgtList.length > 8 + ? 300.r + : state.studentInfo.value.kgtList.length * 40.r + + 40.r, + child: StudentKgTable( + headList: const ['题号', '学生答案', '标准答案'], + bodyList: state.studentInfo.value.kgtList, + questionNumCall: (questionNo, templateId) { + showAnswerHandwriting(context, + homeworkId: state.homeworkId, + studentId: state.studentId, + questionNo: questionNo, + templateId: templateId) + .then((e) => ToastUtils.dismiss()); + // showAnswerHandwriting(context, jobId: widget.jobId, studentId: widget.studentId, questionNo: int.parse(no)).then((value) { + // ref.read(jobHandwritingDrawingTrajectoryProvider.notifier).setVal([]); + // }); + }, + ), + ); + }) + ], + ), + ), + SizedBox( + height: 15.r, + ), + //主观题 + Container( + padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), + margin: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(6.r)), + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + '主观题', + style: TextStyle( + fontSize: 14.sp, + color: const Color(0xFF5C5C5C), + fontWeight: FontWeight.w600), + ), + SizedBox( + width: 10.r, + ), + Obx(() { + return Text( + '${state.studentInfo.value.zgtCorrectRate}%', + style: TextStyle( + fontSize: 14.sp, + color: const Color(0xFF6888FD), + fontWeight: FontWeight.w600), + ); + }), + ], + ), + SizedBox( + height: 10.r, + ), + Obx(() { + return SizedBox( + height: state.studentInfo.value.zgtList.length > 8 + ? 300.r + : state.studentInfo.value.zgtList.length * 40.r + + 40.r, + child: StudentZgTable( + headList: const ['题号', '用时', '批注结果', '答案'], + bodyList: state.studentInfo.value.zgtList, + questionNumCall: (questionNo, templateId) { + /* showAnswerHandwriting(context, jobId: widget.jobId, studentId: widget.studentId, questionNo: int.parse(no)).then((value) { + ref.read(jobHandwritingDrawingTrajectoryProvider.notifier).setVal([]); + });*/ + showAnswerHandwriting(context, + homeworkId: state.homeworkId, + studentId: state.studentId, + questionNo: questionNo, + templateId: templateId) + .then((e) => ToastUtils.dismiss()); + }, + ), + ); + }) + ], + ), + ), + ], + ), + ), + ); + }); } @override diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart index 84084a6..29e48a7 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart @@ -28,212 +28,241 @@ class _StudentWorkDetailPageState extends State { @override Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Color.fromRGBO(245, 245, 245, 1), - appBar: AppBar( - backgroundColor: Colors.white, - title: Text('${state.studentName}作业详情', style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))), - centerTitle: true, - leading: IconButton( - icon: Icon(Icons.arrow_back_ios, color: Colors.black), - onPressed: () => Get.back(), + return OrientationBuilder( + builder: (BuildContext context, Orientation orientation) { + return Scaffold( + backgroundColor: Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + title: Text('${state.studentName}作业详情', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))), + centerTitle: true, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), + ], + elevation: 0, ), - actions: const [ - ReturnToHomepage(), - ], - elevation: 0, - ), - body: Column( - children: [ - Container( - height: 1.r, - width: MediaQuery.of(context).size.width, - color: Color.fromRGBO(179, 179, 179, 0.3), - ), - Container( - color: Colors.white, - padding: EdgeInsets.symmetric(vertical: 2.r), - child: Row( - children: [ - InkWell( - onTap: () { - EasyLoading.show(status: 'loading...'); - state.page = 1; - state.totalPages = 0; - state.isJob.value = true; - logic.getList(); - }, - child: SizedBox( - width: (MediaQuery.of(context).size.width - 1.r) / 2, - height: 40.r, - child: Obx(() { - return Center( - child: Text( - '作业', - style: TextStyle(fontSize: 14.sp, color: state.isJob.value ? Color(0xFF7491FD) : Color(0xFF505E6E)), - )); - }), - ), - ), - Container( - height: 40.r, - width: 1.r, - color: Color.fromRGBO(179, 179, 179, 0.3), - ), - InkWell( - onTap: () { - EasyLoading.show(status: 'loading...'); - state.isJob.value = false; - state.page = 1; - state.totalPages = 0; - logic.getList(); - }, - child: SizedBox( - width: (MediaQuery.of(context).size.width - 1.r) / 2, - height: 40.r, - child: Center(child: Obx(() { - return Text( - '考试', - style: TextStyle(fontSize: 14.sp, color: !state.isJob.value ? Color(0xFF7491FD) : Color(0xFF505E6E)), - ); - })), - ), - ), - ], + body: Column( + children: [ + Container( + height: 1.r, + width: MediaQuery.of(context).size.width, + color: Color.fromRGBO(179, 179, 179, 0.3), ), - ), - Obx(() { - return Container( - margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), - padding: EdgeInsets.only(top: 10.r, left: 10.r, right: 10.r, bottom: 10.r), - decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10.r)), color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + Container( + color: Colors.white, + padding: EdgeInsets.symmetric(vertical: 2.r), + child: Row( children: [ - Text( - '总览:', - style: TextStyle(fontSize: 12.sp, color: Color(0xFF7491FD), fontWeight: FontWeight.w600), + InkWell( + onTap: () { + EasyLoading.show(status: 'loading...'); + state.page = 1; + state.totalPages = 0; + state.isJob.value = true; + logic.getList(); + }, + child: SizedBox( + width: (MediaQuery.of(context).size.width - 1.r) / 2, + height: 40.r, + child: Obx(() { + return Center( + child: Text( + '作业', + style: TextStyle( + fontSize: 14.sp, + color: state.isJob.value + ? Color(0xFF7491FD) + : Color(0xFF505E6E)), + )); + }), + ), + ), + Container( + height: 40.r, + width: 1.r, + color: Color.fromRGBO(179, 179, 179, 0.3), + ), + InkWell( + onTap: () { + EasyLoading.show(status: 'loading...'); + state.isJob.value = false; + state.page = 1; + state.totalPages = 0; + logic.getList(); + }, + child: SizedBox( + width: (MediaQuery.of(context).size.width - 1.r) / 2, + height: 40.r, + child: Center(child: Obx(() { + return Text( + '考试', + style: TextStyle( + fontSize: 14.sp, + color: !state.isJob.value + ? Color(0xFF7491FD) + : Color(0xFF505E6E)), + ); + })), + ), ), - ProgressBar( - title: '客观题正确率:', - color: Color(0xFFB8C7FF), - percent: state.studentData.value.kgtCorrectRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - ProgressBar( - title: '主观题正确率:', - color: Color(0xFFB8C7FF), - percent: state.studentData.value.zgtCorrectRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - ProgressBar( - title: '总正确率:', - color: Color(0xFFB8C7FF), - percent: state.studentData.value.correctRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), ], ), - ); - }), - Obx(() { - return JobConditionFilter( - controller: logic.tabController, - jobType: state.isJob.value ? 1 : 2, - customTimeStr: state.customTimeStr.value, - customTime: logic.tabController.index != 2 || - ((state.dateEnd == null || state.dateEnd == '') && (state.dateStart == null || state.dateStart == '')) - ? null - : PickerDateRange( - state.dateStart == null || state.dateStart == '' ? null : DateTime.parse(state.dateStart!), - state.dateEnd == null || state.dateEnd == '' ? null : DateTime.parse(state.dateEnd!), - ), - onTimeFilter: (String? startTime, String? endTime) { - EasyLoading.show(status: 'loading...'); - if (startTime == null && endTime == null) { - if (logic.tabController.index == 2) { - logic.tabController.animateTo(0); + ), + Obx(() { + return Container( + margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), + padding: EdgeInsets.only( + top: 10.r, left: 10.r, right: 10.r, bottom: 10.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10.r)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '总览:', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7491FD), + fontWeight: FontWeight.w600), + ), + ProgressBar( + title: '客观题正确率:', + color: Color(0xFFB8C7FF), + percent: state.studentData.value.kgtCorrectRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ProgressBar( + title: '主观题正确率:', + color: Color(0xFFB8C7FF), + percent: state.studentData.value.zgtCorrectRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ProgressBar( + title: '总正确率:', + color: Color(0xFFB8C7FF), + percent: state.studentData.value.correctRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ], + ), + ); + }), + Obx(() { + return JobConditionFilter( + controller: logic.tabController, + jobType: state.isJob.value ? 1 : 2, + customTimeStr: state.customTimeStr.value, + customTime: logic.tabController.index != 2 || + ((state.dateEnd == null || state.dateEnd == '') && + (state.dateStart == null || + state.dateStart == '')) + ? null + : PickerDateRange( + state.dateStart == null || state.dateStart == '' + ? null + : DateTime.parse(state.dateStart!), + state.dateEnd == null || state.dateEnd == '' + ? null + : DateTime.parse(state.dateEnd!), + ), + onTimeFilter: (String? startTime, String? endTime) { + EasyLoading.show(status: 'loading...'); + if (startTime == null && endTime == null) { + if (logic.tabController.index == 2) { + logic.tabController.animateTo(0); + } + state.dateStart = + Utils.getWeekStartDate().toString().substring(0, 10); + state.dateEnd = + Utils.getWeekEndDate().toString().substring(0, 10); + state.customTimeStr.value = '自定义'; + } else { + state.dateStart = startTime ?? ''; + state.dateEnd = endTime ?? ''; } - state.dateStart = Utils.getWeekStartDate().toString().substring(0, 10); - state.dateEnd = Utils.getWeekEndDate().toString().substring(0, 10); - state.customTimeStr.value = '自定义'; - } else { - state.dateStart = startTime ?? ''; - state.dateEnd = endTime ?? ''; - } - state.page = 1; - logic.getList(); - }, - refreshTime: (value) { - if (value != null && value.startDate != null) { - state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? ''; + state.page = 1; + logic.getList(); + }, + refreshTime: (value) { + if (value != null && value.startDate != null) { + state.customTimeStr.value = + value.startDate?.toString().substring(0, 10) ?? ''; - if (value.endDate != null) { - if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) { - state.customTimeStr.value = '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}'; - } else { - state.customTimeStr.value = '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}'; + if (value.endDate != null) { + if (!Utils.isPad() && + value.startDate!.year == value.endDate!.year) { + state.customTimeStr.value = + '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}'; + } else { + state.customTimeStr.value = + '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}'; + } } } - } - }); - }), - Padding( - padding: EdgeInsets.only(top: 14.r, right: 14.r), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - '注:', - style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), - ), - Container( - width: 10.r, - height: 10.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(5.r)), - // color: Color(0xFF4CC793), - border: Border.all(width: 1.r, color: Color(0xFF4CC793)), + }); + }), + Padding( + padding: EdgeInsets.only(top: 14.r, right: 14.r), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + '注:', + style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), ), - ), - SizedBox( - width: 2.r, - ), - Text( - '正确', - style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), - ), - SizedBox( - width: 15.r, - ), - Container( - width: 10.r, - height: 10.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(5.r)), - // color: Color(0xFFFF7474), - border: Border.all(width: 1.r, color: Color(0xFFFF7474)), + Container( + width: 10.r, + height: 10.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.r)), + // color: Color(0xFF4CC793), + border: Border.all(width: 1.r, color: Color(0xFF4CC793)), + ), ), - ), - SizedBox( - width: 2.r, - ), - Text( - '错误', - style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), - ), - SizedBox( - width: 15.r, - ), - Container( - width: 10.r, - height: 10.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(5.r)), - // color: Color(0xFF666666), - border: Border.all(width: 1.r, color: Color(0xFF666666)), - // border: Border.all(width: 1.r,color: Colors.grey), - /* boxShadow: [ + SizedBox( + width: 2.r, + ), + Text( + '正确', + style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), + ), + SizedBox( + width: 15.r, + ), + Container( + width: 10.r, + height: 10.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.r)), + // color: Color(0xFFFF7474), + border: Border.all(width: 1.r, color: Color(0xFFFF7474)), + ), + ), + SizedBox( + width: 2.r, + ), + Text( + '错误', + style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), + ), + SizedBox( + width: 15.r, + ), + Container( + width: 10.r, + height: 10.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.r)), + // color: Color(0xFF666666), + border: Border.all(width: 1.r, color: Color(0xFF666666)), + // border: Border.all(width: 1.r,color: Colors.grey), + /* boxShadow: [ BoxShadow( color: Colors.grey, offset: Offset(1.w, 1.h), //阴影y轴偏移量 @@ -241,274 +270,340 @@ class _StudentWorkDetailPageState extends State { spreadRadius: 0.1, //阴影扩散程度 ) ],*/ + ), ), - ), - SizedBox( - width: 2.r, - ), - Text( - '已作答未批阅', - style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), - ), - SizedBox( - width: 15.r, - ), - Container( - width: 10.r, - height: 10.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(5.r)), - border: Border.all(width: 1.r, color: Color(0xFFDDDDDD)), - // color: Color(0xFFDDDDDD), + SizedBox( + width: 2.r, ), - ), - SizedBox( - width: 2.r, - ), - Text( - '未做', - style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), - ), - ], + Text( + '已作答未批阅', + style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), + ), + SizedBox( + width: 15.r, + ), + Container( + width: 10.r, + height: 10.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.r)), + border: Border.all(width: 1.r, color: Color(0xFFDDDDDD)), + // color: Color(0xFFDDDDDD), + ), + ), + SizedBox( + width: 2.r, + ), + Text( + '未做', + style: TextStyle(fontSize: 8.sp, color: Color(0xFF8B8B8B)), + ), + ], + ), ), - ), - Expanded( - child: Padding( - padding: EdgeInsets.symmetric(vertical: 10.r), - child: Obx(() { - return EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - state.page = 1; - logic.getList(); - }, - onLoad: () async { - if (state.page < state.totalPages) { - state.page += 1; + Expanded( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 10.r), + child: Obx(() { + return EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + state.page = 1; logic.getList(); - } - }, - child: state.studentData.value.items.items.isNotEmpty - ? ListView.builder( - itemCount: state.studentData.value.items.items.length, - itemBuilder: (context, index) { - StudentItems item = state.studentData.value.items.items[index]; - return InkWell( - onTap: () { - Get.toNamed(Routes.studentPersonalPage, arguments: {'homeworkId': item.id, 'studentId': state.studentId}); - }, - child: Container( - margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r), - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10.r)), - color: item.allNotDone ? const Color(0xFFFFEDD3) : Colors.white), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 32.w, - height: 18.h, - alignment: Alignment.center, - padding: EdgeInsets.only(left: 2.w), - decoration: BoxDecoration( - color: state.isJob.value ? const Color.fromRGBO(104, 136, 253, 1) : const Color(0xFFFFA116), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(14.r), - topRight: Radius.circular(3.r), - bottomLeft: Radius.circular(4.r), - bottomRight: Radius.circular(4.r), + }, + onLoad: () async { + if (state.page < state.totalPages) { + state.page += 1; + logic.getList(); + } + }, + child: state.studentData.value.items.items.isNotEmpty + ? ListView.builder( + itemCount: + state.studentData.value.items.items.length, + itemBuilder: (context, index) { + StudentItems item = + state.studentData.value.items.items[index]; + return InkWell( + onTap: () { + Get.toNamed(Routes.studentPersonalPage, + arguments: { + 'homeworkId': item.id, + 'studentId': state.studentId + }); + }, + child: Container( + margin: EdgeInsets.symmetric( + vertical: 5.r, horizontal: 14.r), + padding: EdgeInsets.symmetric( + vertical: 14.r, horizontal: 10.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.r)), + color: item.allNotDone + ? const Color(0xFFFFEDD3) + : Colors.white), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: 32.w, + height: 18.h, + alignment: Alignment.center, + padding: EdgeInsets.only(left: 2.w), + decoration: BoxDecoration( + color: state.isJob.value + ? const Color.fromRGBO( + 104, 136, 253, 1) + : const Color(0xFFFFA116), + 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: Text( + state.isJob.value ? '作业' : '考试', + style: TextStyle( + fontSize: 10.sp, + color: Colors.white), ), ), - margin: EdgeInsets.only(right: 4.w), - child: Text( - state.isJob.value ? '作业' : '考试', - style: TextStyle(fontSize: 10.sp, color: Colors.white), - ), - ), - Expanded( - child: Text( - item.name, - style: TextStyle(fontSize: 12.sp, color: Color(0xFF464646)), - )), - // SizedBox(width: 5.r,), - // Text('2024.1',style: TextStyle(fontSize: 12.sp,color: Color(0xFF5B5B5B)),), - - Container( - width: 40.r, - height: 20.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(4.r)), - border: Border.all(width: 1.r, color: Color(0xFF4CC793)), - ), - child: Center( + Expanded( child: Text( - EnumUtils.formatSubject(item.subject), - style: TextStyle(fontSize: 10.sp, color: Color(0xFF4CC793)), + item.name, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF464646)), )), - ), - ], - ), - SizedBox( - height: 10.r, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '客:', - style: TextStyle(fontSize: 12.sp, color: Color(0xFF5B5B5B)), - ), - SizedBox( - width: 5.r, - ), - item.kgtList.isNotEmpty - ? Expanded( - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.start, - spacing: 8, - runSpacing: 5, - children: List.generate(item.kgtList.length, (i) { - KgtList subjective = item.kgtList[i]; - return Container( - width: 20.r, - height: 20.r, - decoration: BoxDecoration( - color: Colors.transparent, - border: Border.all( - width: 1.r, - color: subjective.state == 0 - ? Color(0xFFDDDDDD) - : subjective.state == 3 - ? Color(0xFF4CC793) - : subjective.state == 2 - ? Color(0xFFFF7474) - : Color(0xFF666666)), - borderRadius: BorderRadius.all(Radius.circular(10.r))), - child: Center( - child: Text( - subjective.questionNo.toString(), - style: TextStyle( - fontSize: 10.r, - color: subjective.state == 0 - ? Color(0xFFDDDDDD) - : subjective.state == 3 - ? Color(0xFF4CC793) - : subjective.state == 2 - ? Color(0xFFFF7474) - : Color(0xFF666666)), - )), - ); - }), + // SizedBox(width: 5.r,), + // Text('2024.1',style: TextStyle(fontSize: 12.sp,color: Color(0xFF5B5B5B)),), + + Container( + width: 40.r, + height: 20.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(4.r)), + border: Border.all( + width: 1.r, + color: Color(0xFF4CC793)), + ), + child: Center( + child: Text( + EnumUtils.formatSubject( + item.subject), + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF4CC793)), + )), + ), + ], + ), + SizedBox( + height: 10.r, + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '客:', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF5B5B5B)), + ), + SizedBox( + width: 5.r, + ), + item.kgtList.isNotEmpty + ? Expanded( + child: Wrap( + direction: Axis.horizontal, + alignment: + WrapAlignment.start, + spacing: 8, + runSpacing: 5, + children: List.generate( + item.kgtList.length, + (i) { + KgtList subjective = + item.kgtList[i]; + return Container( + width: 20.r, + height: 20.r, + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all( + width: 1.r, + color: subjective.state == 0 + ? Color(0xFFDDDDDD) + : subjective.state == 3 + ? Color(0xFF4CC793) + : subjective.state == 2 + ? Color(0xFFFF7474) + : Color(0xFF666666)), + borderRadius: BorderRadius.all(Radius.circular(10.r))), + child: Center( + child: Text( + subjective.questionNo + .toString(), + style: TextStyle( + fontSize: 10.r, + color: subjective + .state == + 0 + ? Color( + 0xFFDDDDDD) + : subjective.state == + 3 + ? Color( + 0xFF4CC793) + : subjective.state == + 2 + ? Color( + 0xFFFF7474) + : Color( + 0xFF666666)), + )), + ); + }), + ), + ) + : Text( + '无', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF5B5B5B)), ), - ) - : Text( - '无', - style: TextStyle(fontSize: 12.sp, color: Color(0xFF5B5B5B)), - ), - ], - ), - SizedBox( - height: 10.r, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '主:', - style: TextStyle(fontSize: 12.sp, color: Color(0xFF5B5B5B)), - ), - SizedBox( - width: 5.r, - ), - item.zgtList.isNotEmpty - ? Expanded( - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.start, - spacing: 8, - runSpacing: 5, - children: List.generate(item.zgtList.length, (i) { - ZgtList subjective = item.zgtList[i]; - return Container( - width: 20.r, - height: 20.r, - decoration: BoxDecoration( - color: Colors.transparent, - border: Border.all( - width: 1.r, - color: subjective.state == 0 - ? Color(0xFFDDDDDD) - : subjective.state == 3 - ? Color(0xFF4CC793) - : subjective.state == 2 - ? Color(0xFFFF7474) - : Color(0xFF666666)), - borderRadius: BorderRadius.all(Radius.circular(10.r))), - child: Center( - child: Text( - subjective.questionNo.toString(), - style: TextStyle( - fontSize: 10.r, - color: subjective.state == 0 - ? Color(0xFFDDDDDD) - : subjective.state == 3 - ? Color(0xFF4CC793) - : subjective.state == 2 - ? Color(0xFFFF7474) - : Color(0xFF666666)), - )), - ); - }), + ], + ), + SizedBox( + height: 10.r, + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '主:', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF5B5B5B)), + ), + SizedBox( + width: 5.r, + ), + item.zgtList.isNotEmpty + ? Expanded( + child: Wrap( + direction: Axis.horizontal, + alignment: + WrapAlignment.start, + spacing: 8, + runSpacing: 5, + children: List.generate( + item.zgtList.length, + (i) { + ZgtList subjective = + item.zgtList[i]; + return Container( + width: 20.r, + height: 20.r, + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all( + width: 1.r, + color: subjective.state == 0 + ? Color(0xFFDDDDDD) + : subjective.state == 3 + ? Color(0xFF4CC793) + : subjective.state == 2 + ? Color(0xFFFF7474) + : Color(0xFF666666)), + borderRadius: BorderRadius.all(Radius.circular(10.r))), + child: Center( + child: Text( + subjective.questionNo + .toString(), + style: TextStyle( + fontSize: 10.r, + color: subjective + .state == + 0 + ? Color( + 0xFFDDDDDD) + : subjective.state == + 3 + ? Color( + 0xFF4CC793) + : subjective.state == + 2 + ? Color( + 0xFFFF7474) + : Color( + 0xFF666666)), + )), + ); + }), + ), + ) + : Text( + '无', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF5B5B5B)), ), - ) - : Text( - '无', - style: TextStyle(fontSize: 12.sp, color: Color(0xFF5B5B5B)), - ), - ], - ), - ProgressBar( - title: '客观题正确率:', - color: Color(0xFF90E0BE), - percent: item.kgtCorrectRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - ProgressBar( - title: '主观题正确率:', - color: Color(0xFF90E0BE), - percent: item.zgtCorrectRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - ProgressBar( - title: '总正确率:', - color: Color(0xFF90E0BE), - percent: item.correctRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - ], + ], + ), + ProgressBar( + title: '客观题正确率:', + color: Color(0xFF90E0BE), + percent: item.kgtCorrectRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ProgressBar( + title: '主观题正确率:', + color: Color(0xFF90E0BE), + percent: item.zgtCorrectRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ProgressBar( + title: '总正确率:', + color: Color(0xFF90E0BE), + percent: item.correctRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ], + ), ), - ), - ); - }) - : const MyEmptyWidget(), - ); - }), + ); + }) + : const MyEmptyWidget(), + ); + }), + ), ), - ), - ], - ), - ); + ], + ), + ); + }); } @override