diff --git a/.metadata b/.metadata deleted file mode 100644 index 14f5fc9..0000000 --- a/.metadata +++ /dev/null @@ -1,33 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled. - -version: - revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - channel: stable - -project_type: app - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - - platform: android - create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - - platform: ios - create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/android/app/build.gradle b/android/app/build.gradle deleted file mode 100644 index 69c3399..0000000 --- a/android/app/build.gradle +++ /dev/null @@ -1,73 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - namespace "com.example.school_asignment_app" - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.school_asignment_app" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. -// minSdkVersion flutter.minSdkVersion - minSdkVersion 21 - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/android/app/src/main/kotlin/com/example/school_asignment_app/MainActivity.kt b/android/app/src/main/kotlin/com/example/school_asignment_app/MainActivity.kt deleted file mode 100644 index bee54ec..0000000 --- a/android/app/src/main/kotlin/com/example/school_asignment_app/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.example.school_asignment_app - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/android/build.gradle b/android/build.gradle deleted file mode 100644 index f7eb7f6..0000000 --- a/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.7.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/android/gradle.properties b/android/gradle.properties deleted file mode 100644 index 94adc3a..0000000 --- a/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true diff --git a/android/settings.gradle b/android/settings.gradle deleted file mode 100644 index 44e62bc..0000000 --- a/android/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':app' - -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() - -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } - -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/assets/images/icon_back_green.png b/assets/images/icon_back_green.png deleted file mode 100644 index 3df3757..0000000 Binary files a/assets/images/icon_back_green.png and /dev/null differ diff --git a/assets/images/right_icon_blue.png b/assets/images/right_icon_blue.png deleted file mode 100644 index 87bb071..0000000 Binary files a/assets/images/right_icon_blue.png and /dev/null differ diff --git a/lib/common/mixins/request_tool_mixin.dart b/lib/common/mixins/request_tool_mixin.dart deleted file mode 100644 index 2b35b5c..0000000 --- a/lib/common/mixins/request_tool_mixin.dart +++ /dev/null @@ -1,6 +0,0 @@ -import 'package:school_asignment_app/common/request/rest_dio.dart'; -import 'package:school_asignment_app/common/api/retrofit_client.dart'; - -mixin RequestToolMixin { - RetrofitClient getClient() => RequestTool.instance.getClient(); -} diff --git a/lib/page/home_page/children/annotate_class/annotate_class_logic.dart b/lib/page/home_page/children/annotate_class/annotate_class_logic.dart deleted file mode 100644 index 6f2b47c..0000000 --- a/lib/page/home_page/children/annotate_class/annotate_class_logic.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:get/get.dart'; -import 'package:get_storage/get_storage.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; - -import 'annotate_class_state.dart'; - -class AnnotateClassLogic extends GetxController with RequestToolMixin{ - final AnnotateClassState state = AnnotateClassState(); - - @override - void onInit(){ - super.onInit(); - state.homeworkId.value = Get.arguments['id']??''; - state.name.value = Get.arguments['name']??''; - state.grade = Get.arguments['grade']; - state.completed.value = Get.arguments['completed']??false; - EasyLoading.show(status: 'loading...'); - getList(); - } - - void getList() async{ - List data = await getClient(). getAnnotatedClassList(state.homeworkId.value); - state.classList.value = data; - - for (var element in state.classList.value) { - int commitStudentCount = 0; - int noCommitStudentCount = 0; - for (var student in element.students) { - if(student.state == 0){ - noCommitStudentCount ++; - }else{ - commitStudentCount ++; - } - } - element.commitStudentCount = commitStudentCount; - element.noCommitStudentCount = noCommitStudentCount; - } - -EasyLoading.dismiss(); - } - - void goQuickDataCheck(item){ - Get.toNamed(Routes.quickDataCheckPage,arguments: {'homeworkId':state.homeworkId.value,'classId':item.classId,'grade':state.grade,'className':item.className - }); - } - - void gojobReport(item){ - Get.toNamed(Routes.jobReportPage,arguments: {'title':state.name.value,'homeworkId':state.homeworkId.value,'grade':state.grade,'className':item.className}); - } - - -} diff --git a/lib/page/home_page/children/annotate_class/annotate_class_view.dart b/lib/page/home_page/children/annotate_class/annotate_class_view.dart deleted file mode 100644 index afa3aa3..0000000 --- a/lib/page/home_page/children/annotate_class/annotate_class_view.dart +++ /dev/null @@ -1,95 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; -import 'package:get/get.dart'; -import 'package:percent_indicator/percent_indicator.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/page/home_page/children/annotate_class/widget/annotate_item.dart'; -import 'package:school_asignment_app/page/home_page/widget/progress_bar.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; -import 'annotate_class_logic.dart'; -import 'widget/completed_annotate_item.dart'; - -class AnnotateClassPage extends StatefulWidget { - const AnnotateClassPage({Key? key}) : super(key: key); - - @override - State createState() => _AnnotateClassPageState(); -} - -class _AnnotateClassPageState extends State { - final logic = Get.find(); - final state = Get.find().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.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: () => Navigator.of(context).pop(), - ), - actions: const [ - ReturnToHomepage(), - ], - ), - body: Padding( - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), - child: Obx(() { - return - 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,); - }).toList(), - ):ListView.builder( - itemCount: state.classList.length, - itemBuilder: (context, index) { - AnnotatedClass taskItem = state.classList[index]; - return CompletedAnnotateItem(taskItem:taskItem,logic: logic,); - }): - - 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(item: item,font: 8.sp,name: state.name.value,logic: logic,); - }, - ): - ListView.builder( - itemCount: state.classList.length, - itemBuilder: (context, index) { - AnnotatedClass item = state.classList[index]; - return AnnotateItem(item: item,font: 12.sp,name: state.name.value,logic: logic,); - }); - }), - ), - ); - } - - @override - void dispose() { - Get.delete(); - super.dispose(); - } -} diff --git a/lib/page/home_page/children/annotate_class/widget/annotate_item.dart b/lib/page/home_page/children/annotate_class/widget/annotate_item.dart deleted file mode 100644 index 17658fa..0000000 --- a/lib/page/home_page/children/annotate_class/widget/annotate_item.dart +++ /dev/null @@ -1,241 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:percent_indicator/percent_indicator.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/common/utils/enum_untils.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/page/home_page/children/annotate_class/annotate_class_logic.dart'; -import 'package:school_asignment_app/page/home_page/children/annotate_class/annotate_class_state.dart'; -import 'package:school_asignment_app/page/home_page/children/annotate_class/widget/item_btn.dart'; -import 'package:school_asignment_app/page/home_page/widget/progress_bar.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; - -class AnnotateItem extends StatefulWidget { -final AnnotatedClass item; -final double font; -final String name; -final AnnotateClassLogic logic; - const AnnotateItem({Key? key, required this.item,required this.font,required this.name,required this.logic}) : super(key: key); - - @override - State createState() => _AnnotateItemState(); -} - -class _AnnotateItemState extends State { - @override - Widget build(BuildContext context) { - return Container( - padding: EdgeInsets.only(top: 10.r), - margin: EdgeInsets.only(bottom: 10.r), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadiusDirectional.circular(4.r), - boxShadow: const [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.15), blurRadius: 10)], - ), - child: Column( - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 10.r), - child: Row( - children: [ - Text( - '${EnumUtils.formatGrade(widget.item.grade)}${widget.item.className}', - style: TextStyle( - fontSize: widget.font, - color: const Color(0xFF000000)), - ), - const Spacer(), - Text( - '已交:${widget.item.commitStudentCount}', - style: TextStyle( - fontSize: widget.font - 2.sp, - color: const Color(0xFF6888FD)), - ), - SizedBox( - width: 20.r, - ), - Text( - '未交:${widget.item.noCommitStudentCount}', - style: TextStyle( - fontSize: widget.font - 2.sp, - color: const Color(0xFFFF5656)), - ), - ], - ), - ), - SizedBox( - height: 10.r, - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 8.r), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: - widget.item.finishTime != null ? - [ - Expanded( - flex:4, - child:ItemBtn(title: "收藏夹",font: widget.font - 2.sp, - clickFunction: (){ - - },), - ), - const Expanded(flex: 1, child: SizedBox()), - const Expanded(flex: 4, child: SizedBox()), - const Expanded(flex: 1, child: SizedBox()), - const Expanded(flex: 4, child: SizedBox()), - - ]:[ - Expanded( - flex: 4, - child: ItemBtn(title: "一键批阅",font: widget.font - 2.sp, - clickFunction: (){ - - },), - ), - const Expanded(flex: 1,child: Text(''),), - Expanded( - flex:4, - child: ItemBtn(title: "数据快查",font: widget.font - 2.sp,clickFunction: (){ - widget.logic.goQuickDataCheck(widget.item); - },), - ), - const Expanded(flex: 1,child: Text(''),), - Expanded( - flex:4, - child: ItemBtn(title: "收藏夹",font: widget.font - 2.sp, - clickFunction: (){ - - },), - ), - ], - ), - ), - Padding( - padding: EdgeInsets.symmetric(vertical: 10.r,horizontal: 14.r), - child: Row( - children: [ - Expanded( - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 8.h, - animationDuration: 2500, - - percent: widget.item.annotateRate / 100, - linearGradient: LinearGradient( - tileMode: TileMode.mirror, - stops: const [0.0, 1.0], - colors: widget.item.annotateRate / 100 != 1 - ? [Theme.of(context).primaryColor.withOpacity(0.1), Theme.of(context).primaryColor] - : [ - const Color.fromRGBO(144, 224, 190, 1).withOpacity(0.1), - const Color.fromRGBO(144, 224, 190, 1), - ], - ), - // linearStrokeCap: LinearStrokeCap.butt, - // progressColor: Theme.of(context).primaryColor, - backgroundColor: const Color.fromRGBO(232, 232, 232, 1), - barRadius: Radius.circular(10.r), - ), - ), - SizedBox(width: 7.w), - quickText('${widget.item.annotateRate}%', - size: widget.font - 2.sp, color: const Color.fromRGBO(70, 70, 70, 1)) - ], - ), - ), - ProgressBar( - title: '客观题正确率:', - color: const Color(0xFFB8C7FF), - percent: widget.item.kgtCorrectRate / 100, - marginEdg: EdgeInsets.zero, - padingEdg: EdgeInsets.only(top: 8.h,left: 14.r,right: 14.r), - fontSize:widget.font - 2.sp), - ProgressBar( - title: '主观题正确率:', - color: const Color(0xFFB8C7FF), - percent: widget.item.zgtCorrectRate / 100, - padingEdg: EdgeInsets.symmetric(horizontal: 10.r), - marginEdg: EdgeInsets.only(top: 8.h), - fontSize:widget.font - 2.sp), - ProgressBar( - title: '总正确率:', - color: const Color(0xFFB8C7FF), - percent: widget.item.correctRate / 100, - padingEdg: EdgeInsets.symmetric(horizontal: 10.r), - marginEdg: EdgeInsets.only(top: 8.h), - fontSize:widget.font - 2.sp), - - Container( - margin: EdgeInsets.only(top: 10.r), - decoration: BoxDecoration( - borderRadius: BorderRadius.only(bottomLeft: Radius.circular(4.r), bottomRight: Radius.circular(4.r)), - color: Colors.white, - boxShadow: const [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.15), - offset: Offset(0, -0.0001), //阴影y轴偏移量 - blurRadius: 4, //阴影模糊程度 - spreadRadius: 0, //阴影扩散程度 - ) - ], - ), - - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: - widget.item.finishTime != null ? - [ - Expanded( - child: InkWell( - onTap: () { - widget.logic.goQuickDataCheck(widget.item); - }, - child: Container( - alignment: Alignment.center, - child: quickText('数据快查', color: Color.fromRGBO(118, 118, 118, 1), size: widget.font), - ), - ), - ), - Container(width: 1.w, height: 30.h, color: const Color.fromRGBO(221, 221, 221, 1)), - Expanded( - child: InkWell( - onTap: () { - widget.logic.gojobReport(widget.item); - }, - child: Container( - alignment: Alignment.center, - child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: widget.font), - ), - )), - ] - : - [ - Expanded( - child: InkWell( - onTap: () {}, - child: Container( - alignment: Alignment.center, - child: quickText('批阅', color: const Color.fromRGBO(118, 118, 118, 1), size: widget.font), - ), - ), - ), - Container(width: 1.w, height: 30.h, color: const Color.fromRGBO(221, 221, 221, 1)), - Expanded( - child: InkWell( - onTap: () {}, - child: Container( - alignment: Alignment.center, - child: quickText('结束批阅', color: const Color.fromRGBO(118, 118, 118, 1), size: widget.font), - ), - )), - ], - ), - ) - ], - ), - ); - } -} diff --git a/lib/page/home_page/children/class_student/class_student_view.dart b/lib/page/home_page/children/class_student/class_student_view.dart deleted file mode 100644 index fc3f928..0000000 --- a/lib/page/home_page/children/class_student/class_student_view.dart +++ /dev/null @@ -1,353 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/student_item.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; - -import 'class_student_logic.dart'; - -class ClassStudentPage extends StatefulWidget { - const ClassStudentPage({Key? key}) : super(key: key); - - @override - State createState() => _ClassStudentPageState(); -} - -class _ClassStudentPageState extends State { - final logic = Get.find(); - final state = Get - .find() - .state; - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: const Color.fromRGBO(245, 245, 245, 1), - appBar: AppBar( - backgroundColor: Colors.white, - title: Obx(() { - return Text( - state.title.value, - style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333)), - ); - }), - centerTitle: true, - leading: IconButton( - icon: const Icon(Icons.arrow_back_ios, color: Colors.black), - onPressed: () => Navigator.of(context).pop(), - ), - actions: const [ - ReturnToHomepage(), - ], - ), - body: 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)), - ), - ), - ], - ), - ), - ), - ], - ), - ), - ); - }), - ) - : 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: 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: 24.r, - width: 82.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(4.r)), - color: const Color(0xFFE1E1E1), - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 3.r), - child: Image.asset( - 'assets/images/youx_icon_default.png', - width: 14.r, height: 14.r,), - ), - Padding( - padding: EdgeInsets.only( - top: 2.r, left: 4.r), - child: Text( - '优先批阅', - style: TextStyle( - fontSize: 10.sp, - color: const Color(0xFF8A9691)), - ), - ), - ], - ), - ), - ), - ], - ), - ), - ); - }, - itemCount: state.studentList.length, - ) - : const MyEmptyWidget(), - ); - }), - ), - ); - } - - @override - void dispose() { - Get.delete(); - super.dispose(); - } -} \ No newline at end of file diff --git a/lib/page/home_page/children/job_report/job_report_logic.dart b/lib/page/home_page/children/job_report/job_report_logic.dart deleted file mode 100644 index fe483ab..0000000 --- a/lib/page/home_page/children/job_report/job_report_logic.dart +++ /dev/null @@ -1,54 +0,0 @@ -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; - -import 'job_report_state.dart'; - -class JobReportLogic extends GetxController with RequestToolMixin { - final JobReportState state = JobReportState(); - - @override - void onInit(){ - super.onInit(); - state.title.value = Get.arguments['title']??''; - state.homeworkId.value = Get.arguments['homeworkId']??''; - state.classId.value = Get.arguments['classId']??''; - state.className.value = Get.arguments['className']??''; - state.grade = Get.arguments['grade']??''; - EasyLoading.show(status: 'loading...'); - getClass(); - } - void getClass() async{ - List data = await getClient(). getAnnotatedClassList(state.homeworkId.value); - state.involveClasses.value = data; - - state.involveClasses.value = [state.classData.value, ...(data ?? [])]; - for (var element in state.involveClasses) { - if (element.className == state.className.value && element.grade == state.grade ) { - state.classData.value = element; - } - } - getWorkData(); - } - void getWorkData() async{ - HomeworkDetails data = await getClient(). getHomeworkDetails(state.homeworkId.value,state.classData.value.classId != '-1' ? state.classData.value.classId : ''); - state.dataCount = Utils.getHomeworkData(data); - state.homeData = data; - state.kgReport.value = data.questions.where((w)=>w.questionType == 1).toList(); - state.zgReport.value = data.questions.where((w)=>w.questionType == 2).toList(); - state.studentList.value = [...data.students]; - state.knowsList.value = data.knows; - state.hasData.value = true; - EasyLoading.dismiss(); - - state.studentList.sort((a, b) { - int num1 = a.kgtOkCount!+a.zgtOkCount!; - int num2 = b.kgtOkCount!+b.zgtOkCount!; - return num2.compareTo(num1); - }); - - } -} diff --git a/lib/page/home_page/children/job_report/widget/knowledge_point.dart b/lib/page/home_page/children/job_report/widget/knowledge_point.dart deleted file mode 100644 index a81c401..0000000 --- a/lib/page/home_page/children/job_report/widget/knowledge_point.dart +++ /dev/null @@ -1,299 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:percent_indicator/linear_percent_indicator.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; - -class KnowledgePoint extends StatefulWidget { - final RxList knowsList; - final HomeworkDetails data; - final String className; - final String homeworkId; - KnowledgePoint({Key? key,required this.knowsList,required this.data,required this.className,required this.homeworkId}) : super(key: key); - - @override - State createState() => _KnowledgePointState(); -} - -class _KnowledgePointState extends State { - - void goQuickCheckPersonalPath(studentId) { - if (studentId != null) { - Get.toNamed(Routes.studentPersonalPage,arguments: {'studentId':studentId,'homeworkId':widget.homeworkId}); - } - } - - void showPeopleListDialog( - {required BuildContext context, - required String title, - required List arr,}) { - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - // insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r), - backgroundColor:const Color(0xFFFFFFFF), - contentPadding: EdgeInsets.all(20.r), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(15.r))), - content: SizedBox( - width: MediaQuery.of(context).size.width * 0.7, - height: MediaQuery.of(context).size.height * 0.7, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Center( - child: Text( - title, - style: TextStyle( - fontSize: 15.sp, - color: const Color(0xFF3C3C3C), - fontWeight: FontWeight.w500), - ), - ), - SizedBox( - height: 10.r, - ), - Row( - children: [ - Expanded( - flex: 2, - child: Center( - child: Text( - '姓名', - style: TextStyle( - fontSize: 12.sp, - color: const Color(0xFF6A6A6A)), - ))), - SizedBox(width: 10.r,), - Expanded( - flex: 1, - child: Center( - child: Text( - '班级', - style: TextStyle( - fontSize: 12.sp, - color: const Color(0xFF6A6A6A)), - ))), - SizedBox(width: 10.r,), - Expanded( - flex: 2, - child: Center( - child: Text( - '掌握度', - style: TextStyle( - fontSize: 12.sp, - color: const Color(0xFF6A6A6A)), - ))), - SizedBox(width: 10.r,), - Expanded( - flex: 3, - child: Center( - child: Text( - '掌握情况', - style: TextStyle( - fontSize: 12.sp, - color: const Color(0xFF6A6A6A)), - ))), - ], - ), - SizedBox( - height: 5.r, - ), - - arr.isNotEmpty? Expanded( - child: ListView.builder( - shrinkWrap: true, - itemBuilder: (context, index) { - var item = arr[index]; - return Container( - padding: EdgeInsets.symmetric(vertical: 5.r), - color: const Color(0xFFF0F0F0), - margin:EdgeInsets.only(bottom: 2.r), - child: Row( - children: [ - Expanded( - flex: 2, - child: InkWell( - onTap: () { - goQuickCheckPersonalPath( - item.studentId); - }, - child: Center( - child: Text( - item.studentName!, - style: TextStyle( - fontSize: 12.sp, - color: const Color(0xFF323232)), - )))), - SizedBox(width: 10.r,), - Expanded( - flex: 1, - child: Center( - child: Text( - widget.className == ''?'全部': widget.className, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), - ))), - SizedBox(width: 10.r,), - Expanded( - flex: 2, - child: Center( - child: Text( - '${item.okRate!.toStringAsFixed(0)}%', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), - ))), - SizedBox(width: 10.r,), - Expanded( - flex: 3, - child: Padding( - padding: EdgeInsets.symmetric(vertical: 2.r, horizontal: 5.r), - child: SingleChildScrollView( - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.start, - spacing: 5, - runSpacing: 3, - children: List.generate(item.queDtls!.length, (index) { - Dtls kgInfo = item.queDtls![index]; - return Container( - width: 14.r, - height: 14.r, - decoration: BoxDecoration( - color: kgInfo.state == 0 - ? const Color(0xFFD3D3D3) - : kgInfo.state == 1?Colors.white:kgInfo.state == 2 - ? const Color(0xFFFF7474) - : const Color(0xFF4CC793), - borderRadius: BorderRadius.all(Radius.circular(7.r))), - child: Center( - child: Text( - kgInfo.questionNo.toString(), - style: TextStyle( - fontSize: 8.sp, - color: kgInfo.state == 1 - ? Color(0xFF525252) - : Colors.white), - )), - ); - })), - ), - ),), - ], - ), - ); - }, - itemCount: arr.length, - ), - ): const MyEmptyWidget() - ], - ), - ), - ); - }); - } - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(top: 10.h), - padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w), - constraints: BoxConstraints(maxHeight: 320.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)), - child: Column( - children: [ - Container( - margin: EdgeInsets.only(bottom: 24.h), - child: quickText('知识点掌握情况', color: const Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), - ), - Expanded( - child: ListView(children: widget.knowsList.value.map((item) { - return Container( - margin: EdgeInsets.only(bottom: 15.h, left: 15.r, right: 15.r), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Expanded( - flex: 10, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - quickText(item.knowledgeName, - size: 12.sp, color: const Color.fromRGBO(152, 152, 152, 1)), - quickText('${item.okRate!.toStringAsFixed(0)}%', - size: 12.sp, color: const Color.fromRGBO(64, 64, 64, 1)), - ], - ), - ), - SizedBox(width: 10.w), - const Expanded(flex: 1, child: SizedBox()), - ], - ), - SizedBox(height: 3.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 10, - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 10.h, - animationDuration: 2500, - percent: item.okRate! / 100, - progressColor: Theme.of(context).primaryColor, - backgroundColor: const Color.fromRGBO(219, 224, 243, 1), - barRadius: Radius.circular(10.r), - )), - SizedBox(width: 10.w), - InkWell( - onTap: () { - List ques = widget.data.questions.where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1).toList(); - List array2 = [...widget.data.students]; - for(var stu in array2){ - stu.queDtls = widget.data.dtls.where((w) => w.studentId == stu.studentId && ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1).toList(); - int okCount = stu.queDtls!.where((w) => w.state == 3).length; - int ttlCount = stu.queDtls!.length; - stu.okRate = Utils.calcRate(okCount, ttlCount); - stu.queDtls!.sort((a, b) { - int num1 = a.questionNo; - int num2 = b.questionNo; - return num1.compareTo(num2); - }); - } - - showPeopleListDialog( - context: context, - title: item.knowledgeName, - arr: array2,); - }, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - quickText('查看', size: 12.sp, color: const Color.fromRGBO(239, 135, 20, 1)), - Icon(Icons.arrow_forward_ios, size: 11.sp, color: const Color.fromRGBO(239, 135, 20, 1)), - ], - ), - ), - ], - ) - ], - ), - ); - }).toList()), - ), - ], - )); - } -} diff --git a/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart b/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart deleted file mode 100644 index 691f6b1..0000000 --- a/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart +++ /dev/null @@ -1,265 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/knowledge_points_grasp.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart'; -import 'package:school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart'; -import 'package:school_asignment_app/page/home_page/widget/progress_bar.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; -import 'package:syncfusion_flutter_datepicker/datepicker.dart'; - -import 'knowledge_points_grasp_logic.dart'; - -class KnowledgePointsGraspPage extends StatefulWidget { - const KnowledgePointsGraspPage({Key? key}) : super(key: key); - - @override - State createState() => - _KnowledgePointsGraspPageState(); -} - -class _KnowledgePointsGraspPageState extends State { - final logic = Get.find(); - final state = Get - .find() - .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: () => Navigator.of(context).pop(), - ), - 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),), - ), - ), - ) - ], - ), - ), - - - 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; - 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,), - ], - ), - ), - ], - ), - SizedBox(height: 10.r,), - ProgressBar( - title: '正确率:', - color: Color(0xFF90E0BE), - percent: item.correctRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - ], - ), - ), - ); - }) - : const MyEmptyWidget(), - ); - }), - ), - ), - ], - ), - ); - } - - @override - void dispose() { - Get.delete(); - super.dispose(); - } -} \ No newline at end of file diff --git a/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_state.dart b/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_state.dart deleted file mode 100644 index 4406b97..0000000 --- a/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_state.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/job/knowledge_report_detail.dart'; - -class KnowledgePointsGraspDetailState { - KnowledgePointsGraspDetailState() { - ///Initialize variables - } - - late String dateStart = ''; - late String dateEnd = ''; - late int knowledgeId = 0; - late RxList dataList=RxList(); - late RxList studentList=RxList(); - late RxString knowledgeName=''.obs; -} diff --git a/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart b/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart deleted file mode 100644 index f53d850..0000000 --- a/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart +++ /dev/null @@ -1,293 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:percent_indicator/percent_indicator.dart'; -import 'package:school_asignment_app/common/job/knowledge_report_detail.dart'; -import 'package:school_asignment_app/common/utils/toast_utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/page/global_widget/show_student_list.dart'; - -import 'knowledge_points_grasp_detail_logic.dart'; - -class KnowledgePointsGraspDetailPage extends StatefulWidget { - const KnowledgePointsGraspDetailPage({Key? key}) : super(key: key); - - @override - State createState() => - _KnowledgePointsGraspDetailPageState(); -} - -class _KnowledgePointsGraspDetailPageState - extends State { - final logic = Get.find(); - final state = Get - .find() - .state; - - @override - Widget build(BuildContext context) { - void showImg(imgUrl, context) { - if (imgUrl != null && imgUrl != '') { - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - insetPadding: - EdgeInsets.symmetric(vertical: 55.r, horizontal: 45.r), - contentPadding: EdgeInsets.all(0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(15.r))), - content: Container( - width: MediaQuery - .of(context) - .size - .width, - // height: MediaQuery.of(context).size.height, - child: Image.network(imgUrl), - ), - ); - }, - ); - } else { - ToastUtils.showError('暂无图片'); - } - - EasyLoading.dismiss(); - } - - void showStudent(homeworkId, templateId, questionNo, title) async { - logic.getStudents(homeworkId, templateId, questionNo); - - showDialog( - context: context, - builder: (BuildContext context) { - return Obx(() { - return ShowStudentList(title: title, - studentList: state.studentList.value, - homeworkId: homeworkId,); - }); - }, - ); - EasyLoading.dismiss(); - } - - 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: () => Navigator.of(context).pop(), - ), - 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, - 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, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h), - studentCall:showStudent(item.questionId,item.jobName), - ),*/ - ], - ), - ), - ); - }) - : const MyEmptyWidget(), - ); - }), - ), - ); - } - - @override - void dispose() { - Get.delete(); - super.dispose(); - } -} diff --git a/lib/page/home_page/children/quick_data_check/quick_data_check_logic.dart b/lib/page/home_page/children/quick_data_check/quick_data_check_logic.dart deleted file mode 100644 index e87d7bd..0000000 --- a/lib/page/home_page/children/quick_data_check/quick_data_check_logic.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; - -import 'quick_data_check_state.dart'; - -class QuickDataCheckLogic extends GetxController with RequestToolMixin{ - final QuickDataCheckState state = QuickDataCheckState(); - - @override - void onInit(){ - super.onInit(); - state.homeworkId.value = Get.arguments['homeworkId']??''; - state.classId.value = Get.arguments['classId']??''; - state.className.value = Get.arguments['className']??''; - state.grade = Get.arguments['grade']; - EasyLoading.show(status: 'loading...'); - getWorkData(); - } - - void getWorkData() async{ - HomeworkDetails data = await getClient(). getHomeworkDetails(state.homeworkId.value,state.classId.value); - state.dataCount = Utils.getHomeworkData(data); - state.homeData = data; - state.kgReport.value = data.questions.where((w)=>w.questionType == 1).toList(); - state.zgReport.value = data.questions.where((w)=>w.questionType == 2).toList(); - state.studentList.value = data.students; - state.hasData.value = true; - EasyLoading.dismiss(); - } - -} diff --git a/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart b/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart deleted file mode 100644 index e9df1f5..0000000 --- a/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart +++ /dev/null @@ -1,360 +0,0 @@ -import 'package:fl_chart/fl_chart.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:get_storage/get_storage.dart'; -import 'package:percent_indicator/percent_indicator.dart'; -import 'package:school_asignment_app/common/utils/enum_untils.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/widget/report_table.dart'; - -import 'quick_data_check_logic.dart'; - -class QuickDataCheckPage extends StatefulWidget { - const QuickDataCheckPage({Key? key}) : super(key: key); - - @override - State createState() => _QuickDataCheckPageState(); -} - -class _QuickDataCheckPageState extends State { - final logic = Get.find(); - final state = Get - .find() - .state; - - @override - Widget build(BuildContext context) { - return AnnotatedRegion( - value: const SystemUiOverlayStyle( - statusBarColor: Colors.transparent, - systemNavigationBarIconBrightness: Brightness.light, - statusBarIconBrightness: Brightness.light, - statusBarBrightness: Brightness.dark, - ), - child: Container( - padding: EdgeInsets.only(top: MediaQuery - .of(context) - .padding - .top), - height: MediaQuery - .of(context) - .size - .height, - decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color(0xFF6889FD), - Color(0xFFF5F5F5), - ], - stops: [ - 0.09, - 0.3 - ])), - child: - - Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - IconButton( - icon: const Icon(Icons.arrow_back_ios, color: Colors.white), - onPressed: () => Navigator.of(context).pop(), - ), - Expanded( - child: Padding( - padding: EdgeInsets.only(right: 8.r), - child: Center( - child: Text( - '数据快查', - style: TextStyle( - fontSize: 14.sp, color: Colors.white), - )), - )), - const ReturnToHomepage(bgColor: Colors.white,), - ], - ), - SizedBox(height: 10.r), - Obx(() { - if (state.hasData.value) { - return Expanded( - child: SingleChildScrollView( - child: Column( - children: [ - Padding( - padding: EdgeInsets.only(left: 14.r, top: 2.r), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/job_report_class_icon.png', - width: 22.r, - height: 22.r, - ), - SizedBox( - width: 6.r, - ), - Obx(() { - return Text( - '${EnumUtils.formatGrade( - state.grade)}${state.className.value}', - style: TextStyle( - fontSize: 14.r, color: Colors.white), - ); - }) - ], - ), - ), - Container( - padding: EdgeInsets.symmetric( - vertical: 15.r, horizontal: 15.r), - margin: EdgeInsets.symmetric( - vertical: 10.r, horizontal: 14.r), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.all(Radius.circular(6.r))), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 2.r, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: 12.r, - height: 12.r, - decoration: BoxDecoration( - color: const Color(0xFF4CC793), - borderRadius: BorderRadius.all( - Radius.circular(7.r))), - ), - SizedBox( - width: 6.r, - ), - Text( - '已提交', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF333333)), - ), - SizedBox( - width: 35.r, - ), - Container( - width: 12.r, - height: 12.r, - decoration: BoxDecoration( - color: const Color(0xFF6888FD), - borderRadius: BorderRadius.all( - Radius.circular(7.r))), - ), - SizedBox( - width: 6.r, - ), - Text( - '未提交', - style: TextStyle( - fontSize: 12.sp, - color: const Color(0xFF333333)), - ) - ], - ), - SizedBox( - height: 2.r, - ), - //环形图 - SizedBox( - height: MediaQuery - .of(context) - .size - .width * 0.3, - child: PieChart( - PieChartData( - borderData: FlBorderData(show: false), - sectionsSpace: 0, - centerSpaceRadius: - MediaQuery - .of(context) - .size - .width * 0.06, - sections: [ - PieChartSectionData( - color: const Color(0xFF4CC793), - value: state.dataCount - .studentSubmitCount! / - state.dataCount.studentCount! * - 100, - radius: - MediaQuery - .of(context) - .size - .width * - 0.07 + - 5, - title: '${state.dataCount - .studentSubmitCount}人', - titleStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white, - ), - ), - PieChartSectionData( - color: const Color(0xFF6888FD), - value: (state.dataCount - .studentCount! - state.dataCount - .studentSubmitCount!) / - state.dataCount.studentCount! * - 100, - radius: - MediaQuery - .of(context) - .size - .width * - 0.07, - title: '${state.dataCount - .studentCount! - state.dataCount - .studentSubmitCount!}人', - titleStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white, - ), - ), - ], - ), - ), - ), - // 客观进度条 - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '客观题答题进度', - style: TextStyle( - fontSize: 10.sp, - color: const Color(0xFF8B8B8B)), - ), - Text( - '${state.dataCount.kgtAnswerRate! - .toStringAsFixed(0)}%', - style: TextStyle( - fontSize: 10.sp, - color: const Color(0xFF333333)), - ), - ], - ), - SizedBox(height: 6.r), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 10, - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 9.h, - animationDuration: 2500, - percent: state.dataCount - .kgtAnswerRate! / 100, - progressColor: const Color( - 0xFFFF7F22), - backgroundColor: const Color( - 0xFFEAEAEA), - barRadius: Radius.circular(10.r), - )), - ], - ), - SizedBox(height: 20.r), - // 主观进度条 - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '主观题答题进度', - style: TextStyle( - fontSize: 10.sp, - color: const Color(0xFF8B8B8B)), - ), - Text( - '${state.dataCount.zgtAnswerRate! - .toStringAsFixed(0)}%', - style: TextStyle( - fontSize: 10.sp, - color: const Color(0xFF333333)), - ), - ], - ), - SizedBox(height: 6.r), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 10, - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 9.h, - animationDuration: 2500, - percent: state.dataCount - .zgtAnswerRate! / 100, - progressColor: const Color( - 0xFFFF7F22), - backgroundColor: const Color( - 0xFFEAEAEA), - barRadius: Radius.circular(10.r), - )), - ], - ), - ], - ), - ), - QuickDataCheckBottom(jobData: state.studentList.value, - jobId: state.homeworkId.value, - kgCount: state.dataCount.kgtDtlCount!, - zgCount: state.dataCount.zgtDtlCount!,), - //客观题、主观题 - 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)), - ], - ), - )); - } else { - return Padding( - padding: EdgeInsets.only( - top: MediaQuery - .of(context) - .size - .height / 2 - 200.r), - child: const MyEmptyWidget() - ); - } - }) - - - ], - ), - ), - ); - } - - @override - void dispose() { - Get.delete(); - super.dispose(); - } -} \ No newline at end of file diff --git a/lib/page/home_page/children/read_over/widget/task_list_item.dart b/lib/page/home_page/children/read_over/widget/task_list_item.dart deleted file mode 100644 index d463bd9..0000000 --- a/lib/page/home_page/children/read_over/widget/task_list_item.dart +++ /dev/null @@ -1,311 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:percent_indicator/percent_indicator.dart'; -import 'package:school_asignment_app/common/job/work_student.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/common/utils/enum_untils.dart'; -import 'package:school_asignment_app/common/utils/toast_utils.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/home_page/children/read_over/read_over_logic.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; - -class TaskListItem extends StatefulWidget { - final bool completed; - final Items jobTaskItem; - final int type; - final ReadOverLogic logic; - - const TaskListItem({Key? key,required this.completed,required this.jobTaskItem,required this.type,required this.logic}) : super(key: key); - - @override - State createState() => _TaskListItemState(); -} - -class _TaskListItemState extends State{ - - @override - Widget build(BuildContext context) { - return widget.completed - ? InkWell( - onTap: () { - Get.toNamed(Routes.annotateClassPage,arguments: {'id': widget.jobTaskItem.id,'name': widget.jobTaskItem.name,'grade': widget.jobTaskItem.grade,'completed':true}); - }, - child: Container( - width: double.infinity, - padding: EdgeInsets.only(top: 20.h), - margin: EdgeInsets.only(bottom: 12.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.r), - color: const Color.fromRGBO(255, 255, 255, 1), - boxShadow: const [ - BoxShadow( - color: Color.fromRGBO(210, 216, 241, 1), - offset: Offset.zero, //阴影y轴偏移量 - blurRadius: 5.8, //阴影模糊程度 - spreadRadius: 0, //阴影扩散程度 - ) - ], - ), - child: Column( - children: [ - // 顶部任务名称 - Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: Utils.isPad() ? 32.w : 36.w, - height: 18.h, - alignment: Alignment.center, - padding: EdgeInsets.only(left: Utils.isPad() ? 2.w : 3.w), - decoration: BoxDecoration( - color: const Color.fromRGBO(104, 136, 253, 1), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(14.r), - topRight: Radius.circular(3.r), - bottomLeft: Radius.circular(4.r), - bottomRight: Radius.circular(4.r), - ), - ), - margin: EdgeInsets.only(right: 4.w), - child: quickText('作业', color: Colors.white, size: 10.sp), - ), - Expanded( - child: quickText( - widget.jobTaskItem.name, - maxLines: 2, - size: 16.sp, - color: const Color.fromRGBO(70, 70, 70, 1), - fontWeight: FontWeight.bold, - ), - ) - ], - ), - ), - - SizedBox(height: 12.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - quickText(DateTime.parse(widget.jobTaskItem.publishTime).toString().substring(0,10), - color: const Color.fromRGBO(97, 97, 97, 1), - size: 12.sp, - fontWeight: FontWeight.w500, - ), - quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), size: 12.sp, fontWeight: FontWeight.w500), - quickText( - '参与班级:${widget.jobTaskItem.classCount}', - color: const Color.fromRGBO(76, 199, 147, 1), - size: 12.sp, - fontWeight: FontWeight.w600, - ), - quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 12.sp, fontWeight: FontWeight.w500), - quickText( - '科目:${EnumUtils.formatSubject(widget.jobTaskItem.subject)}' , - color: const Color.fromRGBO(116, 145, 253, 1), - size: 12.sp, - fontWeight: FontWeight.w600, - ), - const Expanded(child: SizedBox()), - /* FavoriteButton( - jobTaskItem.id, - jobTaskItem.title, - margin: EdgeInsets.zero, - isRow: false, - ),*/ - ], - ), - ), - - SizedBox(height: 20.h), - Container( - padding: EdgeInsets.symmetric(vertical: 10.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), - color: Colors.white, - boxShadow: const [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.15), - offset: Offset(0, -0.0001), //阴影y轴偏移量 - blurRadius: 4, //阴影模糊程度 - spreadRadius: 0, //阴影扩散程度 - ) - ], - ), - child: Row(children: [ - Expanded( - child: InkWell( - onTap: (){}, - child: Container( - alignment: Alignment.center, - child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 13.sp), - ), - )), - ]), - ), - ], - ), - ), - ) - : - InkWell( - onTap: () { - Get.toNamed(Routes.annotateClassPage,arguments: {'id':widget.jobTaskItem.id,'name':widget.jobTaskItem.name,'grade':widget.jobTaskItem.grade}); - }, - child: Stack( - alignment: const FractionalOffset(0.95, 0), - children: [ - Container( - margin: EdgeInsets.only(bottom: 16.h), - padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 10.w), - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.r), - color: const Color.fromRGBO(255, 255, 255, 1), - boxShadow: const [ - BoxShadow( - color: Color.fromRGBO(210, 216, 241, 1), - offset: Offset.zero, //阴影y轴偏移量 - blurRadius: 5.8, //阴影模糊程度 - spreadRadius: 0, //阴影扩散程度 - ) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 30.h), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: Utils.isPad() ? 32.w : 38.w, - height: 18.h, - alignment: Alignment.center, - padding: EdgeInsets.only(left: Utils.isPad() ? 2.w : 3.w), - decoration: BoxDecoration( - color: widget.type == 1 - ? const Color.fromRGBO(104, 136, 253, 1) - : const Color.fromRGBO(255, 175, 56, 1), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(14.r), - topRight: Radius.circular(3.r), - bottomLeft: Radius.circular(4.r), - bottomRight: Radius.circular(4.r), - ), - ), - margin: EdgeInsets.only(right: 4.w), - child: quickText(widget.type == 1?'作业':'考试', color: Colors.white, size: 10.sp), - ), - Expanded( - child: quickText( - widget.jobTaskItem.name, - maxLines: 2, - size: Utils.isPad() ? 14.sp : 16.sp, - color: const Color.fromRGBO(70, 70, 70, 1), - fontWeight: FontWeight.bold, - ), - ) - ], - ), - SizedBox(height: 10.h), - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - quickText( - EnumUtils.formatSubject(widget.jobTaskItem.subject), - color: const Color.fromRGBO(97, 97, 97, 1), - size: 12.sp, - ), - quickText(' / ', - color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500), - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - quickText('题量:', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp), - quickText( - '10', - color: const Color.fromRGBO(97, 97, 97, 1), - size: 13.sp, - ), - ], - ), - ), - quickText(' / ', - color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500), - quickText(DateTime.parse(widget.jobTaskItem.publishTime).toString().substring(0,10), - color: const Color.fromRGBO(97, 97, 97, 1), size: 12.sp), - ], - ), - SizedBox(height: 10.h), - InkWell( - onTap: (){ - if(!widget.jobTaskItem.isFixed!){ - EasyLoading.show(status:'loading...'); - widget.logic.getCollect(widget.jobTaskItem); - } - }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 4.r,horizontal: 20.r), - decoration: BoxDecoration( - color: widget.jobTaskItem.isFixed!?Color(0xFFF4F4F4):Color(0xFFF2FFFA), - border: Border.all(width: 1.r,color:widget.jobTaskItem.isFixed!?Colors.transparent:Color(0xFF4CC793)), - borderRadius: BorderRadius.all(Radius.circular(20.r)), - ), - child: Text(widget.jobTaskItem.isFixed!?'已订正':'收集订正',style: TextStyle(fontSize: 10.sp,color: const Color(0xFF4CC793)),), - ), - ), - // FavoriteButton(jobTaskItem.id, jobTaskItem.title), - ], - ), - ), - Container( - padding: EdgeInsets.all(9.r), - decoration: const BoxDecoration(shape: BoxShape.circle, color: Colors.white), - child: CircularPercentIndicator( - radius: 40.r, - lineWidth: 10.r, - animation: true, - percent: widget.jobTaskItem.annotateRate==null?0:widget.jobTaskItem.annotateRate! / 100, - center: Text.rich(TextSpan(children: [ - TextSpan( - text: Utils.getDoubleRemoveZero(widget.jobTaskItem.annotateRate, '0'), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16.sp, - color: Theme.of(context).primaryColor, - ), - ), - TextSpan( - text: "%", - style: TextStyle(color: const Color.fromRGBO(70, 70, 70, 1), fontSize: 12.sp, fontWeight: FontWeight.bold), - ), - ])), - circularStrokeCap: CircularStrokeCap.round, - // progressColor: Theme.of(context).primaryColor, - linearGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - tileMode: TileMode.clamp, - stops: const [0.0, 1.0], - colors: [ - Theme.of(context).primaryColor.withOpacity(0.1), - Theme.of(context).primaryColor, - ], - ), - backgroundColor: const Color.fromRGBO(244, 244, 244, 1), - ), - ), - ], - ), - ); - } -} diff --git a/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart b/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart deleted file mode 100644 index acd3ea5..0000000 --- a/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart +++ /dev/null @@ -1,598 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/student_history.dart'; -import 'package:school_asignment_app/common/utils/enum_untils.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart'; -import 'package:school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart'; -import 'package:school_asignment_app/page/home_page/widget/progress_bar.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; -import 'package:syncfusion_flutter_datepicker/datepicker.dart'; - -import 'student_work_detail_logic.dart'; - -class StudentWorkDetailPage extends StatefulWidget { - const StudentWorkDetailPage({Key? key}) : super(key: key); - - @override - State createState() => _StudentWorkDetailPageState(); -} - -class _StudentWorkDetailPageState extends State { - final logic = Get.find(); - final state = Get - .find() - .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: () => Navigator.of(context).pop(), - ), - 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)), - ); - })), - ), - ), - ], - ), - ), - 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.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)}'; - } - } - } - }); - }), - 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)), - ), - ), - 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轴偏移量 - blurRadius: 4, //阴影模糊程度 - 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, - ), - 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; - 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.end, - 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), - ), - ), - 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( - 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)), - ), - ], - ), - 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)), - ), - ], - ), - 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(), - ); - }), - ), - ), - ], - ), - ); - } - - @override - void dispose() { - Get.delete(); - super.dispose(); - } -} \ No newline at end of file diff --git a/lib/page/home_page/widget/student_group_list.dart b/lib/page/home_page/widget/student_group_list.dart deleted file mode 100644 index 04f8007..0000000 --- a/lib/page/home_page/widget/student_group_list.dart +++ /dev/null @@ -1,163 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/class_item.dart'; -import 'package:school_asignment_app/common/utils/enum_untils.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; - -class StudentGroupList extends StatelessWidget { - final List studentGroups; - final Function goNextPage; - final Widget? rightBtn; - - const StudentGroupList(this.studentGroups, this.goNextPage, - {Key? key,this.rightBtn}) - : super(key: key); - - @override - Widget build(BuildContext context) { - return Obx(() { - return studentGroups != null && studentGroups.isNotEmpty - ? Utils.isPad() - ? GridView( - shrinkWrap: true, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - mainAxisSpacing: 10.r, - crossAxisSpacing: 10.r, - childAspectRatio: 556 / 112, - ), - children: List.generate(studentGroups.length, (index) { - ClassItem item = studentGroups[index]; - return InkWell( - onTap: () { - goNextPage(item.classId,'${EnumUtils.formatGrade(item.grade)}${item.className}',item.subject); - }, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 10.r), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10.r)), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(right: 8.r), - child: Text( - '${EnumUtils.formatGrade(item.grade)}${item.className}', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFF6888FD)), - ), - ), - const Spacer(), - /*Expanded( - child: Text( - classNames, - style: TextStyle( - fontSize: 10.sp, - color: Color(0xFF999999), - overflow: TextOverflow.ellipsis, - ), - textAlign: TextAlign.end, - ), - ),*/ - rightBtn != null - ? rightBtn! - : Container( - margin: EdgeInsets.only(left: 5.r), - height: 20.r, - width: 55.r, - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(20.r)), - color: const Color(0xFF6888FD), - ), - child: Center( - child: Text( - '详情', - style: TextStyle( - fontSize: 10.sp, color: Colors.white), - ), - ), - ) - ], - ), - ), - ); - }), - ) - : ListView.builder( - shrinkWrap: true, - itemBuilder: (context, index) { - ClassItem item = studentGroups[index]; - return InkWell( - onTap: () { - goNextPage(item.classId,'${EnumUtils.formatGrade(item.grade)}${item.className}',item.subject); - }, - child: Container( - padding: - EdgeInsets.symmetric(vertical: 15.r, horizontal: 10.r), - margin: EdgeInsets.only(bottom: 10.r), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10.r)), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(right: 8.r), - child: Text( - '${EnumUtils.formatGrade(item.grade)}${item.className}', - style: TextStyle( - fontSize: 14.sp, color: Color(0xFF6888FD)), - ), - ), - const Spacer(), - /* Expanded( - child: Text( - classNames, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF999999), - overflow: TextOverflow.ellipsis, - ), - textAlign: TextAlign.end, - ), - ),*/ - rightBtn != null - ? rightBtn! - : Container( - margin: EdgeInsets.only(left: 5.r), - height: 24.r, - width: 55.r, - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(20.r)), - color: const Color(0xFF6888FD), - ), - child: Center( - child: Text( - '详情', - style: TextStyle( - fontSize: 10.sp, color: Colors.white), - ), - ), - ) - ], - ), - ), - ); - }, - itemCount: studentGroups.length, - ) - : Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height / 2 - 200.r), - child: const MyEmptyWidget(), - ); - }); - } -} diff --git a/lib/routes/app_pages.dart b/lib/routes/app_pages.dart deleted file mode 100644 index 8923402..0000000 --- a/lib/routes/app_pages.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:get/get.dart'; -import 'package:school_asignment_app/page/global_widget/other_page.dart'; -import 'package:school_asignment_app/page/global_widget/start_page.dart'; -import 'package:school_asignment_app/page/home_page/children/annotate_class/annotate_class_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/annotate_class/annotate_class_view.dart'; -import 'package:school_asignment_app/page/home_page/children/class_student/class_student_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/class_student/class_student_view.dart'; -import 'package:school_asignment_app/page/home_page/children/job_report/job_report_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/job_report/job_report_view.dart'; -import 'package:school_asignment_app/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart'; -import 'package:school_asignment_app/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart'; -import 'package:school_asignment_app/page/home_page/children/my_info.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_view.dart'; -import 'package:school_asignment_app/page/home_page/children/read_over/read_over_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/read_over/read_over_view.dart'; -import 'package:school_asignment_app/page/home_page/children/student_history_work/student_history_work_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/student_history_work/student_history_work_view.dart'; -import 'package:school_asignment_app/page/home_page/children/student_personal/student_personal_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/student_personal/student_personal_view.dart'; -import 'package:school_asignment_app/page/home_page/children/student_work_detail/student_work_detail_binding.dart'; -import 'package:school_asignment_app/page/home_page/children/student_work_detail/student_work_detail_view.dart'; -import 'package:school_asignment_app/page/home_page/home_binding.dart'; -import 'package:school_asignment_app/page/home_page/home_view.dart'; -import 'package:school_asignment_app/page/login_page/children/agreement_page.dart'; -import 'package:school_asignment_app/page/login_page/login_binding.dart'; -import 'package:school_asignment_app/page/login_page/login_view.dart'; -import 'package:school_asignment_app/page/work_page/work_binding.dart'; -import 'package:school_asignment_app/page/work_page/work_view.dart'; -part 'app_routes.dart'; - -abstract class AppPages { - static final pages = [ - GetPage(name: Routes.login, page: () => const LoginPage(), binding: LoginBinding(), transition: Transition.noTransition), - GetPage(name: Routes.agreementPage, page: () => const AgreementPage(), binding: LoginBinding(), transition: Transition.noTransition), - GetPage(name: Routes.home, page: () => const HomePage(), binding: HomeBinding(), transition: Transition.noTransition), - GetPage(name: Routes.startPage, page: () => const StartPage(), binding: StartPageIndexBinding(), transition: Transition.noTransition), - GetPage(name: Routes.myInfo, page: () => const MyInfo(), transition: Transition.noTransition), - GetPage(name: Routes.work, page: () => const WorkPage(), binding: WorkBinding(), transition: Transition.noTransition), - GetPage(name: Routes.otherPage, page: () => const OhterPage(), transition: Transition.noTransition), - GetPage(name: Routes.readOverPage, page: () => const ReadOverPage(), binding: ReadOverBinding(), transition: Transition.noTransition), - GetPage(name: Routes.studentHistoryWorkPage, page: () => const StudentHistoryWorkPage(), binding: StudentHistoryWorkBinding(), transition: Transition.noTransition), - GetPage(name: Routes.classStudentPage, page: () => const ClassStudentPage(), binding: ClassStudentBinding(), transition: Transition.noTransition), - GetPage(name: Routes.annotateClassPage, page: () => const AnnotateClassPage(), binding: AnnotateClassBinding(), transition: Transition.noTransition), - GetPage(name: Routes.quickDataCheckPage, page: () => const QuickDataCheckPage(), binding: QuickDataCheckBinding(), transition: Transition.noTransition), - GetPage(name: Routes.jobReportPage, page: () => const JobReportPage(), binding: JobReportBinding(), transition: Transition.noTransition), - GetPage(name: Routes.studentPersonalPage, page: () => const StudentPersonalPage(), binding: StudentPersonalBinding(), transition: Transition.noTransition), - GetPage(name: Routes.studentWorkDetailPage, page: () => const StudentWorkDetailPage(), binding: StudentWorkDetailBinding(), transition: Transition.noTransition), - GetPage(name: Routes.knowledgePointsGraspPage, page: () => const KnowledgePointsGraspPage(), binding: KnowledgePointsGraspBinding(), transition: Transition.noTransition), - GetPage(name: Routes.knowledgePointsGraspDetailPage, page: () => const KnowledgePointsGraspDetailPage(), binding: KnowledgePointsGraspDetailBinding(), transition: Transition.noTransition), - - ]; -} diff --git a/.gitignore b/making_school_asignment_app/.gitignore similarity index 55% rename from .gitignore rename to making_school_asignment_app/.gitignore index 6956094..29a3a50 100644 --- a/.gitignore +++ b/making_school_asignment_app/.gitignore @@ -16,9 +16,6 @@ migrate_working_dir/ *.iws .idea/ -# 编译文件不上传 -*.g.dart - # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. @@ -30,7 +27,6 @@ migrate_working_dir/ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies -.packages .pub-cache/ .pub/ /build/ @@ -45,18 +41,3 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release -/.fvm/flutter_sdk -lib/common/api/retrofit_client.g.dart -lib/common/job/user_info.g.dart -lib/common/job/user_info.g.dart -lib/common/job/user_login.g.dart -lib/common/job/common/upload_img_secret_key.g.dart -lib/common/job/common/base_structure_result.g.dart -lib/common/job/common/base_page.g.dart -lib/common/job/common/base_page_report.g.dart -lib/common/job/common/base_page_data.g.dart -lib/common/job/common/base_page_data_report.g.dart -/.fvm/flutter_sdk -.fvm/fvm_config.json -pubspec.lock -pubspec.lock diff --git a/making_school_asignment_app/.metadata b/making_school_asignment_app/.metadata new file mode 100644 index 0000000..cbf1dc0 --- /dev/null +++ b/making_school_asignment_app/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: android + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: ios + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: linux + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: macos + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: web + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: windows + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/README.md b/making_school_asignment_app/README.md similarity index 94% rename from README.md rename to making_school_asignment_app/README.md index 4e3f781..bbc93bd 100644 --- a/README.md +++ b/making_school_asignment_app/README.md @@ -1,4 +1,4 @@ -# school_asignment_app +# making_school_asignment_app A new Flutter project. diff --git a/analysis_options.yaml b/making_school_asignment_app/analysis_options.yaml similarity index 93% rename from analysis_options.yaml rename to making_school_asignment_app/analysis_options.yaml index 61b6c4d..0d29021 100644 --- a/analysis_options.yaml +++ b/making_school_asignment_app/analysis_options.yaml @@ -13,8 +13,7 @@ linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. + # and their documentation is published at https://dart.dev/lints. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code diff --git a/android/.gitignore b/making_school_asignment_app/android/.gitignore similarity index 100% rename from android/.gitignore rename to making_school_asignment_app/android/.gitignore diff --git a/making_school_asignment_app/android/app/build.gradle b/making_school_asignment_app/android/app/build.gradle new file mode 100644 index 0000000..abf5b83 --- /dev/null +++ b/making_school_asignment_app/android/app/build.gradle @@ -0,0 +1,87 @@ +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file("local.properties") +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader("UTF-8") { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty("flutter.versionCode") +if (flutterVersionCode == null) { + flutterVersionCode = "1" +} + +def flutterVersionName = localProperties.getProperty("flutter.versionName") +if (flutterVersionName == null) { + flutterVersionName = "1.0" +} + +def keystorePropertiesFile = rootProject.file("key.properties") +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + +android { + namespace = "com.yuanxuan.making_school_asignment_app" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } + debug { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.yuanxuan.making_school_asignment_app" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName + } + + buildTypes { + // release { + // // TODO: Add your own signing config for the release build. + // // Signing with the debug keys for now, so `flutter run --release` works. + // signingConfig = signingConfigs.debug + // } + release { + signingConfig signingConfigs.release + minifyEnabled false //删除无用代码 + shrinkResources false //删除无用资源 + } + debug { + signingConfig signingConfigs.debug + minifyEnabled false //删除无用代码 + shrinkResources false //删除无用资源 + } + } +} + +flutter { + source = "../.." +} diff --git a/android/app/src/debug/AndroidManifest.xml b/making_school_asignment_app/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from android/app/src/debug/AndroidManifest.xml rename to making_school_asignment_app/android/app/src/debug/AndroidManifest.xml diff --git a/android/app/src/main/AndroidManifest.xml b/making_school_asignment_app/android/app/src/main/AndroidManifest.xml similarity index 72% rename from android/app/src/main/AndroidManifest.xml rename to making_school_asignment_app/android/app/src/main/AndroidManifest.xml index a36daaf..afd2ebc 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/making_school_asignment_app/android/app/src/main/AndroidManifest.xml @@ -1,12 +1,13 @@ + + + + + + + diff --git a/making_school_asignment_app/android/app/src/main/kotlin/com/yuanxuan/making_school_asignment_app/MainActivity.kt b/making_school_asignment_app/android/app/src/main/kotlin/com/yuanxuan/making_school_asignment_app/MainActivity.kt new file mode 100644 index 0000000..84fff45 --- /dev/null +++ b/making_school_asignment_app/android/app/src/main/kotlin/com/yuanxuan/making_school_asignment_app/MainActivity.kt @@ -0,0 +1,5 @@ +package com.yuanxuan.making_school_asignment_app + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/making_school_asignment_app/android/app/src/main/res/drawable-v21/launch_background.xml similarity index 100% rename from android/app/src/main/res/drawable-v21/launch_background.xml rename to making_school_asignment_app/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/android/app/src/main/res/drawable/launch_background.xml b/making_school_asignment_app/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from android/app/src/main/res/drawable/launch_background.xml rename to making_school_asignment_app/android/app/src/main/res/drawable/launch_background.xml diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/making_school_asignment_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to making_school_asignment_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/making_school_asignment_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to making_school_asignment_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/making_school_asignment_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to making_school_asignment_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/making_school_asignment_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to making_school_asignment_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/making_school_asignment_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to making_school_asignment_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/android/app/src/main/res/values-night/styles.xml b/making_school_asignment_app/android/app/src/main/res/values-night/styles.xml similarity index 100% rename from android/app/src/main/res/values-night/styles.xml rename to making_school_asignment_app/android/app/src/main/res/values-night/styles.xml diff --git a/android/app/src/main/res/values/styles.xml b/making_school_asignment_app/android/app/src/main/res/values/styles.xml similarity index 100% rename from android/app/src/main/res/values/styles.xml rename to making_school_asignment_app/android/app/src/main/res/values/styles.xml diff --git a/android/app/src/profile/AndroidManifest.xml b/making_school_asignment_app/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from android/app/src/profile/AndroidManifest.xml rename to making_school_asignment_app/android/app/src/profile/AndroidManifest.xml diff --git a/making_school_asignment_app/android/build.gradle b/making_school_asignment_app/android/build.gradle new file mode 100644 index 0000000..d2ffbff --- /dev/null +++ b/making_school_asignment_app/android/build.gradle @@ -0,0 +1,18 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = "../build" +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/making_school_asignment_app/android/gradle.properties b/making_school_asignment_app/android/gradle.properties new file mode 100644 index 0000000..3b5b324 --- /dev/null +++ b/making_school_asignment_app/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/making_school_asignment_app/android/gradle/wrapper/gradle-wrapper.properties similarity index 92% rename from android/gradle/wrapper/gradle-wrapper.properties rename to making_school_asignment_app/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..e1ca574 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/making_school_asignment_app/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/making_school_asignment_app/android/settings.gradle b/making_school_asignment_app/android/settings.gradle new file mode 100644 index 0000000..536165d --- /dev/null +++ b/making_school_asignment_app/android/settings.gradle @@ -0,0 +1,25 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false +} + +include ":app" diff --git a/assets/icons/demo.css b/making_school_asignment_app/assets/icons/demo.css similarity index 100% rename from assets/icons/demo.css rename to making_school_asignment_app/assets/icons/demo.css diff --git a/assets/icons/demo_index.html b/making_school_asignment_app/assets/icons/demo_index.html similarity index 100% rename from assets/icons/demo_index.html rename to making_school_asignment_app/assets/icons/demo_index.html diff --git a/assets/icons/iconfont.css b/making_school_asignment_app/assets/icons/iconfont.css similarity index 100% rename from assets/icons/iconfont.css rename to making_school_asignment_app/assets/icons/iconfont.css diff --git a/assets/icons/iconfont.js b/making_school_asignment_app/assets/icons/iconfont.js similarity index 100% rename from assets/icons/iconfont.js rename to making_school_asignment_app/assets/icons/iconfont.js diff --git a/assets/icons/iconfont.json b/making_school_asignment_app/assets/icons/iconfont.json similarity index 100% rename from assets/icons/iconfont.json rename to making_school_asignment_app/assets/icons/iconfont.json diff --git a/assets/icons/iconfont.ttf b/making_school_asignment_app/assets/icons/iconfont.ttf similarity index 100% rename from assets/icons/iconfont.ttf rename to making_school_asignment_app/assets/icons/iconfont.ttf diff --git a/assets/icons/iconfont.woff b/making_school_asignment_app/assets/icons/iconfont.woff similarity index 100% rename from assets/icons/iconfont.woff rename to making_school_asignment_app/assets/icons/iconfont.woff diff --git a/assets/icons/iconfont.woff2 b/making_school_asignment_app/assets/icons/iconfont.woff2 similarity index 100% rename from assets/icons/iconfont.woff2 rename to making_school_asignment_app/assets/icons/iconfont.woff2 diff --git a/assets/images/1.png b/making_school_asignment_app/assets/images/1.png similarity index 100% rename from assets/images/1.png rename to making_school_asignment_app/assets/images/1.png diff --git a/assets/images/2.0x/2 (2).png b/making_school_asignment_app/assets/images/2.0x/2 (2).png similarity index 100% rename from assets/images/2.0x/2 (2).png rename to making_school_asignment_app/assets/images/2.0x/2 (2).png diff --git a/assets/images/2.0x/abnormal_img.png b/making_school_asignment_app/assets/images/2.0x/abnormal_img.png similarity index 100% rename from assets/images/2.0x/abnormal_img.png rename to making_school_asignment_app/assets/images/2.0x/abnormal_img.png diff --git a/assets/images/2.0x/default_user_dead.png b/making_school_asignment_app/assets/images/2.0x/default_user_dead.png similarity index 100% rename from assets/images/2.0x/default_user_dead.png rename to making_school_asignment_app/assets/images/2.0x/default_user_dead.png diff --git a/assets/images/2.0x/detailed_report_entry_bgm.png b/making_school_asignment_app/assets/images/2.0x/detailed_report_entry_bgm.png similarity index 100% rename from assets/images/2.0x/detailed_report_entry_bgm.png rename to making_school_asignment_app/assets/images/2.0x/detailed_report_entry_bgm.png diff --git a/assets/images/2.0x/do_exit_marking.png b/making_school_asignment_app/assets/images/2.0x/do_exit_marking.png similarity index 100% rename from assets/images/2.0x/do_exit_marking.png rename to making_school_asignment_app/assets/images/2.0x/do_exit_marking.png diff --git a/assets/images/2.0x/do_marking_answer.png b/making_school_asignment_app/assets/images/2.0x/do_marking_answer.png similarity index 100% rename from assets/images/2.0x/do_marking_answer.png rename to making_school_asignment_app/assets/images/2.0x/do_marking_answer.png diff --git a/assets/images/2.0x/do_marking_test_paper.png b/making_school_asignment_app/assets/images/2.0x/do_marking_test_paper.png similarity index 100% rename from assets/images/2.0x/do_marking_test_paper.png rename to making_school_asignment_app/assets/images/2.0x/do_marking_test_paper.png diff --git a/assets/images/2.0x/equal.png b/making_school_asignment_app/assets/images/2.0x/equal.png similarity index 100% rename from assets/images/2.0x/equal.png rename to making_school_asignment_app/assets/images/2.0x/equal.png diff --git a/assets/images/2.0x/exam_selection.png b/making_school_asignment_app/assets/images/2.0x/exam_selection.png similarity index 100% rename from assets/images/2.0x/exam_selection.png rename to making_school_asignment_app/assets/images/2.0x/exam_selection.png diff --git a/assets/images/2.0x/fall.png b/making_school_asignment_app/assets/images/2.0x/fall.png similarity index 100% rename from assets/images/2.0x/fall.png rename to making_school_asignment_app/assets/images/2.0x/fall.png diff --git a/assets/images/2.0x/guide_page_gesture.png b/making_school_asignment_app/assets/images/2.0x/guide_page_gesture.png similarity index 100% rename from assets/images/2.0x/guide_page_gesture.png rename to making_school_asignment_app/assets/images/2.0x/guide_page_gesture.png diff --git a/assets/images/2.0x/hide_question_id.png b/making_school_asignment_app/assets/images/2.0x/hide_question_id.png similarity index 100% rename from assets/images/2.0x/hide_question_id.png rename to making_school_asignment_app/assets/images/2.0x/hide_question_id.png diff --git a/assets/images/2.0x/home_image.png b/making_school_asignment_app/assets/images/2.0x/home_image.png similarity index 100% rename from assets/images/2.0x/home_image.png rename to making_school_asignment_app/assets/images/2.0x/home_image.png diff --git a/assets/images/2.0x/ic_home_normal.png b/making_school_asignment_app/assets/images/2.0x/ic_home_normal.png similarity index 100% rename from assets/images/2.0x/ic_home_normal.png rename to making_school_asignment_app/assets/images/2.0x/ic_home_normal.png diff --git a/assets/images/2.0x/ic_home_press.png b/making_school_asignment_app/assets/images/2.0x/ic_home_press.png similarity index 100% rename from assets/images/2.0x/ic_home_press.png rename to making_school_asignment_app/assets/images/2.0x/ic_home_press.png diff --git a/assets/images/2.0x/ic_marking_normal.png b/making_school_asignment_app/assets/images/2.0x/ic_marking_normal.png similarity index 100% rename from assets/images/2.0x/ic_marking_normal.png rename to making_school_asignment_app/assets/images/2.0x/ic_marking_normal.png diff --git a/assets/images/2.0x/ic_marking_press.png b/making_school_asignment_app/assets/images/2.0x/ic_marking_press.png similarity index 100% rename from assets/images/2.0x/ic_marking_press.png rename to making_school_asignment_app/assets/images/2.0x/ic_marking_press.png diff --git a/assets/images/2.0x/ic_mine_normal.png b/making_school_asignment_app/assets/images/2.0x/ic_mine_normal.png similarity index 100% rename from assets/images/2.0x/ic_mine_normal.png rename to making_school_asignment_app/assets/images/2.0x/ic_mine_normal.png diff --git a/assets/images/2.0x/ic_mine_press.png b/making_school_asignment_app/assets/images/2.0x/ic_mine_press.png similarity index 100% rename from assets/images/2.0x/ic_mine_press.png rename to making_school_asignment_app/assets/images/2.0x/ic_mine_press.png diff --git a/assets/images/2.0x/ic_report_normal.png b/making_school_asignment_app/assets/images/2.0x/ic_report_normal.png similarity index 100% rename from assets/images/2.0x/ic_report_normal.png rename to making_school_asignment_app/assets/images/2.0x/ic_report_normal.png diff --git a/assets/images/2.0x/ic_report_press.png b/making_school_asignment_app/assets/images/2.0x/ic_report_press.png similarity index 100% rename from assets/images/2.0x/ic_report_press.png rename to making_school_asignment_app/assets/images/2.0x/ic_report_press.png diff --git a/assets/images/2.0x/ic_work_normal.png b/making_school_asignment_app/assets/images/2.0x/ic_work_normal.png similarity index 100% rename from assets/images/2.0x/ic_work_normal.png rename to making_school_asignment_app/assets/images/2.0x/ic_work_normal.png diff --git a/assets/images/2.0x/ic_work_press.png b/making_school_asignment_app/assets/images/2.0x/ic_work_press.png similarity index 100% rename from assets/images/2.0x/ic_work_press.png rename to making_school_asignment_app/assets/images/2.0x/ic_work_press.png diff --git a/assets/images/2.0x/job_report_scale.png b/making_school_asignment_app/assets/images/2.0x/job_report_scale.png similarity index 100% rename from assets/images/2.0x/job_report_scale.png rename to making_school_asignment_app/assets/images/2.0x/job_report_scale.png diff --git a/assets/images/2.0x/login_bgi.png b/making_school_asignment_app/assets/images/2.0x/login_bgi.png similarity index 100% rename from assets/images/2.0x/login_bgi.png rename to making_school_asignment_app/assets/images/2.0x/login_bgi.png diff --git a/assets/images/2.0x/logo.png b/making_school_asignment_app/assets/images/2.0x/logo.png similarity index 100% rename from assets/images/2.0x/logo.png rename to making_school_asignment_app/assets/images/2.0x/logo.png diff --git a/assets/images/2.0x/marking_settings.png b/making_school_asignment_app/assets/images/2.0x/marking_settings.png similarity index 100% rename from assets/images/2.0x/marking_settings.png rename to making_school_asignment_app/assets/images/2.0x/marking_settings.png diff --git a/assets/images/2.0x/not_data_bgm.png b/making_school_asignment_app/assets/images/2.0x/not_data_bgm.png similarity index 100% rename from assets/images/2.0x/not_data_bgm.png rename to making_school_asignment_app/assets/images/2.0x/not_data_bgm.png diff --git a/assets/images/2.0x/personal_bgi.png b/making_school_asignment_app/assets/images/2.0x/personal_bgi.png similarity index 100% rename from assets/images/2.0x/personal_bgi.png rename to making_school_asignment_app/assets/images/2.0x/personal_bgi.png diff --git a/assets/images/2.0x/report_home_icon_burst.png b/making_school_asignment_app/assets/images/2.0x/report_home_icon_burst.png similarity index 100% rename from assets/images/2.0x/report_home_icon_burst.png rename to making_school_asignment_app/assets/images/2.0x/report_home_icon_burst.png diff --git a/assets/images/2.0x/report_home_icon_subject.png b/making_school_asignment_app/assets/images/2.0x/report_home_icon_subject.png similarity index 100% rename from assets/images/2.0x/report_home_icon_subject.png rename to making_school_asignment_app/assets/images/2.0x/report_home_icon_subject.png diff --git a/assets/images/2.0x/report_home_top_img.png b/making_school_asignment_app/assets/images/2.0x/report_home_top_img.png similarity index 100% rename from assets/images/2.0x/report_home_top_img.png rename to making_school_asignment_app/assets/images/2.0x/report_home_top_img.png diff --git a/assets/images/2.0x/report_level_bgm.png b/making_school_asignment_app/assets/images/2.0x/report_level_bgm.png similarity index 100% rename from assets/images/2.0x/report_level_bgm.png rename to making_school_asignment_app/assets/images/2.0x/report_level_bgm.png diff --git a/assets/images/2.0x/review_error.png b/making_school_asignment_app/assets/images/2.0x/review_error.png similarity index 100% rename from assets/images/2.0x/review_error.png rename to making_school_asignment_app/assets/images/2.0x/review_error.png diff --git a/assets/images/2.0x/review_loding.png b/making_school_asignment_app/assets/images/2.0x/review_loding.png similarity index 100% rename from assets/images/2.0x/review_loding.png rename to making_school_asignment_app/assets/images/2.0x/review_loding.png diff --git a/assets/images/2.0x/rise.png b/making_school_asignment_app/assets/images/2.0x/rise.png similarity index 100% rename from assets/images/2.0x/rise.png rename to making_school_asignment_app/assets/images/2.0x/rise.png diff --git a/assets/images/2.0x/role_selection.png b/making_school_asignment_app/assets/images/2.0x/role_selection.png similarity index 100% rename from assets/images/2.0x/role_selection.png rename to making_school_asignment_app/assets/images/2.0x/role_selection.png diff --git a/assets/images/2.0x/test_paper_loading_failed.png b/making_school_asignment_app/assets/images/2.0x/test_paper_loading_failed.png similarity index 100% rename from assets/images/2.0x/test_paper_loading_failed.png rename to making_school_asignment_app/assets/images/2.0x/test_paper_loading_failed.png diff --git a/assets/images/2.0x/upgrade_dialog_bgc.png b/making_school_asignment_app/assets/images/2.0x/upgrade_dialog_bgc.png similarity index 100% rename from assets/images/2.0x/upgrade_dialog_bgc.png rename to making_school_asignment_app/assets/images/2.0x/upgrade_dialog_bgc.png diff --git a/assets/images/2.0x/vertical_screen_btn.png b/making_school_asignment_app/assets/images/2.0x/vertical_screen_btn.png similarity index 100% rename from assets/images/2.0x/vertical_screen_btn.png rename to making_school_asignment_app/assets/images/2.0x/vertical_screen_btn.png diff --git a/assets/images/3.0x/30 (1).png b/making_school_asignment_app/assets/images/3.0x/30 (1).png similarity index 100% rename from assets/images/3.0x/30 (1).png rename to making_school_asignment_app/assets/images/3.0x/30 (1).png diff --git a/assets/images/3.0x/abnormal_img.png b/making_school_asignment_app/assets/images/3.0x/abnormal_img.png similarity index 100% rename from assets/images/3.0x/abnormal_img.png rename to making_school_asignment_app/assets/images/3.0x/abnormal_img.png diff --git a/assets/images/3.0x/default_user_dead.png b/making_school_asignment_app/assets/images/3.0x/default_user_dead.png similarity index 100% rename from assets/images/3.0x/default_user_dead.png rename to making_school_asignment_app/assets/images/3.0x/default_user_dead.png diff --git a/assets/images/3.0x/detailed_report_entry_bgm.png b/making_school_asignment_app/assets/images/3.0x/detailed_report_entry_bgm.png similarity index 100% rename from assets/images/3.0x/detailed_report_entry_bgm.png rename to making_school_asignment_app/assets/images/3.0x/detailed_report_entry_bgm.png diff --git a/assets/images/3.0x/do_exit_marking.png b/making_school_asignment_app/assets/images/3.0x/do_exit_marking.png similarity index 100% rename from assets/images/3.0x/do_exit_marking.png rename to making_school_asignment_app/assets/images/3.0x/do_exit_marking.png diff --git a/assets/images/3.0x/do_marking_answer.png b/making_school_asignment_app/assets/images/3.0x/do_marking_answer.png similarity index 100% rename from assets/images/3.0x/do_marking_answer.png rename to making_school_asignment_app/assets/images/3.0x/do_marking_answer.png diff --git a/assets/images/3.0x/do_marking_test_paper.png b/making_school_asignment_app/assets/images/3.0x/do_marking_test_paper.png similarity index 100% rename from assets/images/3.0x/do_marking_test_paper.png rename to making_school_asignment_app/assets/images/3.0x/do_marking_test_paper.png diff --git a/assets/images/3.0x/equal.png b/making_school_asignment_app/assets/images/3.0x/equal.png similarity index 100% rename from assets/images/3.0x/equal.png rename to making_school_asignment_app/assets/images/3.0x/equal.png diff --git a/assets/images/3.0x/exam_selection.png b/making_school_asignment_app/assets/images/3.0x/exam_selection.png similarity index 100% rename from assets/images/3.0x/exam_selection.png rename to making_school_asignment_app/assets/images/3.0x/exam_selection.png diff --git a/assets/images/3.0x/fall.png b/making_school_asignment_app/assets/images/3.0x/fall.png similarity index 100% rename from assets/images/3.0x/fall.png rename to making_school_asignment_app/assets/images/3.0x/fall.png diff --git a/assets/images/3.0x/guide_page_gesture.png b/making_school_asignment_app/assets/images/3.0x/guide_page_gesture.png similarity index 100% rename from assets/images/3.0x/guide_page_gesture.png rename to making_school_asignment_app/assets/images/3.0x/guide_page_gesture.png diff --git a/assets/images/3.0x/hide_question_id.png b/making_school_asignment_app/assets/images/3.0x/hide_question_id.png similarity index 100% rename from assets/images/3.0x/hide_question_id.png rename to making_school_asignment_app/assets/images/3.0x/hide_question_id.png diff --git a/assets/images/3.0x/home_image.png b/making_school_asignment_app/assets/images/3.0x/home_image.png similarity index 100% rename from assets/images/3.0x/home_image.png rename to making_school_asignment_app/assets/images/3.0x/home_image.png diff --git a/assets/images/3.0x/ic_home_normal.png b/making_school_asignment_app/assets/images/3.0x/ic_home_normal.png similarity index 100% rename from assets/images/3.0x/ic_home_normal.png rename to making_school_asignment_app/assets/images/3.0x/ic_home_normal.png diff --git a/assets/images/3.0x/ic_home_press.png b/making_school_asignment_app/assets/images/3.0x/ic_home_press.png similarity index 100% rename from assets/images/3.0x/ic_home_press.png rename to making_school_asignment_app/assets/images/3.0x/ic_home_press.png diff --git a/assets/images/3.0x/ic_marking_normal.png b/making_school_asignment_app/assets/images/3.0x/ic_marking_normal.png similarity index 100% rename from assets/images/3.0x/ic_marking_normal.png rename to making_school_asignment_app/assets/images/3.0x/ic_marking_normal.png diff --git a/assets/images/3.0x/ic_marking_press.png b/making_school_asignment_app/assets/images/3.0x/ic_marking_press.png similarity index 100% rename from assets/images/3.0x/ic_marking_press.png rename to making_school_asignment_app/assets/images/3.0x/ic_marking_press.png diff --git a/assets/images/3.0x/ic_mine_normal.png b/making_school_asignment_app/assets/images/3.0x/ic_mine_normal.png similarity index 100% rename from assets/images/3.0x/ic_mine_normal.png rename to making_school_asignment_app/assets/images/3.0x/ic_mine_normal.png diff --git a/assets/images/3.0x/ic_mine_press.png b/making_school_asignment_app/assets/images/3.0x/ic_mine_press.png similarity index 100% rename from assets/images/3.0x/ic_mine_press.png rename to making_school_asignment_app/assets/images/3.0x/ic_mine_press.png diff --git a/assets/images/3.0x/ic_report_normal.png b/making_school_asignment_app/assets/images/3.0x/ic_report_normal.png similarity index 100% rename from assets/images/3.0x/ic_report_normal.png rename to making_school_asignment_app/assets/images/3.0x/ic_report_normal.png diff --git a/assets/images/3.0x/ic_report_press.png b/making_school_asignment_app/assets/images/3.0x/ic_report_press.png similarity index 100% rename from assets/images/3.0x/ic_report_press.png rename to making_school_asignment_app/assets/images/3.0x/ic_report_press.png diff --git a/assets/images/3.0x/ic_work_normal.png b/making_school_asignment_app/assets/images/3.0x/ic_work_normal.png similarity index 100% rename from assets/images/3.0x/ic_work_normal.png rename to making_school_asignment_app/assets/images/3.0x/ic_work_normal.png diff --git a/assets/images/3.0x/ic_work_press.png b/making_school_asignment_app/assets/images/3.0x/ic_work_press.png similarity index 100% rename from assets/images/3.0x/ic_work_press.png rename to making_school_asignment_app/assets/images/3.0x/ic_work_press.png diff --git a/assets/images/3.0x/job_report_scale.png b/making_school_asignment_app/assets/images/3.0x/job_report_scale.png similarity index 100% rename from assets/images/3.0x/job_report_scale.png rename to making_school_asignment_app/assets/images/3.0x/job_report_scale.png diff --git a/assets/images/3.0x/login_bgi.png b/making_school_asignment_app/assets/images/3.0x/login_bgi.png similarity index 100% rename from assets/images/3.0x/login_bgi.png rename to making_school_asignment_app/assets/images/3.0x/login_bgi.png diff --git a/assets/images/3.0x/logo.png b/making_school_asignment_app/assets/images/3.0x/logo.png similarity index 100% rename from assets/images/3.0x/logo.png rename to making_school_asignment_app/assets/images/3.0x/logo.png diff --git a/assets/images/3.0x/marking_settings.png b/making_school_asignment_app/assets/images/3.0x/marking_settings.png similarity index 100% rename from assets/images/3.0x/marking_settings.png rename to making_school_asignment_app/assets/images/3.0x/marking_settings.png diff --git a/assets/images/3.0x/not_data_bgm.png b/making_school_asignment_app/assets/images/3.0x/not_data_bgm.png similarity index 100% rename from assets/images/3.0x/not_data_bgm.png rename to making_school_asignment_app/assets/images/3.0x/not_data_bgm.png diff --git a/assets/images/3.0x/personal_bgi.png b/making_school_asignment_app/assets/images/3.0x/personal_bgi.png similarity index 100% rename from assets/images/3.0x/personal_bgi.png rename to making_school_asignment_app/assets/images/3.0x/personal_bgi.png diff --git a/assets/images/3.0x/report_home_icon_burst.png b/making_school_asignment_app/assets/images/3.0x/report_home_icon_burst.png similarity index 100% rename from assets/images/3.0x/report_home_icon_burst.png rename to making_school_asignment_app/assets/images/3.0x/report_home_icon_burst.png diff --git a/assets/images/3.0x/report_home_icon_subject.png b/making_school_asignment_app/assets/images/3.0x/report_home_icon_subject.png similarity index 100% rename from assets/images/3.0x/report_home_icon_subject.png rename to making_school_asignment_app/assets/images/3.0x/report_home_icon_subject.png diff --git a/assets/images/3.0x/report_home_top_img.png b/making_school_asignment_app/assets/images/3.0x/report_home_top_img.png similarity index 100% rename from assets/images/3.0x/report_home_top_img.png rename to making_school_asignment_app/assets/images/3.0x/report_home_top_img.png diff --git a/assets/images/3.0x/report_level_bgm.png b/making_school_asignment_app/assets/images/3.0x/report_level_bgm.png similarity index 100% rename from assets/images/3.0x/report_level_bgm.png rename to making_school_asignment_app/assets/images/3.0x/report_level_bgm.png diff --git a/assets/images/3.0x/review_error.png b/making_school_asignment_app/assets/images/3.0x/review_error.png similarity index 100% rename from assets/images/3.0x/review_error.png rename to making_school_asignment_app/assets/images/3.0x/review_error.png diff --git a/assets/images/3.0x/review_loding.png b/making_school_asignment_app/assets/images/3.0x/review_loding.png similarity index 100% rename from assets/images/3.0x/review_loding.png rename to making_school_asignment_app/assets/images/3.0x/review_loding.png diff --git a/assets/images/3.0x/rise.png b/making_school_asignment_app/assets/images/3.0x/rise.png similarity index 100% rename from assets/images/3.0x/rise.png rename to making_school_asignment_app/assets/images/3.0x/rise.png diff --git a/assets/images/3.0x/role_selection.png b/making_school_asignment_app/assets/images/3.0x/role_selection.png similarity index 100% rename from assets/images/3.0x/role_selection.png rename to making_school_asignment_app/assets/images/3.0x/role_selection.png diff --git a/assets/images/3.0x/test_paper_loading_failed.png b/making_school_asignment_app/assets/images/3.0x/test_paper_loading_failed.png similarity index 100% rename from assets/images/3.0x/test_paper_loading_failed.png rename to making_school_asignment_app/assets/images/3.0x/test_paper_loading_failed.png diff --git a/assets/images/3.0x/upgrade_dialog_bgc.png b/making_school_asignment_app/assets/images/3.0x/upgrade_dialog_bgc.png similarity index 100% rename from assets/images/3.0x/upgrade_dialog_bgc.png rename to making_school_asignment_app/assets/images/3.0x/upgrade_dialog_bgc.png diff --git a/assets/images/3.0x/vertical_screen_btn.png b/making_school_asignment_app/assets/images/3.0x/vertical_screen_btn.png similarity index 100% rename from assets/images/3.0x/vertical_screen_btn.png rename to making_school_asignment_app/assets/images/3.0x/vertical_screen_btn.png diff --git a/assets/images/4.0x/4 (2).png b/making_school_asignment_app/assets/images/4.0x/4 (2).png similarity index 100% rename from assets/images/4.0x/4 (2).png rename to making_school_asignment_app/assets/images/4.0x/4 (2).png diff --git a/assets/images/4.0x/abnormal_img.png b/making_school_asignment_app/assets/images/4.0x/abnormal_img.png similarity index 100% rename from assets/images/4.0x/abnormal_img.png rename to making_school_asignment_app/assets/images/4.0x/abnormal_img.png diff --git a/assets/images/4.0x/default_user_dead.png b/making_school_asignment_app/assets/images/4.0x/default_user_dead.png similarity index 100% rename from assets/images/4.0x/default_user_dead.png rename to making_school_asignment_app/assets/images/4.0x/default_user_dead.png diff --git a/assets/images/4.0x/detailed_report_entry_bgm.png b/making_school_asignment_app/assets/images/4.0x/detailed_report_entry_bgm.png similarity index 100% rename from assets/images/4.0x/detailed_report_entry_bgm.png rename to making_school_asignment_app/assets/images/4.0x/detailed_report_entry_bgm.png diff --git a/assets/images/4.0x/do_exit_marking.png b/making_school_asignment_app/assets/images/4.0x/do_exit_marking.png similarity index 100% rename from assets/images/4.0x/do_exit_marking.png rename to making_school_asignment_app/assets/images/4.0x/do_exit_marking.png diff --git a/assets/images/4.0x/do_marking_answer.png b/making_school_asignment_app/assets/images/4.0x/do_marking_answer.png similarity index 100% rename from assets/images/4.0x/do_marking_answer.png rename to making_school_asignment_app/assets/images/4.0x/do_marking_answer.png diff --git a/assets/images/4.0x/do_marking_test_paper.png b/making_school_asignment_app/assets/images/4.0x/do_marking_test_paper.png similarity index 100% rename from assets/images/4.0x/do_marking_test_paper.png rename to making_school_asignment_app/assets/images/4.0x/do_marking_test_paper.png diff --git a/assets/images/4.0x/equal.png b/making_school_asignment_app/assets/images/4.0x/equal.png similarity index 100% rename from assets/images/4.0x/equal.png rename to making_school_asignment_app/assets/images/4.0x/equal.png diff --git a/assets/images/4.0x/exam_selection.png b/making_school_asignment_app/assets/images/4.0x/exam_selection.png similarity index 100% rename from assets/images/4.0x/exam_selection.png rename to making_school_asignment_app/assets/images/4.0x/exam_selection.png diff --git a/assets/images/4.0x/fall.png b/making_school_asignment_app/assets/images/4.0x/fall.png similarity index 100% rename from assets/images/4.0x/fall.png rename to making_school_asignment_app/assets/images/4.0x/fall.png diff --git a/assets/images/4.0x/guide_page_gesture.png b/making_school_asignment_app/assets/images/4.0x/guide_page_gesture.png similarity index 100% rename from assets/images/4.0x/guide_page_gesture.png rename to making_school_asignment_app/assets/images/4.0x/guide_page_gesture.png diff --git a/assets/images/4.0x/hide_question_id.png b/making_school_asignment_app/assets/images/4.0x/hide_question_id.png similarity index 100% rename from assets/images/4.0x/hide_question_id.png rename to making_school_asignment_app/assets/images/4.0x/hide_question_id.png diff --git a/assets/images/4.0x/home_image.png b/making_school_asignment_app/assets/images/4.0x/home_image.png similarity index 100% rename from assets/images/4.0x/home_image.png rename to making_school_asignment_app/assets/images/4.0x/home_image.png diff --git a/assets/images/4.0x/ic_home_normal.png b/making_school_asignment_app/assets/images/4.0x/ic_home_normal.png similarity index 100% rename from assets/images/4.0x/ic_home_normal.png rename to making_school_asignment_app/assets/images/4.0x/ic_home_normal.png diff --git a/assets/images/4.0x/ic_home_press.png b/making_school_asignment_app/assets/images/4.0x/ic_home_press.png similarity index 100% rename from assets/images/4.0x/ic_home_press.png rename to making_school_asignment_app/assets/images/4.0x/ic_home_press.png diff --git a/assets/images/4.0x/ic_marking_normal.png b/making_school_asignment_app/assets/images/4.0x/ic_marking_normal.png similarity index 100% rename from assets/images/4.0x/ic_marking_normal.png rename to making_school_asignment_app/assets/images/4.0x/ic_marking_normal.png diff --git a/assets/images/4.0x/ic_marking_press.png b/making_school_asignment_app/assets/images/4.0x/ic_marking_press.png similarity index 100% rename from assets/images/4.0x/ic_marking_press.png rename to making_school_asignment_app/assets/images/4.0x/ic_marking_press.png diff --git a/assets/images/4.0x/ic_mine_normal.png b/making_school_asignment_app/assets/images/4.0x/ic_mine_normal.png similarity index 100% rename from assets/images/4.0x/ic_mine_normal.png rename to making_school_asignment_app/assets/images/4.0x/ic_mine_normal.png diff --git a/assets/images/4.0x/ic_mine_press.png b/making_school_asignment_app/assets/images/4.0x/ic_mine_press.png similarity index 100% rename from assets/images/4.0x/ic_mine_press.png rename to making_school_asignment_app/assets/images/4.0x/ic_mine_press.png diff --git a/assets/images/4.0x/ic_report_normal.png b/making_school_asignment_app/assets/images/4.0x/ic_report_normal.png similarity index 100% rename from assets/images/4.0x/ic_report_normal.png rename to making_school_asignment_app/assets/images/4.0x/ic_report_normal.png diff --git a/assets/images/4.0x/ic_report_press.png b/making_school_asignment_app/assets/images/4.0x/ic_report_press.png similarity index 100% rename from assets/images/4.0x/ic_report_press.png rename to making_school_asignment_app/assets/images/4.0x/ic_report_press.png diff --git a/assets/images/4.0x/ic_work_normal.png b/making_school_asignment_app/assets/images/4.0x/ic_work_normal.png similarity index 100% rename from assets/images/4.0x/ic_work_normal.png rename to making_school_asignment_app/assets/images/4.0x/ic_work_normal.png diff --git a/assets/images/4.0x/ic_work_press.png b/making_school_asignment_app/assets/images/4.0x/ic_work_press.png similarity index 100% rename from assets/images/4.0x/ic_work_press.png rename to making_school_asignment_app/assets/images/4.0x/ic_work_press.png diff --git a/assets/images/4.0x/job_report_scale.png b/making_school_asignment_app/assets/images/4.0x/job_report_scale.png similarity index 100% rename from assets/images/4.0x/job_report_scale.png rename to making_school_asignment_app/assets/images/4.0x/job_report_scale.png diff --git a/assets/images/4.0x/login_bgi.png b/making_school_asignment_app/assets/images/4.0x/login_bgi.png similarity index 100% rename from assets/images/4.0x/login_bgi.png rename to making_school_asignment_app/assets/images/4.0x/login_bgi.png diff --git a/assets/images/4.0x/logo.png b/making_school_asignment_app/assets/images/4.0x/logo.png similarity index 100% rename from assets/images/4.0x/logo.png rename to making_school_asignment_app/assets/images/4.0x/logo.png diff --git a/assets/images/4.0x/marking_settings.png b/making_school_asignment_app/assets/images/4.0x/marking_settings.png similarity index 100% rename from assets/images/4.0x/marking_settings.png rename to making_school_asignment_app/assets/images/4.0x/marking_settings.png diff --git a/assets/images/4.0x/not_data_bgm.png b/making_school_asignment_app/assets/images/4.0x/not_data_bgm.png similarity index 100% rename from assets/images/4.0x/not_data_bgm.png rename to making_school_asignment_app/assets/images/4.0x/not_data_bgm.png diff --git a/assets/images/4.0x/personal_bgi.png b/making_school_asignment_app/assets/images/4.0x/personal_bgi.png similarity index 100% rename from assets/images/4.0x/personal_bgi.png rename to making_school_asignment_app/assets/images/4.0x/personal_bgi.png diff --git a/assets/images/4.0x/report_home_icon_burst.png b/making_school_asignment_app/assets/images/4.0x/report_home_icon_burst.png similarity index 100% rename from assets/images/4.0x/report_home_icon_burst.png rename to making_school_asignment_app/assets/images/4.0x/report_home_icon_burst.png diff --git a/assets/images/4.0x/report_home_icon_subject.png b/making_school_asignment_app/assets/images/4.0x/report_home_icon_subject.png similarity index 100% rename from assets/images/4.0x/report_home_icon_subject.png rename to making_school_asignment_app/assets/images/4.0x/report_home_icon_subject.png diff --git a/assets/images/4.0x/report_home_top_img.png b/making_school_asignment_app/assets/images/4.0x/report_home_top_img.png similarity index 100% rename from assets/images/4.0x/report_home_top_img.png rename to making_school_asignment_app/assets/images/4.0x/report_home_top_img.png diff --git a/assets/images/4.0x/report_level_bgm.png b/making_school_asignment_app/assets/images/4.0x/report_level_bgm.png similarity index 100% rename from assets/images/4.0x/report_level_bgm.png rename to making_school_asignment_app/assets/images/4.0x/report_level_bgm.png diff --git a/assets/images/4.0x/review_error.png b/making_school_asignment_app/assets/images/4.0x/review_error.png similarity index 100% rename from assets/images/4.0x/review_error.png rename to making_school_asignment_app/assets/images/4.0x/review_error.png diff --git a/assets/images/4.0x/review_loding.png b/making_school_asignment_app/assets/images/4.0x/review_loding.png similarity index 100% rename from assets/images/4.0x/review_loding.png rename to making_school_asignment_app/assets/images/4.0x/review_loding.png diff --git a/assets/images/4.0x/rise.png b/making_school_asignment_app/assets/images/4.0x/rise.png similarity index 100% rename from assets/images/4.0x/rise.png rename to making_school_asignment_app/assets/images/4.0x/rise.png diff --git a/assets/images/4.0x/role_selection.png b/making_school_asignment_app/assets/images/4.0x/role_selection.png similarity index 100% rename from assets/images/4.0x/role_selection.png rename to making_school_asignment_app/assets/images/4.0x/role_selection.png diff --git a/assets/images/4.0x/test_paper_loading_failed.png b/making_school_asignment_app/assets/images/4.0x/test_paper_loading_failed.png similarity index 100% rename from assets/images/4.0x/test_paper_loading_failed.png rename to making_school_asignment_app/assets/images/4.0x/test_paper_loading_failed.png diff --git a/assets/images/4.0x/upgrade_dialog_bgc.png b/making_school_asignment_app/assets/images/4.0x/upgrade_dialog_bgc.png similarity index 100% rename from assets/images/4.0x/upgrade_dialog_bgc.png rename to making_school_asignment_app/assets/images/4.0x/upgrade_dialog_bgc.png diff --git a/assets/images/4.0x/vertical_screen_btn.png b/making_school_asignment_app/assets/images/4.0x/vertical_screen_btn.png similarity index 100% rename from assets/images/4.0x/vertical_screen_btn.png rename to making_school_asignment_app/assets/images/4.0x/vertical_screen_btn.png diff --git a/assets/images/abnormal_img.png b/making_school_asignment_app/assets/images/abnormal_img.png similarity index 100% rename from assets/images/abnormal_img.png rename to making_school_asignment_app/assets/images/abnormal_img.png diff --git a/assets/images/basic_info.png b/making_school_asignment_app/assets/images/basic_info.png similarity index 100% rename from assets/images/basic_info.png rename to making_school_asignment_app/assets/images/basic_info.png diff --git a/assets/images/check_icon.png b/making_school_asignment_app/assets/images/check_icon.png similarity index 100% rename from assets/images/check_icon.png rename to making_school_asignment_app/assets/images/check_icon.png diff --git a/assets/images/default_user_dead.png b/making_school_asignment_app/assets/images/default_user_dead.png similarity index 100% rename from assets/images/default_user_dead.png rename to making_school_asignment_app/assets/images/default_user_dead.png diff --git a/assets/images/detailed_report_entry_bgm.png b/making_school_asignment_app/assets/images/detailed_report_entry_bgm.png similarity index 100% rename from assets/images/detailed_report_entry_bgm.png rename to making_school_asignment_app/assets/images/detailed_report_entry_bgm.png diff --git a/assets/images/do_exit_marking.png b/making_school_asignment_app/assets/images/do_exit_marking.png similarity index 100% rename from assets/images/do_exit_marking.png rename to making_school_asignment_app/assets/images/do_exit_marking.png diff --git a/assets/images/do_marking_answer.png b/making_school_asignment_app/assets/images/do_marking_answer.png similarity index 100% rename from assets/images/do_marking_answer.png rename to making_school_asignment_app/assets/images/do_marking_answer.png diff --git a/assets/images/do_marking_test_paper.png b/making_school_asignment_app/assets/images/do_marking_test_paper.png similarity index 100% rename from assets/images/do_marking_test_paper.png rename to making_school_asignment_app/assets/images/do_marking_test_paper.png diff --git a/assets/images/equal.png b/making_school_asignment_app/assets/images/equal.png similarity index 100% rename from assets/images/equal.png rename to making_school_asignment_app/assets/images/equal.png diff --git a/assets/images/exam_selection.png b/making_school_asignment_app/assets/images/exam_selection.png similarity index 100% rename from assets/images/exam_selection.png rename to making_school_asignment_app/assets/images/exam_selection.png diff --git a/assets/images/fall.png b/making_school_asignment_app/assets/images/fall.png similarity index 100% rename from assets/images/fall.png rename to making_school_asignment_app/assets/images/fall.png diff --git a/assets/images/favorite_delete_icon.png b/making_school_asignment_app/assets/images/favorite_delete_icon.png similarity index 100% rename from assets/images/favorite_delete_icon.png rename to making_school_asignment_app/assets/images/favorite_delete_icon.png diff --git a/assets/images/favorite_dialog_close.png b/making_school_asignment_app/assets/images/favorite_dialog_close.png similarity index 100% rename from assets/images/favorite_dialog_close.png rename to making_school_asignment_app/assets/images/favorite_dialog_close.png diff --git a/assets/images/green_right_icon.png b/making_school_asignment_app/assets/images/green_right_icon.png similarity index 100% rename from assets/images/green_right_icon.png rename to making_school_asignment_app/assets/images/green_right_icon.png diff --git a/assets/images/guide_page_gesture.png b/making_school_asignment_app/assets/images/guide_page_gesture.png similarity index 100% rename from assets/images/guide_page_gesture.png rename to making_school_asignment_app/assets/images/guide_page_gesture.png diff --git a/assets/images/hide_question_id.png b/making_school_asignment_app/assets/images/hide_question_id.png similarity index 100% rename from assets/images/hide_question_id.png rename to making_school_asignment_app/assets/images/hide_question_id.png diff --git a/assets/images/home_image.png b/making_school_asignment_app/assets/images/home_image.png similarity index 100% rename from assets/images/home_image.png rename to making_school_asignment_app/assets/images/home_image.png diff --git a/assets/images/ic_home_normal.png b/making_school_asignment_app/assets/images/ic_home_normal.png similarity index 100% rename from assets/images/ic_home_normal.png rename to making_school_asignment_app/assets/images/ic_home_normal.png diff --git a/assets/images/ic_home_press.png b/making_school_asignment_app/assets/images/ic_home_press.png similarity index 100% rename from assets/images/ic_home_press.png rename to making_school_asignment_app/assets/images/ic_home_press.png diff --git a/assets/images/ic_marking_normal.png b/making_school_asignment_app/assets/images/ic_marking_normal.png similarity index 100% rename from assets/images/ic_marking_normal.png rename to making_school_asignment_app/assets/images/ic_marking_normal.png diff --git a/assets/images/ic_marking_press.png b/making_school_asignment_app/assets/images/ic_marking_press.png similarity index 100% rename from assets/images/ic_marking_press.png rename to making_school_asignment_app/assets/images/ic_marking_press.png diff --git a/assets/images/ic_mine_normal.png b/making_school_asignment_app/assets/images/ic_mine_normal.png similarity index 100% rename from assets/images/ic_mine_normal.png rename to making_school_asignment_app/assets/images/ic_mine_normal.png diff --git a/assets/images/ic_mine_press.png b/making_school_asignment_app/assets/images/ic_mine_press.png similarity index 100% rename from assets/images/ic_mine_press.png rename to making_school_asignment_app/assets/images/ic_mine_press.png diff --git a/assets/images/ic_report_normal.png b/making_school_asignment_app/assets/images/ic_report_normal.png similarity index 100% rename from assets/images/ic_report_normal.png rename to making_school_asignment_app/assets/images/ic_report_normal.png diff --git a/assets/images/ic_report_press.png b/making_school_asignment_app/assets/images/ic_report_press.png similarity index 100% rename from assets/images/ic_report_press.png rename to making_school_asignment_app/assets/images/ic_report_press.png diff --git a/assets/images/ic_work_normal.png b/making_school_asignment_app/assets/images/ic_work_normal.png similarity index 100% rename from assets/images/ic_work_normal.png rename to making_school_asignment_app/assets/images/ic_work_normal.png diff --git a/assets/images/ic_work_press.png b/making_school_asignment_app/assets/images/ic_work_press.png similarity index 100% rename from assets/images/ic_work_press.png rename to making_school_asignment_app/assets/images/ic_work_press.png diff --git a/assets/images/job_data_right_icon.png b/making_school_asignment_app/assets/images/job_data_right_icon.png similarity index 100% rename from assets/images/job_data_right_icon.png rename to making_school_asignment_app/assets/images/job_data_right_icon.png diff --git a/assets/images/job_home_answer_record.png b/making_school_asignment_app/assets/images/job_home_answer_record.png similarity index 100% rename from assets/images/job_home_answer_record.png rename to making_school_asignment_app/assets/images/job_home_answer_record.png diff --git a/assets/images/job_home_history.png b/making_school_asignment_app/assets/images/job_home_history.png similarity index 100% rename from assets/images/job_home_history.png rename to making_school_asignment_app/assets/images/job_home_history.png diff --git a/assets/images/job_home_knowledge.png b/making_school_asignment_app/assets/images/job_home_knowledge.png similarity index 100% rename from assets/images/job_home_knowledge.png rename to making_school_asignment_app/assets/images/job_home_knowledge.png diff --git a/assets/images/job_home_marking.png b/making_school_asignment_app/assets/images/job_home_marking.png similarity index 100% rename from assets/images/job_home_marking.png rename to making_school_asignment_app/assets/images/job_home_marking.png diff --git a/assets/images/job_home_marking_set.png b/making_school_asignment_app/assets/images/job_home_marking_set.png similarity index 100% rename from assets/images/job_home_marking_set.png rename to making_school_asignment_app/assets/images/job_home_marking_set.png diff --git a/assets/images/job_home_top_bgm.png b/making_school_asignment_app/assets/images/job_home_top_bgm.png similarity index 100% rename from assets/images/job_home_top_bgm.png rename to making_school_asignment_app/assets/images/job_home_top_bgm.png diff --git a/assets/images/job_home_youxian.png b/making_school_asignment_app/assets/images/job_home_youxian.png similarity index 100% rename from assets/images/job_home_youxian.png rename to making_school_asignment_app/assets/images/job_home_youxian.png diff --git a/assets/images/job_personal_correct_icon.png b/making_school_asignment_app/assets/images/job_personal_correct_icon.png similarity index 100% rename from assets/images/job_personal_correct_icon.png rename to making_school_asignment_app/assets/images/job_personal_correct_icon.png diff --git a/assets/images/job_personal_error_icon.png b/making_school_asignment_app/assets/images/job_personal_error_icon.png similarity index 100% rename from assets/images/job_personal_error_icon.png rename to making_school_asignment_app/assets/images/job_personal_error_icon.png diff --git a/assets/images/job_report_class_icon.png b/making_school_asignment_app/assets/images/job_report_class_icon.png similarity index 100% rename from assets/images/job_report_class_icon.png rename to making_school_asignment_app/assets/images/job_report_class_icon.png diff --git a/assets/images/job_report_scale.png b/making_school_asignment_app/assets/images/job_report_scale.png similarity index 100% rename from assets/images/job_report_scale.png rename to making_school_asignment_app/assets/images/job_report_scale.png diff --git a/assets/images/login_account.png b/making_school_asignment_app/assets/images/login_account.png similarity index 100% rename from assets/images/login_account.png rename to making_school_asignment_app/assets/images/login_account.png diff --git a/assets/images/login_bg.png b/making_school_asignment_app/assets/images/login_bg.png similarity index 100% rename from assets/images/login_bg.png rename to making_school_asignment_app/assets/images/login_bg.png diff --git a/assets/images/login_logo.png b/making_school_asignment_app/assets/images/login_logo.png similarity index 100% rename from assets/images/login_logo.png rename to making_school_asignment_app/assets/images/login_logo.png diff --git a/assets/images/login_pwd.png b/making_school_asignment_app/assets/images/login_pwd.png similarity index 100% rename from assets/images/login_pwd.png rename to making_school_asignment_app/assets/images/login_pwd.png diff --git a/assets/images/marking_settings.png b/making_school_asignment_app/assets/images/marking_settings.png similarity index 100% rename from assets/images/marking_settings.png rename to making_school_asignment_app/assets/images/marking_settings.png diff --git a/assets/images/no_check_icon.png b/making_school_asignment_app/assets/images/no_check_icon.png similarity index 100% rename from assets/images/no_check_icon.png rename to making_school_asignment_app/assets/images/no_check_icon.png diff --git a/assets/images/not_data_bgm2.png b/making_school_asignment_app/assets/images/not_data_bgm2.png similarity index 100% rename from assets/images/not_data_bgm2.png rename to making_school_asignment_app/assets/images/not_data_bgm2.png diff --git a/assets/images/overall_level.png b/making_school_asignment_app/assets/images/overall_level.png similarity index 100% rename from assets/images/overall_level.png rename to making_school_asignment_app/assets/images/overall_level.png diff --git a/assets/images/personal_bgi.png b/making_school_asignment_app/assets/images/personal_bgi.png similarity index 100% rename from assets/images/personal_bgi.png rename to making_school_asignment_app/assets/images/personal_bgi.png diff --git a/assets/images/report_group_bg.png b/making_school_asignment_app/assets/images/report_group_bg.png similarity index 100% rename from assets/images/report_group_bg.png rename to making_school_asignment_app/assets/images/report_group_bg.png diff --git a/assets/images/report_home_icon_burst.png b/making_school_asignment_app/assets/images/report_home_icon_burst.png similarity index 100% rename from assets/images/report_home_icon_burst.png rename to making_school_asignment_app/assets/images/report_home_icon_burst.png diff --git a/assets/images/report_home_icon_subject.png b/making_school_asignment_app/assets/images/report_home_icon_subject.png similarity index 100% rename from assets/images/report_home_icon_subject.png rename to making_school_asignment_app/assets/images/report_home_icon_subject.png diff --git a/assets/images/report_home_top_img.png b/making_school_asignment_app/assets/images/report_home_top_img.png similarity index 100% rename from assets/images/report_home_top_img.png rename to making_school_asignment_app/assets/images/report_home_top_img.png diff --git a/assets/images/report_level_bgm.png b/making_school_asignment_app/assets/images/report_level_bgm.png similarity index 100% rename from assets/images/report_level_bgm.png rename to making_school_asignment_app/assets/images/report_level_bgm.png diff --git a/assets/images/reports_bg.png b/making_school_asignment_app/assets/images/reports_bg.png similarity index 100% rename from assets/images/reports_bg.png rename to making_school_asignment_app/assets/images/reports_bg.png diff --git a/assets/images/reports_card.png b/making_school_asignment_app/assets/images/reports_card.png similarity index 100% rename from assets/images/reports_card.png rename to making_school_asignment_app/assets/images/reports_card.png diff --git a/assets/images/reports_focus.png b/making_school_asignment_app/assets/images/reports_focus.png similarity index 100% rename from assets/images/reports_focus.png rename to making_school_asignment_app/assets/images/reports_focus.png diff --git a/assets/images/reports_score.png b/making_school_asignment_app/assets/images/reports_score.png similarity index 100% rename from assets/images/reports_score.png rename to making_school_asignment_app/assets/images/reports_score.png diff --git a/assets/images/review_error.png b/making_school_asignment_app/assets/images/review_error.png similarity index 100% rename from assets/images/review_error.png rename to making_school_asignment_app/assets/images/review_error.png diff --git a/assets/images/review_loding.png b/making_school_asignment_app/assets/images/review_loding.png similarity index 100% rename from assets/images/review_loding.png rename to making_school_asignment_app/assets/images/review_loding.png diff --git a/assets/images/right_icon.png b/making_school_asignment_app/assets/images/right_icon.png similarity index 100% rename from assets/images/right_icon.png rename to making_school_asignment_app/assets/images/right_icon.png diff --git a/assets/images/rise.png b/making_school_asignment_app/assets/images/rise.png similarity index 100% rename from assets/images/rise.png rename to making_school_asignment_app/assets/images/rise.png diff --git a/assets/images/role_selection.png b/making_school_asignment_app/assets/images/role_selection.png similarity index 100% rename from assets/images/role_selection.png rename to making_school_asignment_app/assets/images/role_selection.png diff --git a/assets/images/school_icon.png b/making_school_asignment_app/assets/images/school_icon.png similarity index 100% rename from assets/images/school_icon.png rename to making_school_asignment_app/assets/images/school_icon.png diff --git a/assets/images/search_icon.png b/making_school_asignment_app/assets/images/search_icon.png similarity index 100% rename from assets/images/search_icon.png rename to making_school_asignment_app/assets/images/search_icon.png diff --git a/assets/images/sort_icon.png b/making_school_asignment_app/assets/images/sort_icon.png similarity index 100% rename from assets/images/sort_icon.png rename to making_school_asignment_app/assets/images/sort_icon.png diff --git a/assets/images/test_paper_loading_failed.png b/making_school_asignment_app/assets/images/test_paper_loading_failed.png similarity index 100% rename from assets/images/test_paper_loading_failed.png rename to making_school_asignment_app/assets/images/test_paper_loading_failed.png diff --git a/assets/images/upgrade_dialog_bgc.png b/making_school_asignment_app/assets/images/upgrade_dialog_bgc.png similarity index 100% rename from assets/images/upgrade_dialog_bgc.png rename to making_school_asignment_app/assets/images/upgrade_dialog_bgc.png diff --git a/assets/images/vertical_screen_btn.png b/making_school_asignment_app/assets/images/vertical_screen_btn.png similarity index 100% rename from assets/images/vertical_screen_btn.png rename to making_school_asignment_app/assets/images/vertical_screen_btn.png diff --git a/assets/images/work_top_bg.png b/making_school_asignment_app/assets/images/work_top_bg.png similarity index 100% rename from assets/images/work_top_bg.png rename to making_school_asignment_app/assets/images/work_top_bg.png diff --git a/assets/images/youx_icon_active.png b/making_school_asignment_app/assets/images/youx_icon_active.png similarity index 100% rename from assets/images/youx_icon_active.png rename to making_school_asignment_app/assets/images/youx_icon_active.png diff --git a/assets/images/youx_icon_default.png b/making_school_asignment_app/assets/images/youx_icon_default.png similarity index 100% rename from assets/images/youx_icon_default.png rename to making_school_asignment_app/assets/images/youx_icon_default.png diff --git a/ios/.gitignore b/making_school_asignment_app/ios/.gitignore similarity index 100% rename from ios/.gitignore rename to making_school_asignment_app/ios/.gitignore diff --git a/ios/Flutter/AppFrameworkInfo.plist b/making_school_asignment_app/ios/Flutter/AppFrameworkInfo.plist similarity index 96% rename from ios/Flutter/AppFrameworkInfo.plist rename to making_school_asignment_app/ios/Flutter/AppFrameworkInfo.plist index 9625e10..7c56964 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/making_school_asignment_app/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/ios/Flutter/Debug.xcconfig b/making_school_asignment_app/ios/Flutter/Debug.xcconfig similarity index 100% rename from ios/Flutter/Debug.xcconfig rename to making_school_asignment_app/ios/Flutter/Debug.xcconfig diff --git a/ios/Flutter/Release.xcconfig b/making_school_asignment_app/ios/Flutter/Release.xcconfig similarity index 100% rename from ios/Flutter/Release.xcconfig rename to making_school_asignment_app/ios/Flutter/Release.xcconfig diff --git a/ios/Runner.xcodeproj/project.pbxproj b/making_school_asignment_app/ios/Runner.xcodeproj/project.pbxproj similarity index 95% rename from ios/Runner.xcodeproj/project.pbxproj rename to making_school_asignment_app/ios/Runner.xcodeproj/project.pbxproj index 27e7203..b120f2c 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/making_school_asignment_app/ios/Runner.xcodeproj/project.pbxproj @@ -8,12 +8,12 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -42,6 +42,8 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -53,8 +55,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -68,6 +68,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -79,14 +87,6 @@ name = Flutter; sourceTree = ""; }; - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( @@ -129,7 +129,6 @@ buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( 331C807D294A63A400263BE5 /* Sources */, - 331C807E294A63A400263BE5 /* Frameworks */, 331C807F294A63A400263BE5 /* Resources */, ); buildRules = ( @@ -168,7 +167,8 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -307,6 +307,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -336,6 +337,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -344,7 +346,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -366,7 +368,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp; + PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -376,14 +378,13 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -394,14 +395,13 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -410,14 +410,13 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -428,6 +427,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -457,6 +457,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -471,7 +472,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -483,6 +484,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -512,6 +514,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -520,7 +523,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -544,7 +547,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp; + PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -566,7 +569,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp; + PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/making_school_asignment_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to making_school_asignment_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/making_school_asignment_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to making_school_asignment_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/making_school_asignment_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to making_school_asignment_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/making_school_asignment_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 99% rename from ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to making_school_asignment_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e42adcb..8e3ca5d 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/making_school_asignment_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - School Asignment App + Making School Asignment App CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - school_asignment_app + making_school_asignment_app CFBundlePackageType APPL CFBundleShortVersionString @@ -41,8 +41,6 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - UIViewControllerBasedStatusBarAppearance - CADisableMinimumFrameDurationOnPhone UIApplicationSupportsIndirectInputEvents diff --git a/ios/Runner/Runner-Bridging-Header.h b/making_school_asignment_app/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from ios/Runner/Runner-Bridging-Header.h rename to making_school_asignment_app/ios/Runner/Runner-Bridging-Header.h diff --git a/ios/RunnerTests/RunnerTests.swift b/making_school_asignment_app/ios/RunnerTests/RunnerTests.swift similarity index 100% rename from ios/RunnerTests/RunnerTests.swift rename to making_school_asignment_app/ios/RunnerTests/RunnerTests.swift diff --git a/lib/common/api/retrofit_client.dart b/making_school_asignment_app/lib/common/api/retrofit_client.dart similarity index 56% rename from lib/common/api/retrofit_client.dart rename to making_school_asignment_app/lib/common/api/retrofit_client.dart index b47492e..2bba4c0 100644 --- a/lib/common/api/retrofit_client.dart +++ b/making_school_asignment_app/lib/common/api/retrofit_client.dart @@ -1,21 +1,21 @@ import 'package:dio/dio.dart' hide Headers; import 'package:retrofit/retrofit.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/common/job/class_item.dart'; -import 'package:school_asignment_app/common/job/common/app_version_model.dart'; -import 'package:school_asignment_app/common/job/common/base_app_version.dart'; -import 'package:school_asignment_app/common/job/common/base_page_data.dart'; -import 'package:school_asignment_app/common/job/enum_subject.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/job/knowledge_points_grasp.dart'; -import 'package:school_asignment_app/common/job/knowledge_report_detail.dart'; -import 'package:school_asignment_app/common/job/student_history.dart'; -import 'package:school_asignment_app/common/job/student_history_params.dart'; -import 'package:school_asignment_app/common/job/student_item.dart'; -import 'package:school_asignment_app/common/job/student_personal_info.dart'; -import 'package:school_asignment_app/common/job/user_info_detail.dart'; -import 'package:school_asignment_app/common/job/work_student.dart'; -import 'package:school_asignment_app/common/job/work_student_params.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/job/class_item.dart'; +import 'package:making_school_asignment_app/common/job/common/app_version_model.dart'; +import 'package:making_school_asignment_app/common/job/common/base_app_version.dart'; +import 'package:making_school_asignment_app/common/job/common/base_page_data.dart'; +import 'package:making_school_asignment_app/common/job/enum_subject.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart'; +import 'package:making_school_asignment_app/common/job/knowledge_report_detail.dart'; +import 'package:making_school_asignment_app/common/job/student_history.dart'; +import 'package:making_school_asignment_app/common/job/student_history_params.dart'; +import 'package:making_school_asignment_app/common/job/student_item.dart'; +import 'package:making_school_asignment_app/common/job/student_personal_info.dart'; +import 'package:making_school_asignment_app/common/job/user_info_detail.dart'; +import 'package:making_school_asignment_app/common/job/work_student.dart'; +import 'package:making_school_asignment_app/common/job/work_student_params.dart'; part 'retrofit_client.g.dart'; @@ -50,7 +50,7 @@ abstract class RetrofitClient { //获取优先批阅状态学生列表 @GET("/api/rbac/Student/GetPriorityAnnotateStudents") - Future> getStudentList(@Query('ClassId') String classId,@Query('Subject') int subject ); + Future> getStudentList(@Query('ClassId') String classId, @Query('Subject') int subject); //待批阅列表 @GET("/api/hms/Annotate/GetUnAnnotateList") @@ -66,7 +66,7 @@ abstract class RetrofitClient { //作业明细 @GET("/api/hms/HmsReport/GetHomeworkDtls") - Future getHomeworkDetails(@Query('homeworkId') String homeworkId,@Query('classId') String classId); + Future getHomeworkDetails(@Query('homeworkId') String homeworkId, @Query('classId') String classId); //学生历史作业 @GET("/api/hms/HmsReport/GetStudentHistory") @@ -74,28 +74,28 @@ abstract class RetrofitClient { //修改学生优先批阅状态 @POST("/api/rbac/Student/PriorityAnnotateStudent") - Future getAnnotateStudent(@Field() String classId, @Field() int studentId,@Field() bool priorityAnnotate,@Field() int subject); + Future getAnnotateStudent(@Field() String classId, @Field() int studentId, @Field() bool priorityAnnotate, @Field() int subject); //学生作业信息 @GET("/api/hms/HmsReport/GetStudentHomework") - Future getStudentHomework(@Query('HomeworkId') String homeworkId,@Query('StudentId') int studentId); + Future getStudentHomework(@Query('HomeworkId') String homeworkId, @Query('StudentId') int studentId); //知识点掌握 @GET("/api/hms/HmsReport/GetKnowledgeReport") - Future> getKnowledgeReport(@Query('DateStart') String dateStart,@Query('DateEnd') String dateEnd,@Query('KnowledgeName') String knowledgeName); + Future> getKnowledgeReport( + @Query('DateStart') String dateStart, @Query('DateEnd') String dateEnd, @Query('KnowledgeName') String knowledgeName); //知识点掌握详情 @GET("/api/hms/HmsReport/GetKnowledgeReportDetail") - Future> getKnowledgeReportDetail(@Query('DateStart') String dateStart,@Query('DateEnd') String dateEnd,@Query('KnowledgeId') int knowledgeId); + Future> getKnowledgeReportDetail( + @Query('DateStart') String dateStart, @Query('DateEnd') String dateEnd, @Query('KnowledgeId') int knowledgeId); //学生 @GET("/api/hms/HmsReport/GetQuestionStudentState") - Future> getQuestionStudentState(@Query('HomeworkId') String homeworkId,@Query('TemplateId') int templateId,@Query('QuestionNo') int questionNo); - + Future> getQuestionStudentState( + @Query('HomeworkId') String homeworkId, @Query('TemplateId') int templateId, @Query('QuestionNo') int questionNo); //收集订正 @POST("/api/hms/Homework/Collect") Future getCollect(@Field() String homeworkId); - - } diff --git a/making_school_asignment_app/lib/common/api/retrofit_client.g.dart b/making_school_asignment_app/lib/common/api/retrofit_client.g.dart new file mode 100644 index 0000000..ad91f13 --- /dev/null +++ b/making_school_asignment_app/lib/common/api/retrofit_client.g.dart @@ -0,0 +1,622 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'retrofit_client.dart'; + +// ************************************************************************** +// RetrofitGenerator +// ************************************************************************** + +// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers + +class _RetrofitClient implements RetrofitClient { + _RetrofitClient( + this._dio, { + this.baseUrl, + }); + + final Dio _dio; + + String? baseUrl; + + @override + Future?> getAppVersions( + BaseAppVersion appVersion) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(appVersion.toJson()); + final _result = await _dio.fetch?>( + _setStreamType>(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/infra/AppVersion/GetList', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = _result.data == null + ? null + : BasePageData.fromJson( + _result.data!, + (json) => AppVersionModel.fromJson(json as Map), + ); + return value; + } + + @override + Future toLogin( + String account, + String password, + ) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = { + 'account': account, + 'password': password, + }; + final _result = await _dio.fetch(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/rbac/Auth/DcLogin', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = _result.data; + return value; + } + + @override + Future getUser(String userId) async { + final _extra = {}; + final queryParameters = {r'userId': userId}; + final _headers = {}; + const Map? _data = null; + final _result = await _dio + .fetch?>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/rbac/User/GetUser', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = + _result.data == null ? null : UserInfoDetail.fromJson(_result.data!); + return value; + } + + @override + Future getWorkList(WorkStudentParams params) async { + final _extra = {}; + final queryParameters = {}; + queryParameters.addAll(params.toJson()); + final _headers = {}; + const Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/Homework/GetList', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = WorkStudent.fromJson(_result.data!); + return value; + } + + @override + Future>> getEnumSubjectList( + List enumNames) async { + final _extra = {}; + final queryParameters = {r'enumNames': enumNames}; + final _headers = {}; + const Map? _data = null; + final _result = await _dio.fetch>( + _setStreamType>>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/app/Common/GetEnumInfos', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + var value = _result.data!.map((k, dynamic v) => MapEntry( + k, + (v as List) + .map((i) => EnumSubject.fromJson(i as Map)) + .toList())); + return value; + } + + @override + Future> getStudentClass() async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/rbac/SchoolUser/GetTeacherClassSubject', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + var value = _result.data! + .map((dynamic i) => ClassItem.fromJson(i as Map)) + .toList(); + return value; + } + + @override + Future> getStudentList( + String classId, + int subject, + ) async { + final _extra = {}; + final queryParameters = { + r'ClassId': classId, + r'Subject': subject, + }; + final _headers = {}; + const Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/rbac/Student/GetPriorityAnnotateStudents', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + var value = _result.data! + .map((dynamic i) => StudentItem.fromJson(i as Map)) + .toList(); + return value; + } + + @override + Future getUnAnnotateList(WorkStudentParams params) async { + final _extra = {}; + final queryParameters = {}; + queryParameters.addAll(params.toJson()); + final _headers = {}; + const Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/Annotate/GetUnAnnotateList', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = WorkStudent.fromJson(_result.data!); + return value; + } + + @override + Future getAnnotatedList(WorkStudentParams params) async { + final _extra = {}; + final queryParameters = {}; + queryParameters.addAll(params.toJson()); + final _headers = {}; + const Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/Annotate/GetAnnotatedList', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = WorkStudent.fromJson(_result.data!); + return value; + } + + @override + Future> getAnnotatedClassList(String homeworkId) async { + final _extra = {}; + final queryParameters = {r'homeworkId': homeworkId}; + final _headers = {}; + const Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/Annotate/Get', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + var value = _result.data! + .map((dynamic i) => AnnotatedClass.fromJson(i as Map)) + .toList(); + return value; + } + + @override + Future getHomeworkDetails( + String homeworkId, + String classId, + ) async { + final _extra = {}; + final queryParameters = { + r'homeworkId': homeworkId, + r'classId': classId, + }; + final _headers = {}; + const Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/HmsReport/GetHomeworkDtls', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = HomeworkDetails.fromJson(_result.data!); + return value; + } + + @override + Future getStudentHistory(StudentHistoryParams params) async { + final _extra = {}; + final queryParameters = {}; + queryParameters.addAll(params.toJson()); + final _headers = {}; + const Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/HmsReport/GetStudentHistory', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = StudentHistory.fromJson(_result.data!); + return value; + } + + @override + Future getAnnotateStudent( + String classId, + int studentId, + bool priorityAnnotate, + int subject, + ) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = { + 'classId': classId, + 'studentId': studentId, + 'priorityAnnotate': priorityAnnotate, + 'subject': subject, + }; + final _result = await _dio.fetch(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/rbac/Student/PriorityAnnotateStudent', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = _result.data; + return value; + } + + @override + Future getStudentHomework( + String homeworkId, + int studentId, + ) async { + final _extra = {}; + final queryParameters = { + r'HomeworkId': homeworkId, + r'StudentId': studentId, + }; + final _headers = {}; + const Map? _data = null; + final _result = await _dio.fetch>( + _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/HmsReport/GetStudentHomework', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = StudentPersonalInfo.fromJson(_result.data!); + return value; + } + + @override + Future> getKnowledgeReport( + String dateStart, + String dateEnd, + String knowledgeName, + ) async { + final _extra = {}; + final queryParameters = { + r'DateStart': dateStart, + r'DateEnd': dateEnd, + r'KnowledgeName': knowledgeName, + }; + final _headers = {}; + const Map? _data = null; + final _result = await _dio.fetch>( + _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/HmsReport/GetKnowledgeReport', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + var value = _result.data! + .map((dynamic i) => + KnowledgePointsGrasp.fromJson(i as Map)) + .toList(); + return value; + } + + @override + Future> getKnowledgeReportDetail( + String dateStart, + String dateEnd, + int knowledgeId, + ) async { + final _extra = {}; + final queryParameters = { + r'DateStart': dateStart, + r'DateEnd': dateEnd, + r'KnowledgeId': knowledgeId, + }; + final _headers = {}; + const Map? _data = null; + final _result = await _dio.fetch>( + _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/HmsReport/GetKnowledgeReportDetail', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + var value = _result.data! + .map((dynamic i) => + KnowledgeReportDetail.fromJson(i as Map)) + .toList(); + return value; + } + + @override + Future> getQuestionStudentState( + String homeworkId, + int templateId, + int questionNo, + ) async { + final _extra = {}; + final queryParameters = { + r'HomeworkId': homeworkId, + r'TemplateId': templateId, + r'QuestionNo': questionNo, + }; + final _headers = {}; + const Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/HmsReport/GetQuestionStudentState', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + var value = _result.data! + .map((dynamic i) => Students.fromJson(i as Map)) + .toList(); + return value; + } + + @override + Future getCollect(String homeworkId) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {'homeworkId': homeworkId}; + final _result = await _dio.fetch(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/hms/Homework/Collect', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = _result.data; + return value; + } + + RequestOptions _setStreamType(RequestOptions requestOptions) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { + if (T == String) { + requestOptions.responseType = ResponseType.plain; + } else { + requestOptions.responseType = ResponseType.json; + } + } + return requestOptions; + } + + String _combineBaseUrls( + String dioBaseUrl, + String? baseUrl, + ) { + if (baseUrl == null || baseUrl.trim().isEmpty) { + return dioBaseUrl; + } + + final url = Uri.parse(baseUrl); + + if (url.isAbsolute) { + return url.toString(); + } + + return Uri.parse(dioBaseUrl).resolveUri(url).toString(); + } +} diff --git a/lib/common/config/app_config.dart b/making_school_asignment_app/lib/common/config/app_config.dart similarity index 100% rename from lib/common/config/app_config.dart rename to making_school_asignment_app/lib/common/config/app_config.dart diff --git a/lib/common/config/colorUtils.dart b/making_school_asignment_app/lib/common/config/colorUtils.dart similarity index 100% rename from lib/common/config/colorUtils.dart rename to making_school_asignment_app/lib/common/config/colorUtils.dart diff --git a/lib/common/config/request_config.dart b/making_school_asignment_app/lib/common/config/request_config.dart similarity index 94% rename from lib/common/config/request_config.dart rename to making_school_asignment_app/lib/common/config/request_config.dart index b5a8328..3a04545 100644 --- a/lib/common/config/request_config.dart +++ b/making_school_asignment_app/lib/common/config/request_config.dart @@ -6,7 +6,7 @@ * @FilePath: \marking_app\lib\config\RequestConfig.dart * @Description: 请求工具类 */ -import 'package:school_asignment_app/common/job/common/base_page.dart'; +import 'package:making_school_asignment_app/common/job/common/base_page.dart'; class RequestConfig { static const _devBaseUrl = "http://192.168.2.119:1091"; // 开发 @@ -22,7 +22,7 @@ class RequestConfig { static const bool printSwitch = true; // 打印返回数据 static const successCode = [204, 200]; // 返回成功code static final BasePage basePage = BasePage(1, 10); // 分页参数 - + // 私有化构造函数,防止外部直接实例化 // 私有化构造函数,防止外部直接实例化 RequestConfig._({required this.baseUrl}); diff --git a/lib/common/const_text.dart b/making_school_asignment_app/lib/common/const_text.dart similarity index 100% rename from lib/common/const_text.dart rename to making_school_asignment_app/lib/common/const_text.dart diff --git a/lib/common/job/annotated_class.dart b/making_school_asignment_app/lib/common/job/annotated_class.dart similarity index 100% rename from lib/common/job/annotated_class.dart rename to making_school_asignment_app/lib/common/job/annotated_class.dart diff --git a/making_school_asignment_app/lib/common/job/annotated_class.g.dart b/making_school_asignment_app/lib/common/job/annotated_class.g.dart new file mode 100644 index 0000000..c27702f --- /dev/null +++ b/making_school_asignment_app/lib/common/job/annotated_class.g.dart @@ -0,0 +1,114 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'annotated_class.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AnnotatedClass _$AnnotatedClassFromJson(Map json) => + AnnotatedClass( + json['schoolName'] as String, + (json['grade'] as num).toInt(), + json['classId'] as String, + json['className'] as String, + json['finishTime'] as String?, + (json['questionCount'] as num).toInt(), + (json['answerCount'] as num).toInt(), + (json['answerRate'] as num).toInt(), + (json['unAnnotateCount'] as num).toInt(), + (json['annotateRate'] as num).toInt(), + (json['students'] as List) + .map((e) => AnnotatedStudents.fromJson(e as Map)) + .toList(), + (json['homeworkFavs'] as List) + .map((e) => HomeworkFavs.fromJson(e as Map)) + .toList(), + (json['kgtCorrectRate'] as num).toInt(), + (json['zgtCorrectRate'] as num).toInt(), + (json['correctRate'] as num).toInt(), + (json['commitStudentCount'] as num?)?.toInt(), + (json['noCommitStudentCount'] as num?)?.toInt(), + (json['commitStudent'] as List?) + ?.map((e) => AnnotatedStudents.fromJson(e as Map)) + .toList(), + (json['noCommitStudent'] as List?) + ?.map((e) => AnnotatedStudents.fromJson(e as Map)) + .toList(), + ); + +Map _$AnnotatedClassToJson(AnnotatedClass instance) => + { + 'schoolName': instance.schoolName, + 'grade': instance.grade, + 'classId': instance.classId, + 'className': instance.className, + 'finishTime': instance.finishTime, + 'questionCount': instance.questionCount, + 'answerCount': instance.answerCount, + 'answerRate': instance.answerRate, + 'unAnnotateCount': instance.unAnnotateCount, + 'annotateRate': instance.annotateRate, + 'students': instance.students, + 'homeworkFavs': instance.homeworkFavs, + 'kgtCorrectRate': instance.kgtCorrectRate, + 'zgtCorrectRate': instance.zgtCorrectRate, + 'correctRate': instance.correctRate, + 'commitStudentCount': instance.commitStudentCount, + 'noCommitStudentCount': instance.noCommitStudentCount, + 'commitStudent': instance.commitStudent, + 'noCommitStudent': instance.noCommitStudent, + }; + +AnnotatedStudents _$AnnotatedStudentsFromJson(Map json) => + AnnotatedStudents( + json['id'] as String?, + json['isDeleted'] as bool, + json['homeworkId'] as String?, + json['classId'] as String, + (json['studentId'] as num).toInt(), + json['studentName'] as String, + (json['state'] as num).toInt(), + ); + +Map _$AnnotatedStudentsToJson(AnnotatedStudents instance) => + { + 'id': instance.id, + 'isDeleted': instance.isDeleted, + 'homeworkId': instance.homeworkId, + 'classId': instance.classId, + 'studentId': instance.studentId, + 'studentName': instance.studentName, + 'state': instance.state, + }; + +HomeworkFavs _$HomeworkFavsFromJson(Map json) => HomeworkFavs( + json['id'] as String, + json['homeworkId'] as String, + json['homeworkName'] as String, + (json['grade'] as num).toInt(), + (json['subject'] as num).toInt(), + json['classId'] as String, + json['className'] as String, + (json['studentId'] as num).toInt(), + json['studentName'] as String, + json['templateId'] as String, + (json['questionNo'] as num).toInt(), + json['subjectiveAnswer'] as String, + ); + +Map _$HomeworkFavsToJson(HomeworkFavs instance) => + { + 'id': instance.id, + 'homeworkId': instance.homeworkId, + 'homeworkName': instance.homeworkName, + 'grade': instance.grade, + 'subject': instance.subject, + 'classId': instance.classId, + 'className': instance.className, + 'studentId': instance.studentId, + 'studentName': instance.studentName, + 'templateId': instance.templateId, + 'questionNo': instance.questionNo, + 'subjectiveAnswer': instance.subjectiveAnswer, + }; diff --git a/lib/common/job/class_item.dart b/making_school_asignment_app/lib/common/job/class_item.dart similarity index 100% rename from lib/common/job/class_item.dart rename to making_school_asignment_app/lib/common/job/class_item.dart diff --git a/making_school_asignment_app/lib/common/job/class_item.g.dart b/making_school_asignment_app/lib/common/job/class_item.g.dart new file mode 100644 index 0000000..939c889 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/class_item.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'class_item.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ClassItem _$ClassItemFromJson(Map json) => ClassItem( + json['id'] as String, + json['schoolName'] as String, + (json['grade'] as num).toInt(), + json['className'] as String, + (json['subject'] as num?)?.toInt(), + json['classId'] as String, + ); + +Map _$ClassItemToJson(ClassItem instance) => { + 'id': instance.id, + 'schoolName': instance.schoolName, + 'grade': instance.grade, + 'className': instance.className, + 'classId': instance.classId, + 'subject': instance.subject, + }; diff --git a/lib/common/job/common/app_version_model.dart b/making_school_asignment_app/lib/common/job/common/app_version_model.dart similarity index 100% rename from lib/common/job/common/app_version_model.dart rename to making_school_asignment_app/lib/common/job/common/app_version_model.dart diff --git a/making_school_asignment_app/lib/common/job/common/app_version_model.g.dart b/making_school_asignment_app/lib/common/job/common/app_version_model.g.dart new file mode 100644 index 0000000..28bfb36 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/common/app_version_model.g.dart @@ -0,0 +1,13 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'app_version_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AppVersionModel _$AppVersionModelFromJson(Map json) => + AppVersionModel(); + +Map _$AppVersionModelToJson(AppVersionModel instance) => + {}; diff --git a/lib/common/job/common/base_app_version.dart b/making_school_asignment_app/lib/common/job/common/base_app_version.dart similarity index 86% rename from lib/common/job/common/base_app_version.dart rename to making_school_asignment_app/lib/common/job/common/base_app_version.dart index a9283e2..008608a 100644 --- a/lib/common/job/common/base_app_version.dart +++ b/making_school_asignment_app/lib/common/job/common/base_app_version.dart @@ -1,5 +1,5 @@ import 'package:json_annotation/json_annotation.dart'; -import 'package:school_asignment_app/common/job/common/base_page.dart'; +import 'package:making_school_asignment_app/common/job/common/base_page.dart'; part 'base_app_version.g.dart'; diff --git a/making_school_asignment_app/lib/common/job/common/base_app_version.g.dart b/making_school_asignment_app/lib/common/job/common/base_app_version.g.dart new file mode 100644 index 0000000..98cbd36 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/common/base_app_version.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_app_version.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseAppVersion _$BaseAppVersionFromJson(Map json) => + BaseAppVersion( + json['AppName'] as String, + (json['FtuType'] as num).toInt(), + (json['PageNumber'] as num).toInt(), + (json['PageSize'] as num).toInt(), + ); + +Map _$BaseAppVersionToJson(BaseAppVersion instance) => + { + 'PageNumber': instance.page, + 'PageSize': instance.limit, + 'AppName': instance.appName, + 'FtuType': instance.ftuType, + }; diff --git a/lib/common/job/common/base_page.dart b/making_school_asignment_app/lib/common/job/common/base_page.dart similarity index 100% rename from lib/common/job/common/base_page.dart rename to making_school_asignment_app/lib/common/job/common/base_page.dart diff --git a/making_school_asignment_app/lib/common/job/common/base_page.g.dart b/making_school_asignment_app/lib/common/job/common/base_page.g.dart new file mode 100644 index 0000000..cd5b0df --- /dev/null +++ b/making_school_asignment_app/lib/common/job/common/base_page.g.dart @@ -0,0 +1,17 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_page.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BasePage _$BasePageFromJson(Map json) => BasePage( + (json['PageNumber'] as num).toInt(), + (json['PageSize'] as num).toInt(), + ); + +Map _$BasePageToJson(BasePage instance) => { + 'PageNumber': instance.page, + 'PageSize': instance.limit, + }; diff --git a/lib/common/job/common/base_page_data.dart b/making_school_asignment_app/lib/common/job/common/base_page_data.dart similarity index 100% rename from lib/common/job/common/base_page_data.dart rename to making_school_asignment_app/lib/common/job/common/base_page_data.dart diff --git a/making_school_asignment_app/lib/common/job/common/base_page_data.g.dart b/making_school_asignment_app/lib/common/job/common/base_page_data.g.dart new file mode 100644 index 0000000..67dcca4 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/common/base_page_data.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_page_data.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BasePageData _$BasePageDataFromJson( + Map json, + T Function(Object? json) fromJsonT, +) => + BasePageData( + (json['items'] as List).map(fromJsonT).toList(), + (json['totalCount'] as num).toInt(), + ); + +Map _$BasePageDataToJson( + BasePageData instance, + Object? Function(T value) toJsonT, +) => + { + 'items': instance.items.map(toJsonT).toList(), + 'totalCount': instance.total, + }; diff --git a/lib/common/job/common/base_structure_result.dart b/making_school_asignment_app/lib/common/job/common/base_structure_result.dart similarity index 93% rename from lib/common/job/common/base_structure_result.dart rename to making_school_asignment_app/lib/common/job/common/base_structure_result.dart index a5bbd49..5cc8159 100644 --- a/lib/common/job/common/base_structure_result.dart +++ b/making_school_asignment_app/lib/common/job/common/base_structure_result.dart @@ -7,7 +7,7 @@ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ import 'package:json_annotation/json_annotation.dart'; -import 'package:school_asignment_app/common/config/request_config.dart'; +import 'package:making_school_asignment_app/common/config/request_config.dart'; part 'base_structure_result.g.dart'; diff --git a/making_school_asignment_app/lib/common/job/common/base_structure_result.g.dart b/making_school_asignment_app/lib/common/job/common/base_structure_result.g.dart new file mode 100644 index 0000000..48dd798 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/common/base_structure_result.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_structure_result.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseStructureResult _$BaseStructureResultFromJson( + Map json, + T Function(Object? json) fromJsonT, +) => + BaseStructureResult( + (json['code'] as num).toInt(), + json['message'] as String?, + _$nullableGenericFromJson(json['data'], fromJsonT), + success: json['success'] as bool? ?? false, + ); + +Map _$BaseStructureResultToJson( + BaseStructureResult instance, + Object? Function(T value) toJsonT, +) => + { + 'success': instance.success, + 'code': instance.code, + 'message': instance.message, + 'data': _$nullableGenericToJson(instance.data, toJsonT), + }; + +T? _$nullableGenericFromJson( + Object? input, + T Function(Object? json) fromJson, +) => + input == null ? null : fromJson(input); + +Object? _$nullableGenericToJson( + T? input, + Object? Function(T value) toJson, +) => + input == null ? null : toJson(input); diff --git a/lib/common/job/common/upload_img_secret_key.dart b/making_school_asignment_app/lib/common/job/common/upload_img_secret_key.dart similarity index 100% rename from lib/common/job/common/upload_img_secret_key.dart rename to making_school_asignment_app/lib/common/job/common/upload_img_secret_key.dart diff --git a/making_school_asignment_app/lib/common/job/common/upload_img_secret_key.g.dart b/making_school_asignment_app/lib/common/job/common/upload_img_secret_key.g.dart new file mode 100644 index 0000000..713830d --- /dev/null +++ b/making_school_asignment_app/lib/common/job/common/upload_img_secret_key.g.dart @@ -0,0 +1,45 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'upload_img_secret_key.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UploadImgSecretKey _$UploadImgSecretKeyFromJson(Map json) => + UploadImgSecretKey( + account: json['account'] as String?, + bucketName: json['bucketName'] as String?, + endPoint: (json['endPoint'] as num?)?.toInt(), + ip: json['ip'] as String?, + password: json['password'] as String?, + imgSecretKey: json['imgSecretKey'] as bool?, + annotationSwitch: json['annotationSwitch'] as bool? ?? false, + ); + +Map _$UploadImgSecretKeyToJson(UploadImgSecretKey instance) => + { + 'account': instance.account, + 'bucketName': instance.bucketName, + 'endPoint': instance.endPoint, + 'ip': instance.ip, + 'password': instance.password, + 'imgSecretKey': instance.imgSecretKey, + 'annotationSwitch': instance.annotationSwitch, + }; + +FileResult _$FileResultFromJson(Map json) => FileResult( + myObject: json['myObject'] as String, + url: json['url'] as String?, + success: json['success'] as bool? ?? false, + otherParam: json['otherParam'], + )..path = json['path'] as String?; + +Map _$FileResultToJson(FileResult instance) => + { + 'path': instance.path, + 'url': instance.url, + 'otherParam': instance.otherParam, + 'myObject': instance.myObject, + 'success': instance.success, + }; diff --git a/lib/common/job/enum_subject.dart b/making_school_asignment_app/lib/common/job/enum_subject.dart similarity index 100% rename from lib/common/job/enum_subject.dart rename to making_school_asignment_app/lib/common/job/enum_subject.dart diff --git a/making_school_asignment_app/lib/common/job/enum_subject.g.dart b/making_school_asignment_app/lib/common/job/enum_subject.g.dart new file mode 100644 index 0000000..f5d4e5c --- /dev/null +++ b/making_school_asignment_app/lib/common/job/enum_subject.g.dart @@ -0,0 +1,18 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'enum_subject.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +EnumSubject _$EnumSubjectFromJson(Map json) => EnumSubject( + (json['id'] as num).toInt(), + json['name'] as String, + ); + +Map _$EnumSubjectToJson(EnumSubject instance) => + { + 'id': instance.id, + 'name': instance.name, + }; diff --git a/lib/common/job/homework_details.dart b/making_school_asignment_app/lib/common/job/homework_details.dart similarity index 100% rename from lib/common/job/homework_details.dart rename to making_school_asignment_app/lib/common/job/homework_details.dart diff --git a/making_school_asignment_app/lib/common/job/homework_details.g.dart b/making_school_asignment_app/lib/common/job/homework_details.g.dart new file mode 100644 index 0000000..10cdd64 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/homework_details.g.dart @@ -0,0 +1,181 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'homework_details.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HomeworkDetails _$HomeworkDetailsFromJson(Map json) => + HomeworkDetails( + (json['questions'] as List) + .map((e) => Questions.fromJson(e as Map)) + .toList(), + (json['knows'] as List) + .map((e) => Knows.fromJson(e as Map)) + .toList(), + (json['students'] as List) + .map((e) => Students.fromJson(e as Map)) + .toList(), + (json['dtls'] as List) + .map((e) => Dtls.fromJson(e as Map)) + .toList(), + ); + +Map _$HomeworkDetailsToJson(HomeworkDetails instance) => + { + 'questions': instance.questions, + 'knows': instance.knows, + 'students': instance.students, + 'dtls': instance.dtls, + }; + +Questions _$QuestionsFromJson(Map json) => Questions( + json['id'] as String, + (json['templateId'] as num).toInt(), + (json['questionNo'] as num).toInt(), + (json['questionType'] as num).toInt(), + json['answer'] as String?, + (json['score'] as num?)?.toInt(), + json['questionPicture'] as String?, + json['subjectivePicture'] as String?, + (json['knows'] as List) + .map((e) => Knows.fromJson(e as Map)) + .toList(), + (json['answerCount'] as num?)?.toInt(), + (json['answerRate'] as num?)?.toDouble(), + (json['okRate'] as num?)?.toDouble(), + (json['priorityInfo'] as List?) + ?.map((e) => Dtls.fromJson(e as Map)) + .toList(), + (json['noAnswerStudents'] as List?) + ?.map((e) => Dtls.fromJson(e as Map)) + .toList(), + (json['answerOkStudents'] as List?) + ?.map((e) => Dtls.fromJson(e as Map)) + .toList(), + (json['answerNgStudents'] as List?) + ?.map((e) => Dtls.fromJson(e as Map)) + .toList(), + ); + +Map _$QuestionsToJson(Questions instance) => { + 'id': instance.id, + 'templateId': instance.templateId, + 'questionNo': instance.questionNo, + 'questionType': instance.questionType, + 'answer': instance.answer, + 'score': instance.score, + 'questionPicture': instance.questionPicture, + 'subjectivePicture': instance.subjectivePicture, + 'knows': instance.knows, + 'answerCount': instance.answerCount, + 'answerRate': instance.answerRate, + 'okRate': instance.okRate, + 'priorityInfo': instance.priorityInfo, + 'noAnswerStudents': instance.noAnswerStudents, + 'answerOkStudents': instance.answerOkStudents, + 'answerNgStudents': instance.answerNgStudents, + }; + +Knows _$KnowsFromJson(Map json) => Knows( + (json['knowledgeId'] as num).toInt(), + json['knowledgeName'] as String, + (json['okCount'] as num?)?.toInt(), + (json['ttlCount'] as num?)?.toInt(), + (json['okRate'] as num?)?.toDouble(), + (json['queDtls'] as List?) + ?.map((e) => Dtls.fromJson(e as Map)) + .toList(), + ); + +Map _$KnowsToJson(Knows instance) => { + 'knowledgeId': instance.knowledgeId, + 'knowledgeName': instance.knowledgeName, + 'okCount': instance.okCount, + 'ttlCount': instance.ttlCount, + 'okRate': instance.okRate, + 'queDtls': instance.queDtls, + }; + +Students _$StudentsFromJson(Map json) => Students( + (json['studentId'] as num).toInt(), + json['studentName'] as String, + (json['state'] as num).toInt(), + json['priorityAnnotate'] as bool?, + (json['kgtStu'] as List?) + ?.map((e) => Dtls.fromJson(e as Map)) + .toList(), + (json['kgtOkCount'] as num?)?.toInt(), + (json['kgtAnswerCount'] as num?)?.toInt(), + (json['zgtStu'] as List?) + ?.map((e) => Dtls.fromJson(e as Map)) + .toList(), + (json['zgtAnswerCount'] as num?)?.toInt(), + (json['zgtOkCount'] as num?)?.toInt(), + (json['allOk'] as num?)?.toInt(), + (json['kgtErrorCount'] as num?)?.toInt(), + (json['zgtErrorCount'] as num?)?.toInt(), + (json['zgtUnrated'] as num?)?.toInt(), + json['allNotDone'] as bool?, + (json['queDtls'] as List?) + ?.map((e) => Dtls.fromJson(e as Map)) + .toList(), + (json['okRate'] as num?)?.toDouble(), + (json['noAnswerCount'] as num?)?.toInt(), + (json['useTime'] as num?)?.toInt(), + ); + +Map _$StudentsToJson(Students instance) => { + 'studentId': instance.studentId, + 'studentName': instance.studentName, + 'state': instance.state, + 'priorityAnnotate': instance.priorityAnnotate, + 'kgtStu': instance.kgtStu, + 'kgtOkCount': instance.kgtOkCount, + 'kgtErrorCount': instance.kgtErrorCount, + 'kgtAnswerCount': instance.kgtAnswerCount, + 'zgtStu': instance.zgtStu, + 'zgtOkCount': instance.zgtOkCount, + 'zgtErrorCount': instance.zgtErrorCount, + 'zgtAnswerCount': instance.zgtAnswerCount, + 'zgtUnrated': instance.zgtUnrated, + 'allOk': instance.allOk, + 'allNotDone': instance.allNotDone, + 'queDtls': instance.queDtls, + 'okRate': instance.okRate, + 'noAnswerCount': instance.noAnswerCount, + 'useTime': instance.useTime, + }; + +Dtls _$DtlsFromJson(Map json) => Dtls( + json['id'] as String, + json['classId'] as String?, + (json['studentId'] as num).toInt(), + (json['templateId'] as num?)?.toInt(), + (json['questionNo'] as num).toInt(), + (json['questionType'] as num).toInt(), + json['studentAnswer'] as String?, + (json['state'] as num).toInt(), + (json['useTime'] as num).toInt(), + json['annotatePicture'] as String?, + json['studentName'] as String?, + json['answer'] as String?, + json['questionPicture'] as String?, + ); + +Map _$DtlsToJson(Dtls instance) => { + 'id': instance.id, + 'classId': instance.classId, + 'studentId': instance.studentId, + 'studentName': instance.studentName, + 'templateId': instance.templateId, + 'questionNo': instance.questionNo, + 'questionType': instance.questionType, + 'studentAnswer': instance.studentAnswer, + 'state': instance.state, + 'useTime': instance.useTime, + 'annotatePicture': instance.annotatePicture, + 'answer': instance.answer, + 'questionPicture': instance.questionPicture, + }; diff --git a/lib/common/job/knowledge_points_grasp.dart b/making_school_asignment_app/lib/common/job/knowledge_points_grasp.dart similarity index 100% rename from lib/common/job/knowledge_points_grasp.dart rename to making_school_asignment_app/lib/common/job/knowledge_points_grasp.dart diff --git a/making_school_asignment_app/lib/common/job/knowledge_points_grasp.g.dart b/making_school_asignment_app/lib/common/job/knowledge_points_grasp.g.dart new file mode 100644 index 0000000..106fd87 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/knowledge_points_grasp.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'knowledge_points_grasp.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +KnowledgePointsGrasp _$KnowledgePointsGraspFromJson( + Map json) => + KnowledgePointsGrasp( + (json['knowledgeId'] as num).toInt(), + json['knowledgeName'] as String, + (json['correctRate'] as num).toInt(), + (json['count'] as num).toInt(), + ); + +Map _$KnowledgePointsGraspToJson( + KnowledgePointsGrasp instance) => + { + 'knowledgeId': instance.knowledgeId, + 'knowledgeName': instance.knowledgeName, + 'correctRate': instance.correctRate, + 'count': instance.count, + }; diff --git a/lib/common/job/knowledge_report_detail.dart b/making_school_asignment_app/lib/common/job/knowledge_report_detail.dart similarity index 100% rename from lib/common/job/knowledge_report_detail.dart rename to making_school_asignment_app/lib/common/job/knowledge_report_detail.dart diff --git a/making_school_asignment_app/lib/common/job/knowledge_report_detail.g.dart b/making_school_asignment_app/lib/common/job/knowledge_report_detail.g.dart new file mode 100644 index 0000000..ece3a0d --- /dev/null +++ b/making_school_asignment_app/lib/common/job/knowledge_report_detail.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'knowledge_report_detail.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +KnowledgeReportDetail _$KnowledgeReportDetailFromJson( + Map json) => + KnowledgeReportDetail( + json['homeworkId'] as String, + json['homeworkName'] as String, + json['publishTime'] as String, + (json['templateId'] as num).toInt(), + (json['questionNo'] as num).toInt(), + (json['questionType'] as num).toInt(), + (json['correctRate'] as num).toInt(), + json['questionPicture'] as String?, + ); + +Map _$KnowledgeReportDetailToJson( + KnowledgeReportDetail instance) => + { + 'homeworkId': instance.homeworkId, + 'homeworkName': instance.homeworkName, + 'publishTime': instance.publishTime, + 'templateId': instance.templateId, + 'questionNo': instance.questionNo, + 'questionType': instance.questionType, + 'questionPicture': instance.questionPicture, + 'correctRate': instance.correctRate, + }; diff --git a/lib/common/job/student_history.dart b/making_school_asignment_app/lib/common/job/student_history.dart similarity index 100% rename from lib/common/job/student_history.dart rename to making_school_asignment_app/lib/common/job/student_history.dart diff --git a/making_school_asignment_app/lib/common/job/student_history.g.dart b/making_school_asignment_app/lib/common/job/student_history.g.dart new file mode 100644 index 0000000..e0466bc --- /dev/null +++ b/making_school_asignment_app/lib/common/job/student_history.g.dart @@ -0,0 +1,108 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'student_history.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +StudentHistory _$StudentHistoryFromJson(Map json) => + StudentHistory( + (json['kgtCorrectRate'] as num).toInt(), + (json['zgtCorrectRate'] as num).toInt(), + Items.fromJson(json['items'] as Map), + (json['correctRate'] as num).toInt(), + ); + +Map _$StudentHistoryToJson(StudentHistory instance) => + { + 'kgtCorrectRate': instance.kgtCorrectRate, + 'zgtCorrectRate': instance.zgtCorrectRate, + 'items': instance.items, + 'correctRate': instance.correctRate, + }; + +Items _$ItemsFromJson(Map json) => Items( + (json['items'] as List) + .map((e) => StudentItems.fromJson(e as Map)) + .toList(), + (json['totalCount'] as num).toInt(), + ); + +Map _$ItemsToJson(Items instance) => { + 'items': instance.items, + 'totalCount': instance.totalCount, + }; + +StudentItems _$StudentItemsFromJson(Map json) => StudentItems( + json['id'] as String, + (json['assessType'] as num).toInt(), + json['name'] as String, + (json['grade'] as num).toInt(), + (json['subject'] as num).toInt(), + json['publishTime'] as String, + (json['state'] as num).toInt(), + (json['kgtCorrectRate'] as num).toInt(), + (json['kgtList'] as List) + .map((e) => KgtList.fromJson(e as Map)) + .toList(), + (json['zgtCorrectRate'] as num).toInt(), + (json['zgtList'] as List) + .map((e) => ZgtList.fromJson(e as Map)) + .toList(), + (json['correctRate'] as num).toInt(), + json['allNotDone'] as bool? ?? false, + ); + +Map _$StudentItemsToJson(StudentItems instance) => + { + 'id': instance.id, + 'assessType': instance.assessType, + 'name': instance.name, + 'grade': instance.grade, + 'subject': instance.subject, + 'publishTime': instance.publishTime, + 'state': instance.state, + 'kgtCorrectRate': instance.kgtCorrectRate, + 'kgtList': instance.kgtList, + 'zgtCorrectRate': instance.zgtCorrectRate, + 'zgtList': instance.zgtList, + 'correctRate': instance.correctRate, + 'allNotDone': instance.allNotDone, + }; + +KgtList _$KgtListFromJson(Map json) => KgtList( + json['id'] as String, + (json['questionNo'] as num).toInt(), + (json['questionType'] as num).toInt(), + (json['state'] as num).toInt(), + (json['useTime'] as num?)?.toInt(), + json['picture'] as String?, + ); + +Map _$KgtListToJson(KgtList instance) => { + 'id': instance.id, + 'questionNo': instance.questionNo, + 'questionType': instance.questionType, + 'state': instance.state, + 'useTime': instance.useTime, + 'picture': instance.picture, + }; + +ZgtList _$ZgtListFromJson(Map json) => ZgtList( + json['id'] as String, + (json['questionNo'] as num).toInt(), + (json['questionType'] as num).toInt(), + (json['state'] as num).toInt(), + (json['useTime'] as num?)?.toInt(), + json['picture'] as String?, + ); + +Map _$ZgtListToJson(ZgtList instance) => { + 'id': instance.id, + 'questionNo': instance.questionNo, + 'questionType': instance.questionType, + 'state': instance.state, + 'useTime': instance.useTime, + 'picture': instance.picture, + }; diff --git a/lib/common/job/student_history_params.dart b/making_school_asignment_app/lib/common/job/student_history_params.dart similarity index 100% rename from lib/common/job/student_history_params.dart rename to making_school_asignment_app/lib/common/job/student_history_params.dart diff --git a/making_school_asignment_app/lib/common/job/student_history_params.g.dart b/making_school_asignment_app/lib/common/job/student_history_params.g.dart new file mode 100644 index 0000000..f79050d --- /dev/null +++ b/making_school_asignment_app/lib/common/job/student_history_params.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'student_history_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +StudentHistoryParams _$StudentHistoryParamsFromJson( + Map json) => + StudentHistoryParams( + subject: (json['Subject'] as num?)?.toInt(), + studentId: (json['StudentId'] as num?)?.toInt() ?? -1, + dateStart: json['DateStart'] as String? ?? '', + dateEnd: json['DateEnd'] as String?, + assessType: (json['AssessType'] as num?)?.toInt() ?? 0, + pageNumber: (json['PageNumber'] as num?)?.toInt() ?? 1, + pageSize: (json['PageSize'] as num?)?.toInt() ?? 10, + ); + +Map _$StudentHistoryParamsToJson( + StudentHistoryParams instance) => + { + 'Subject': instance.subject, + 'StudentId': instance.studentId, + 'DateStart': instance.dateStart, + 'DateEnd': instance.dateEnd, + 'AssessType': instance.assessType, + 'PageNumber': instance.pageNumber, + 'PageSize': instance.pageSize, + }; diff --git a/lib/common/job/student_item.dart b/making_school_asignment_app/lib/common/job/student_item.dart similarity index 100% rename from lib/common/job/student_item.dart rename to making_school_asignment_app/lib/common/job/student_item.dart diff --git a/making_school_asignment_app/lib/common/job/student_item.g.dart b/making_school_asignment_app/lib/common/job/student_item.g.dart new file mode 100644 index 0000000..7fb6926 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/student_item.g.dart @@ -0,0 +1,22 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'student_item.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +StudentItem _$StudentItemFromJson(Map json) => StudentItem( + json['name'] as String, + json['isActive'] as bool, + json['priorityAnnotate'] as bool, + (json['id'] as num).toInt(), + ); + +Map _$StudentItemToJson(StudentItem instance) => + { + 'name': instance.name, + 'isActive': instance.isActive, + 'priorityAnnotate': instance.priorityAnnotate, + 'id': instance.id, + }; diff --git a/lib/common/job/student_personal_info.dart b/making_school_asignment_app/lib/common/job/student_personal_info.dart similarity index 100% rename from lib/common/job/student_personal_info.dart rename to making_school_asignment_app/lib/common/job/student_personal_info.dart diff --git a/making_school_asignment_app/lib/common/job/student_personal_info.g.dart b/making_school_asignment_app/lib/common/job/student_personal_info.g.dart new file mode 100644 index 0000000..8101333 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/student_personal_info.g.dart @@ -0,0 +1,74 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'student_personal_info.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +StudentPersonalInfo _$StudentPersonalInfoFromJson(Map json) => + StudentPersonalInfo( + (json['studentId'] as num).toInt(), + json['studentName'] as String, + (json['correctRate'] as num).toInt(), + (json['kgtCorrectRate'] as num).toInt(), + (json['kgtList'] as List) + .map((e) => KgtList.fromJson(e as Map)) + .toList(), + (json['zgtCorrectRate'] as num).toInt(), + (json['zgtList'] as List) + .map((e) => ZgtList.fromJson(e as Map)) + .toList(), + ); + +Map _$StudentPersonalInfoToJson( + StudentPersonalInfo instance) => + { + 'studentId': instance.studentId, + 'studentName': instance.studentName, + 'correctRate': instance.correctRate, + 'kgtCorrectRate': instance.kgtCorrectRate, + 'kgtList': instance.kgtList, + 'zgtCorrectRate': instance.zgtCorrectRate, + 'zgtList': instance.zgtList, + }; + +KgtList _$KgtListFromJson(Map json) => KgtList( + (json['templateId'] as num).toInt(), + (json['questionNo'] as num).toInt(), + json['answer'] as String?, + json['studentAnswer'] as String?, + (json['useTime'] as num).toInt(), + json['isCorrect'] as bool?, + json['picture'] as String?, + ); + +Map _$KgtListToJson(KgtList instance) => { + 'templateId': instance.templateId, + 'questionNo': instance.questionNo, + 'answer': instance.answer, + 'studentAnswer': instance.studentAnswer, + 'useTime': instance.useTime, + 'isCorrect': instance.isCorrect, + 'picture': instance.picture, + }; + +ZgtList _$ZgtListFromJson(Map json) => ZgtList( + (json['templateId'] as num).toInt(), + (json['questionNo'] as num).toInt(), + json['answer'] as String?, + json['studentAnswer'] as String?, + (json['useTime'] as num).toInt(), + json['isCorrect'] as bool?, + json['picture'] as String?, + ); + +Map _$ZgtListToJson(ZgtList instance) => { + 'templateId': instance.templateId, + 'questionNo': instance.questionNo, + 'answer': instance.answer, + 'studentAnswer': instance.studentAnswer, + 'useTime': instance.useTime, + 'isCorrect': instance.isCorrect, + 'picture': instance.picture, + }; diff --git a/lib/common/job/user_info.dart b/making_school_asignment_app/lib/common/job/user_info.dart similarity index 100% rename from lib/common/job/user_info.dart rename to making_school_asignment_app/lib/common/job/user_info.dart diff --git a/making_school_asignment_app/lib/common/job/user_info.g.dart b/making_school_asignment_app/lib/common/job/user_info.g.dart new file mode 100644 index 0000000..676ce33 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/user_info.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_info.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UserInfo _$UserInfoFromJson(Map json) => UserInfo( + json['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier'] + as String, + json['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname'] + as String, + json['is_admin'] as String, + json['term_year'] as String, + (json['nbf'] as num).toInt(), + (json['exp'] as num).toInt(), + json['iss'] as String, + json['aud'] as String, + ); + +Map _$UserInfoToJson(UserInfo instance) => { + 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier': + instance.nameidentifier, + 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname': + instance.givenname, + 'is_admin': instance.isAdmin, + 'term_year': instance.termYear, + 'nbf': instance.nbf, + 'exp': instance.exp, + 'iss': instance.iss, + 'aud': instance.aud, + }; diff --git a/lib/common/job/user_info_detail.dart b/making_school_asignment_app/lib/common/job/user_info_detail.dart similarity index 100% rename from lib/common/job/user_info_detail.dart rename to making_school_asignment_app/lib/common/job/user_info_detail.dart diff --git a/making_school_asignment_app/lib/common/job/user_info_detail.g.dart b/making_school_asignment_app/lib/common/job/user_info_detail.g.dart new file mode 100644 index 0000000..8a27e19 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/user_info_detail.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_info_detail.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UserInfoDetail _$UserInfoDetailFromJson(Map json) => + UserInfoDetail( + json['account'] as String, + json['name'] as String, + (json['gender'] as num?)?.toInt(), + json['schoolId'] as String?, + json['schoolName'] as String, + json['lastLoginTime'] as String?, + json['isActive'] as bool?, + (json['accessFailedCount'] as num?)?.toInt(), + json['lockoutEndDate'] as String?, + json['creatorName'] as String?, + json['creationTime'] as String?, + (json['id'] as num).toInt(), + ); + +Map _$UserInfoDetailToJson(UserInfoDetail instance) => + { + 'account': instance.account, + 'name': instance.name, + 'gender': instance.gender, + 'schoolId': instance.schoolId, + 'schoolName': instance.schoolName, + 'lastLoginTime': instance.lastLoginTime, + 'isActive': instance.isActive, + 'accessFailedCount': instance.accessFailedCount, + 'lockoutEndDate': instance.lockoutEndDate, + 'creatorName': instance.creatorName, + 'creationTime': instance.creationTime, + 'id': instance.id, + }; diff --git a/lib/common/job/user_login.dart b/making_school_asignment_app/lib/common/job/user_login.dart similarity index 100% rename from lib/common/job/user_login.dart rename to making_school_asignment_app/lib/common/job/user_login.dart diff --git a/making_school_asignment_app/lib/common/job/user_login.g.dart b/making_school_asignment_app/lib/common/job/user_login.g.dart new file mode 100644 index 0000000..d9096eb --- /dev/null +++ b/making_school_asignment_app/lib/common/job/user_login.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_login.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UserLogin _$UserLoginFromJson(Map json) => $checkedCreate( + 'UserLogin', + json, + ($checkedConvert) { + final val = UserLogin( + $checkedConvert('access_token', (v) => v as String), + $checkedConvert('expires_in', (v) => (v as num).toInt()), + $checkedConvert('token_type', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'accessToken': 'access_token', + 'expiresIn': 'expires_in', + 'tokenType': 'token_type' + }, + ); + +Map _$UserLoginToJson(UserLogin instance) => { + 'access_token': instance.accessToken, + 'expires_in': instance.expiresIn, + 'token_type': instance.tokenType, + }; diff --git a/lib/common/job/work_student.dart b/making_school_asignment_app/lib/common/job/work_student.dart similarity index 100% rename from lib/common/job/work_student.dart rename to making_school_asignment_app/lib/common/job/work_student.dart diff --git a/making_school_asignment_app/lib/common/job/work_student.g.dart b/making_school_asignment_app/lib/common/job/work_student.g.dart new file mode 100644 index 0000000..d3dfb57 --- /dev/null +++ b/making_school_asignment_app/lib/common/job/work_student.g.dart @@ -0,0 +1,75 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'work_student.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +WorkStudent _$WorkStudentFromJson(Map json) => WorkStudent( + (json['items'] as List) + .map((e) => Items.fromJson(e as Map)) + .toList(), + (json['totalCount'] as num).toInt(), + ); + +Map _$WorkStudentToJson(WorkStudent instance) => + { + 'items': instance.items, + 'totalCount': instance.totalCount, + }; + +Items _$ItemsFromJson(Map json) => Items( + json['id'] as String, + (json['assessType'] as num).toInt(), + json['name'] as String, + (json['grade'] as num).toInt(), + (json['subject'] as num).toInt(), + json['publishTime'] as String, + (json['state'] as num?)?.toInt(), + (json['collectRate'] as num?)?.toInt(), + (json['questionCount'] as num?)?.toInt(), + (json['annotateCount'] as num?)?.toInt(), + (json['annotateRate'] as num?)?.toDouble(), + (json['classes'] as List?) + ?.map((e) => Classes.fromJson(e as Map)) + .toList(), + json['creatorName'] as String?, + json['creationTime'] as String?, + (json['classCount'] as num?)?.toInt(), + )..isFixed = json['isFixed'] as bool?; + +Map _$ItemsToJson(Items instance) => { + 'id': instance.id, + 'assessType': instance.assessType, + 'name': instance.name, + 'grade': instance.grade, + 'subject': instance.subject, + 'publishTime': instance.publishTime, + 'state': instance.state, + 'collectRate': instance.collectRate, + 'questionCount': instance.questionCount, + 'annotateCount': instance.annotateCount, + 'annotateRate': instance.annotateRate, + 'classes': instance.classes, + 'creatorName': instance.creatorName, + 'creationTime': instance.creationTime, + 'classCount': instance.classCount, + 'isFixed': instance.isFixed, + }; + +Classes _$ClassesFromJson(Map json) => Classes( + json['schoolId'] as String, + json['schoolName'] as String, + json['classId'] as String, + json['className'] as String, + json['finishTime'] as String?, + ); + +Map _$ClassesToJson(Classes instance) => { + 'schoolId': instance.schoolId, + 'schoolName': instance.schoolName, + 'classId': instance.classId, + 'className': instance.className, + 'finishTime': instance.finishTime, + }; diff --git a/lib/common/job/work_student_params.dart b/making_school_asignment_app/lib/common/job/work_student_params.dart similarity index 100% rename from lib/common/job/work_student_params.dart rename to making_school_asignment_app/lib/common/job/work_student_params.dart diff --git a/making_school_asignment_app/lib/common/job/work_student_params.g.dart b/making_school_asignment_app/lib/common/job/work_student_params.g.dart new file mode 100644 index 0000000..25bc35f --- /dev/null +++ b/making_school_asignment_app/lib/common/job/work_student_params.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'work_student_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +WorkStudentParams _$WorkStudentParamsFromJson(Map json) => + WorkStudentParams( + assessType: (json['AssessType'] as num?)?.toInt() ?? 0, + name: json['Name'] as String?, + grade: (json['Grade'] as num?)?.toInt(), + subject: (json['Subject'] as num?)?.toInt(), + state: (json['State'] as num?)?.toInt(), + startDate: json['StartDate'] as String?, + endDate: json['EndDate'] as String?, + creatorId: json['CreatorId'] as String?, + pageNumber: (json['PageNumber'] as num?)?.toInt() ?? 1, + pageSize: (json['PageSize'] as num?)?.toInt() ?? 10, + sorting: json['Sorting'] as String?, + ); + +Map _$WorkStudentParamsToJson(WorkStudentParams instance) => + { + 'AssessType': instance.assessType, + 'Name': instance.name, + 'Grade': instance.grade, + 'Subject': instance.subject, + 'State': instance.state, + 'StartDate': instance.startDate, + 'EndDate': instance.endDate, + 'CreatorId': instance.creatorId, + 'PageNumber': instance.pageNumber, + 'PageSize': instance.pageSize, + 'Sorting': instance.sorting, + }; diff --git a/making_school_asignment_app/lib/common/mixins/request_tool_mixin.dart b/making_school_asignment_app/lib/common/mixins/request_tool_mixin.dart new file mode 100644 index 0000000..7bb13e9 --- /dev/null +++ b/making_school_asignment_app/lib/common/mixins/request_tool_mixin.dart @@ -0,0 +1,6 @@ +import 'package:making_school_asignment_app/common/request/rest_dio.dart'; +import 'package:making_school_asignment_app/common/api/retrofit_client.dart'; + +mixin RequestToolMixin { + RetrofitClient getClient() => RequestTool.instance.getClient(); +} diff --git a/lib/common/request/rest_dio.dart b/making_school_asignment_app/lib/common/request/rest_dio.dart similarity index 92% rename from lib/common/request/rest_dio.dart rename to making_school_asignment_app/lib/common/request/rest_dio.dart index 36fcb60..629b7cc 100644 --- a/lib/common/request/rest_dio.dart +++ b/making_school_asignment_app/lib/common/request/rest_dio.dart @@ -2,13 +2,13 @@ import 'dart:convert'; import 'dart:io'; import 'package:get/get.dart' as getx; import 'package:dio/dio.dart'; -import 'package:package_info/package_info.dart'; -import 'package:school_asignment_app/common/api/retrofit_client.dart'; -import 'package:school_asignment_app/common/config/request_config.dart'; -import 'package:school_asignment_app/common/job/user_info.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; -import 'package:school_asignment_app/common/utils/toast_utils.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:making_school_asignment_app/common/api/retrofit_client.dart'; +import 'package:making_school_asignment_app/common/config/request_config.dart'; +import 'package:making_school_asignment_app/common/job/user_info.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/common/utils/toast_utils.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; class RequestTool { // 初始化请求配置 @@ -29,6 +29,7 @@ class RequestTool { return RetrofitClient(dio, baseUrl: RequestConfig().baseUrl); } + final RetrofitClient _client; static RequestTool? _instance; diff --git a/lib/common/store/app_storage_key.dart b/making_school_asignment_app/lib/common/store/app_storage_key.dart similarity index 100% rename from lib/common/store/app_storage_key.dart rename to making_school_asignment_app/lib/common/store/app_storage_key.dart diff --git a/lib/common/store/user_store.dart b/making_school_asignment_app/lib/common/store/user_store.dart similarity index 83% rename from lib/common/store/user_store.dart rename to making_school_asignment_app/lib/common/store/user_store.dart index 451d009..f422a5f 100644 --- a/lib/common/store/user_store.dart +++ b/making_school_asignment_app/lib/common/store/user_store.dart @@ -1,13 +1,13 @@ import 'dart:convert'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/enum_subject.dart'; -import 'package:school_asignment_app/common/job/user_info.dart'; -import 'package:school_asignment_app/common/job/user_info_detail.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/common/utils/storage.dart'; -import 'package:school_asignment_app/common/store/app_storage_key.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/job/enum_subject.dart'; +import 'package:making_school_asignment_app/common/job/user_info.dart'; +import 'package:making_school_asignment_app/common/job/user_info_detail.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/utils/storage.dart'; +import 'package:making_school_asignment_app/common/store/app_storage_key.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; class UserStore extends GetxController with RequestToolMixin { static UserStore get to => Get.find(); @@ -61,8 +61,8 @@ class UserStore extends GetxController with RequestToolMixin { return this; } - void getEnum() async{ - await getGradeList(); + void getEnum() async { + await getGradeList(); } /// 保存 token @@ -99,18 +99,15 @@ class UserStore extends GetxController with RequestToolMixin { //获取科目 getSubjectList() async { // var res = await getClient().getEnumSubjectList(); - } //获取年级 getGradeList() async { - - var res = await getClient().getEnumSubjectList(['EnumGrade','EnumSubject']); + var res = await getClient().getEnumSubjectList(['EnumGrade', 'EnumSubject']); gradeList.value = res['EnumGrade']!; subjectList.value = res['EnumSubject']!; } - // 用户信息更新 updateUserInfo() async { UserInfo? userInfo = UserStore.to.userInfo.value; diff --git a/lib/common/the_global.dart b/making_school_asignment_app/lib/common/the_global.dart similarity index 100% rename from lib/common/the_global.dart rename to making_school_asignment_app/lib/common/the_global.dart diff --git a/lib/common/utils/enum_untils.dart b/making_school_asignment_app/lib/common/utils/enum_untils.dart similarity index 74% rename from lib/common/utils/enum_untils.dart rename to making_school_asignment_app/lib/common/utils/enum_untils.dart index ff01799..106832b 100644 --- a/lib/common/utils/enum_untils.dart +++ b/making_school_asignment_app/lib/common/utils/enum_untils.dart @@ -1,7 +1,7 @@ -import 'package:school_asignment_app/common/job/enum_subject.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/common/job/enum_subject.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; -class EnumUtils{ +class EnumUtils { static String formatSubject(int id) { if (UserStore.to.subjectList.isEmpty || id == null) { return ''; @@ -17,4 +17,4 @@ class EnumUtils{ EnumSubject item = UserStore.to.gradeList.firstWhere((element) => element.id == id); return item.name ?? ''; } -} \ No newline at end of file +} diff --git a/lib/common/utils/storage.dart b/making_school_asignment_app/lib/common/utils/storage.dart similarity index 100% rename from lib/common/utils/storage.dart rename to making_school_asignment_app/lib/common/utils/storage.dart diff --git a/lib/common/utils/toast_utils.dart b/making_school_asignment_app/lib/common/utils/toast_utils.dart similarity index 100% rename from lib/common/utils/toast_utils.dart rename to making_school_asignment_app/lib/common/utils/toast_utils.dart diff --git a/lib/common/utils/utils.dart b/making_school_asignment_app/lib/common/utils/utils.dart similarity index 77% rename from lib/common/utils/utils.dart rename to making_school_asignment_app/lib/common/utils/utils.dart index 5e4d237..8a098bb 100644 --- a/lib/common/utils/utils.dart +++ b/making_school_asignment_app/lib/common/utils/utils.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_state.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_state.dart'; -class Utils{ +class Utils { Utils._internal(); /// 关闭键盘 @@ -44,14 +44,13 @@ class Utils{ return val.toStringAsFixed(fractionDigits).replaceAll(RegExp(r'\.0*$'), ''); } - static calcRate (int divisor, int dividend) { - if(dividend != 0){ + static calcRate(int divisor, int dividend) { + if (dividend != 0) { return ((100 * divisor) / dividend); // return ((100 * divisor) / dividend).toStringAsFixed(0); - }else{ + } else { return 0.0; } - } /// 秒转时分秒 @@ -62,12 +61,12 @@ class Utils{ int h = sec ~/ 3600; int m = (sec % 3600) ~/ 60; int s = sec % 60; - if(h>0){ + if (h > 0) { hms = "$h时$m分$s秒"; - }else{ - if(m>0){ + } else { + if (m > 0) { hms = "$m分$s秒"; - }else{ + } else { hms = "$s秒"; } } @@ -75,58 +74,57 @@ class Utils{ return hms; } - static getHomeworkData(HomeworkDetails data){ - + static getHomeworkData(HomeworkDetails data) { CountData dataCount = CountData(); List kgt = data.dtls.where((w) => w.questionType == 1).toList(); dataCount.kgtAnswerCount = kgt.where((w) => w.state != 0).length; dataCount.kgtOkCount = kgt.where((w) => w.state == 3).length; dataCount.kgtDtlCount = kgt.length; - dataCount.kgtAnswerRate = Utils.calcRate(dataCount.kgtAnswerCount!, dataCount.kgtDtlCount!); - dataCount.kgtOkRate = Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtDtlCount!); + dataCount.kgtAnswerRate = Utils.calcRate(dataCount.kgtAnswerCount!, dataCount.kgtDtlCount!); + dataCount.kgtOkRate = Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtDtlCount!); dataCount.kgtCount = data.questions.where((w) => w.questionType == 1).length; List zgt = data.dtls.where((w) => w.questionType == 2).toList(); dataCount.zgtAnswerCount = zgt.where((w) => w.state != 0).length; dataCount.zgtOkCount = zgt.where((w) => w.state == 3).length; dataCount.zgtDtlCount = zgt.length; - dataCount.zgtAnswerRate = Utils.calcRate(dataCount.zgtAnswerCount!, dataCount.zgtDtlCount!); - dataCount.zgtOkRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtDtlCount!); + dataCount.zgtAnswerRate = Utils.calcRate(dataCount.zgtAnswerCount!, dataCount.zgtDtlCount!); + dataCount.zgtOkRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtDtlCount!); dataCount.zgtCount = data.questions.where((w) => w.questionType == 2).length; dataCount.studentCount = data.students.length; dataCount.priorityStudents = data.students.where((w) => w.priorityAnnotate!).toList(); - - for(var que in data.questions){ + for (var que in data.questions) { List ques = data.dtls.where((w) => w.templateId == que.templateId && w.questionNo == que.questionNo).toList(); que.answerCount = ques.where((w) => w.state != 0).length; que.answerRate = Utils.calcRate(que.answerCount!, dataCount.studentCount!); int okCount = ques.where((w) => w.state == 3).length; - que.okRate = Utils.calcRate(okCount, dataCount.studentCount!) ; + que.okRate = Utils.calcRate(okCount, dataCount.studentCount!); que.priorityInfo = ques.where((w) { return dataCount.priorityStudents!.indexWhere((s) { - w.studentName = s.studentName; - return s.studentId == w.studentId; - }) > -1 && w.state != 3; + w.studentName = s.studentName; + return s.studentId == w.studentId; + }) > + -1 && + w.state != 3; }).toList(); que.answerNgStudents = ques.where((w) { - w.studentName = data.students.firstWhere((s) => s.studentId == w.studentId).studentName; + w.studentName = data.students.firstWhere((s) => s.studentId == w.studentId).studentName; return w.state == 2; }).toList(); que.noAnswerStudents = ques.where((w) { - return w.state == 0; + return w.state == 0; }).toList(); que.answerOkStudents = ques.where((w) { return w.state == 3; }).toList(); - } dataCount.studentSubmitCount = data.students.where((s) => s.state != 0).length; - for(var stu in data.students){ + for (var stu in data.students) { stu.kgtStu = kgt.where((w) => w.studentId == stu.studentId).toList(); stu.kgtStu!.sort((a, b) => a.questionNo.compareTo(b.questionNo)); stu.kgtOkCount = stu.kgtStu!.where((w) => w.state == 3).length; @@ -140,30 +138,32 @@ class Utils{ stu.zgtUnrated = stu.zgtStu!.where((w) => w.state == 1).length; stu.zgtAnswerCount = stu.zgtStu!.where((w) => w.state != 0).length; stu.allOk = data.dtls.where((w) { - if(stu.studentId == w.studentId){ - stu.useTime = w.useTime; - } - for(var que in data.questions){ - if(w.templateId == que.templateId && w.questionNo == que.questionNo){ - w.answer = que.answer; - w.questionPicture = que.questionPicture; - } - } - return w.studentId == stu.studentId && w.state != 3; - } ).length??0; - if( (stu.kgtStu!.length - stu.kgtAnswerCount!) + (stu.zgtStu!.length-stu.zgtAnswerCount!) == (stu.kgtStu!.length + stu.zgtStu!.length)){ + if (stu.studentId == w.studentId) { + stu.useTime = w.useTime; + } + for (var que in data.questions) { + if (w.templateId == que.templateId && w.questionNo == que.questionNo) { + w.answer = que.answer; + w.questionPicture = que.questionPicture; + } + } + return w.studentId == stu.studentId && w.state != 3; + }).length ?? + 0; + if ((stu.kgtStu!.length - stu.kgtAnswerCount!) + (stu.zgtStu!.length - stu.zgtAnswerCount!) == (stu.kgtStu!.length + stu.zgtStu!.length)) { stu.allNotDone = true; - }else{ + } else { stu.allNotDone = false; } - stu.noAnswerCount = data.dtls.where((w) => w.state == 0 && stu.studentId == w.studentId).length; + stu.noAnswerCount = data.dtls.where((w) => w.state == 0 && stu.studentId == w.studentId).length; List ques = data.questions; - stu.queDtls =data.dtls.where((w) => w.studentId == stu.studentId && ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1).toList(); + stu.queDtls = data.dtls + .where((w) => w.studentId == stu.studentId && ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1) + .toList(); int okCount = stu.queDtls!.where((w) => w.state == 3).length; int ttlCount = stu.queDtls!.length; stu.okRate = Utils.calcRate(okCount, ttlCount); - } data.students.sort((a, b) { @@ -172,7 +172,7 @@ class Utils{ return num2.compareTo(num1); }); - for(var know in data.knows){ + for (var know in data.knows) { List ques = data.questions.where((w) => w.knows.indexWhere((k) => k.knowledgeId == know.knowledgeId) > -1).toList(); List queDtls = data.dtls.where((w) => ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1).toList(); know.okCount = queDtls.where((w) => w.state == 3).length; @@ -202,4 +202,4 @@ class Utils{ } return now.add(Duration(days: diff)); // 加上天数差减一,得到本周日的时间 } -} \ No newline at end of file +} diff --git a/lib/main.dart b/making_school_asignment_app/lib/main.dart similarity index 88% rename from lib/main.dart rename to making_school_asignment_app/lib/main.dart index e6cad94..00686a7 100644 --- a/lib/main.dart +++ b/making_school_asignment_app/lib/main.dart @@ -3,12 +3,12 @@ import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/config/app_config.dart'; -import 'package:school_asignment_app/common/config/colorUtils.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; -import 'package:school_asignment_app/common/utils/storage.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/config/app_config.dart'; +import 'package:making_school_asignment_app/common/config/colorUtils.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/common/utils/storage.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; void main() async { @@ -73,6 +73,7 @@ class MyApp extends StatelessWidget { defaultTransition: Transition.fade, //初始化路由页面 initialRoute: Routes.startPage, + /// 路由表 getPages: AppPages.pages, builder: EasyLoading.init( diff --git a/lib/page/global_widget/MyEmptyWidget.dart b/making_school_asignment_app/lib/page/global_widget/MyEmptyWidget.dart similarity index 100% rename from lib/page/global_widget/MyEmptyWidget.dart rename to making_school_asignment_app/lib/page/global_widget/MyEmptyWidget.dart diff --git a/lib/page/global_widget/ReturnToHomepage.dart b/making_school_asignment_app/lib/page/global_widget/ReturnToHomepage.dart similarity index 78% rename from lib/page/global_widget/ReturnToHomepage.dart rename to making_school_asignment_app/lib/page/global_widget/ReturnToHomepage.dart index bbc065f..5460ce8 100644 --- a/lib/page/global_widget/ReturnToHomepage.dart +++ b/making_school_asignment_app/lib/page/global_widget/ReturnToHomepage.dart @@ -1,17 +1,17 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; // 返回首页 class ReturnToHomepage extends StatelessWidget { final Color? bgColor; - const ReturnToHomepage({super.key,this.bgColor = const Color.fromRGBO(135, 135, 135, 1)}); + const ReturnToHomepage({super.key, this.bgColor = const Color.fromRGBO(135, 135, 135, 1)}); @override Widget build(BuildContext context) { return InkWell( - onTap: (){ + onTap: () { // Navigator.of(context).popUntil(ModalRoute.withName(Routes.startPage)); Get.until((route) => route.settings.name == Routes.startPage); }, diff --git a/lib/page/global_widget/bottom_navigation_bar.dart b/making_school_asignment_app/lib/page/global_widget/bottom_navigation_bar.dart similarity index 85% rename from lib/page/global_widget/bottom_navigation_bar.dart rename to making_school_asignment_app/lib/page/global_widget/bottom_navigation_bar.dart index af49ca9..4a5c1be 100644 --- a/lib/page/global_widget/bottom_navigation_bar.dart +++ b/making_school_asignment_app/lib/page/global_widget/bottom_navigation_bar.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; const _items = [ { @@ -41,7 +41,7 @@ class MyBottomNavigationBar extends StatelessWidget { height: 50.r, margin: EdgeInsets.only(bottom: Get.mediaQuery.padding.bottom), decoration: const BoxDecoration( - color:Colors.white, + color: Colors.white, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -51,7 +51,7 @@ class MyBottomNavigationBar extends StatelessWidget { if (active == e['id']) { return; } - Get.offAllNamed(e['route'] as String,arguments: e['id']); + Get.offAllNamed(e['route'] as String, arguments: e['id']); }, child: Container( width: 60.r, @@ -73,8 +73,9 @@ class MyBottomNavigationBar extends StatelessWidget { Text( e['title'] as String, style: TextStyle( - color: active == (e['id'] as int) ? const Color(0xFF6888FD) : const Color(0xFF767676), - fontSize: 11.sp,), + color: active == (e['id'] as int) ? const Color(0xFF6888FD) : const Color(0xFF767676), + fontSize: 11.sp, + ), strutStyle: StrutStyle(fontSize: 16.sp), ) ], diff --git a/lib/page/global_widget/global_scaffold.dart b/making_school_asignment_app/lib/page/global_widget/global_scaffold.dart similarity index 86% rename from lib/page/global_widget/global_scaffold.dart rename to making_school_asignment_app/lib/page/global_widget/global_scaffold.dart index 458838b..27fc7b4 100644 --- a/lib/page/global_widget/global_scaffold.dart +++ b/making_school_asignment_app/lib/page/global_widget/global_scaffold.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/utils/toast_utils.dart'; -import 'package:school_asignment_app/page/global_widget/bottom_navigation_bar.dart'; +import 'package:making_school_asignment_app/common/utils/toast_utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/bottom_navigation_bar.dart'; class GlobalScaffold extends StatelessWidget { final AppBar? appBar; diff --git a/lib/page/global_widget/imgDialog.dart b/making_school_asignment_app/lib/page/global_widget/imgDialog.dart similarity index 68% rename from lib/page/global_widget/imgDialog.dart rename to making_school_asignment_app/lib/page/global_widget/imgDialog.dart index 0464844..52f68e7 100644 --- a/lib/page/global_widget/imgDialog.dart +++ b/making_school_asignment_app/lib/page/global_widget/imgDialog.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:school_asignment_app/common/config/request_config.dart'; +import 'package:making_school_asignment_app/common/config/request_config.dart'; -class ImageDialog{ - static void showImgDialog(BuildContext context,String imgUrl) { +class ImageDialog { + static void showImgDialog(BuildContext context, String imgUrl) { showDialog( context: context, builder: (BuildContext context) { @@ -11,16 +11,15 @@ class ImageDialog{ // insetPadding: EdgeInsets.symmetric(vertical: 10.r,horizontal: 45.r), backgroundColor: Colors.transparent, contentPadding: EdgeInsets.all(0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(15.r))), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))), content: Container( width: MediaQuery.of(context).size.width - 48.r, // height: MediaQuery.of(context).size.height * 0.4, color: Colors.white, // child: PhotoView(imageProvider: NetworkImage(imgUrl),backgroundDecoration: BoxDecoration(color: Colors.transparent),)), - child: Image.network(RequestConfig.imgUrl+imgUrl)), + child: Image.network(RequestConfig.imgUrl + imgUrl)), ); }, ); } -} \ No newline at end of file +} diff --git a/lib/page/global_widget/my_text.dart b/making_school_asignment_app/lib/page/global_widget/my_text.dart similarity index 92% rename from lib/page/global_widget/my_text.dart rename to making_school_asignment_app/lib/page/global_widget/my_text.dart index dd62894..9c95ef7 100644 --- a/lib/page/global_widget/my_text.dart +++ b/making_school_asignment_app/lib/page/global_widget/my_text.dart @@ -7,7 +7,7 @@ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ import 'package:flutter/cupertino.dart'; -import 'package:school_asignment_app/common/config/colorUtils.dart'; +import 'package:making_school_asignment_app/common/config/colorUtils.dart'; // 快捷Text使用 Text quickText(text, diff --git a/lib/page/global_widget/other_page.dart b/making_school_asignment_app/lib/page/global_widget/other_page.dart similarity index 95% rename from lib/page/global_widget/other_page.dart rename to making_school_asignment_app/lib/page/global_widget/other_page.dart index 018e405..8e4ac20 100644 --- a/lib/page/global_widget/other_page.dart +++ b/making_school_asignment_app/lib/page/global_widget/other_page.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:package_info/package_info.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; // 其他页面 class OhterPage extends StatefulWidget { @@ -70,7 +70,7 @@ class _OhterPageState extends State { children: [ InkWell( onTap: () { - /* RouterManager.router.navigateTo( + /* RouterManager.router.navigateTo( context, transition: TransitionType.fadeIn, '${RouterManager.agreementPath}?type=${AGREEMENT_KEY.PRIVACY_GREEMENT.name}', diff --git a/lib/page/global_widget/show_student_list.dart b/making_school_asignment_app/lib/page/global_widget/show_student_list.dart similarity index 67% rename from lib/page/global_widget/show_student_list.dart rename to making_school_asignment_app/lib/page/global_widget/show_student_list.dart index f4bbe4e..ebc4d09 100644 --- a/lib/page/global_widget/show_student_list.dart +++ b/making_school_asignment_app/lib/page/global_widget/show_student_list.dart @@ -1,15 +1,15 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; class ShowStudentList extends StatelessWidget { final String title; final String homeworkId; final List studentList; - const ShowStudentList({Key? key,required this.title,required this.studentList,required this.homeworkId}) : super(key: key); + const ShowStudentList({Key? key, required this.title, required this.studentList, required this.homeworkId}) : super(key: key); @override Widget build(BuildContext context) { @@ -43,22 +43,16 @@ class ShowStudentList extends StatelessWidget { alignment: WrapAlignment.spaceAround, //沿主轴方向居中 children: studentList.map((e) { return InkWell( - onTap: (){ - Get.toNamed(Routes.studentPersonalPage,arguments: {'studentId':e.studentId,'homeworkId':homeworkId}); + onTap: () { + Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': e.studentId, 'homeworkId': homeworkId}); }, child: Container( - padding: EdgeInsets.symmetric( - vertical: 4.r, horizontal: 8.r), + padding: EdgeInsets.symmetric(vertical: 4.r, horizontal: 8.r), decoration: BoxDecoration( - color: e.state == 3 - ? Color(0xFF4CC793) - : Color(0xFFE2E2E2), + color: e.state == 3 ? Color(0xFF4CC793) : Color(0xFFE2E2E2), borderRadius: BorderRadius.circular(4.r), ), - child: quickText(e.studentName, - color: - e.state == 3 ? Colors.white : Color(0xFF505E6E), - size: 10.sp), + child: quickText(e.studentName, color: e.state == 3 ? Colors.white : Color(0xFF505E6E), size: 10.sp), ), ); }).toList(), diff --git a/lib/page/global_widget/start_page.dart b/making_school_asignment_app/lib/page/global_widget/start_page.dart similarity index 82% rename from lib/page/global_widget/start_page.dart rename to making_school_asignment_app/lib/page/global_widget/start_page.dart index 6dac3e7..1b6953c 100644 --- a/lib/page/global_widget/start_page.dart +++ b/making_school_asignment_app/lib/page/global_widget/start_page.dart @@ -1,26 +1,24 @@ -import 'dart:convert'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:package_info/package_info.dart'; -import 'package:school_asignment_app/common/config/app_config.dart'; -import 'package:school_asignment_app/common/job/common/app_version_model.dart'; -import 'package:school_asignment_app/common/job/common/base_app_version.dart'; -import 'package:school_asignment_app/common/job/common/base_page_data.dart'; -import 'package:school_asignment_app/common/job/user_info.dart'; -import 'package:school_asignment_app/common/job/user_info_detail.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/common/store/app_storage_key.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; -import 'package:school_asignment_app/common/utils/toast_utils.dart'; -import 'package:school_asignment_app/page/home_page/children/my_info.dart'; -import 'package:school_asignment_app/page/home_page/home_logic.dart'; -import 'package:school_asignment_app/page/home_page/home_view.dart'; -import 'package:school_asignment_app/page/work_page/work_logic.dart'; -import 'package:school_asignment_app/page/work_page/work_view.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:making_school_asignment_app/common/config/app_config.dart'; +import 'package:making_school_asignment_app/common/job/common/app_version_model.dart'; +import 'package:making_school_asignment_app/common/job/common/base_app_version.dart'; +import 'package:making_school_asignment_app/common/job/common/base_page_data.dart'; +import 'package:making_school_asignment_app/common/job/user_info.dart'; +import 'package:making_school_asignment_app/common/job/user_info_detail.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/common/utils/toast_utils.dart'; +import 'package:making_school_asignment_app/page/home_page/children/my_info.dart'; +import 'package:making_school_asignment_app/page/home_page/home_logic.dart'; +import 'package:making_school_asignment_app/page/home_page/home_view.dart'; +import 'package:making_school_asignment_app/page/work_page/work_logic.dart'; +import 'package:making_school_asignment_app/page/work_page/work_view.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; class StartPage extends StatefulWidget { const StartPage({Key? key}) : super(key: key); diff --git a/lib/page/home_page/children/annotate_class/annotate_class_binding.dart b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_binding.dart similarity index 100% rename from lib/page/home_page/children/annotate_class/annotate_class_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_binding.dart diff --git a/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_logic.dart b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_logic.dart new file mode 100644 index 0000000..29903b2 --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_logic.dart @@ -0,0 +1,54 @@ +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:get/get.dart'; +import 'package:get_storage/get_storage.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; + +import 'annotate_class_state.dart'; + +class AnnotateClassLogic extends GetxController with RequestToolMixin { + final AnnotateClassState state = AnnotateClassState(); + + @override + void onInit() { + super.onInit(); + state.homeworkId.value = Get.arguments['id'] ?? ''; + state.name.value = Get.arguments['name'] ?? ''; + state.grade = Get.arguments['grade']; + state.completed.value = Get.arguments['completed'] ?? false; + EasyLoading.show(status: 'loading...'); + getList(); + } + + void getList() async { + List data = await getClient().getAnnotatedClassList(state.homeworkId.value); + state.classList.value = data; + + for (var element in state.classList.value) { + int commitStudentCount = 0; + int noCommitStudentCount = 0; + for (var student in element.students) { + if (student.state == 0) { + noCommitStudentCount++; + } else { + commitStudentCount++; + } + } + element.commitStudentCount = commitStudentCount; + element.noCommitStudentCount = noCommitStudentCount; + } + + EasyLoading.dismiss(); + } + + void goQuickDataCheck(item) { + Get.toNamed(Routes.quickDataCheckPage, + arguments: {'homeworkId': state.homeworkId.value, 'classId': item.classId, 'grade': state.grade, 'className': item.className}); + } + + void gojobReport(item) { + Get.toNamed(Routes.jobReportPage, + arguments: {'title': state.name.value, 'homeworkId': state.homeworkId.value, 'grade': state.grade, 'className': item.className}); + } +} diff --git a/lib/page/home_page/children/annotate_class/annotate_class_state.dart b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_state.dart similarity index 70% rename from lib/page/home_page/children/annotate_class/annotate_class_state.dart rename to making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_state.dart index 1b079ae..3ab93c8 100644 --- a/lib/page/home_page/children/annotate_class/annotate_class_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_state.dart @@ -1,12 +1,12 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; class AnnotateClassState { AnnotateClassState() { ///Initialize variables } - late RxString name = ''.obs; + late RxString name = ''.obs; late RxList classList = RxList(); late RxString homeworkId = ''.obs; late RxBool completed = false.obs; 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 new file mode 100644 index 0000000..a68d5dd --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_view.dart @@ -0,0 +1,110 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; +import 'package:get/get.dart'; +import 'package:percent_indicator/percent_indicator.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/page/home_page/children/annotate_class/widget/annotate_item.dart'; +import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; +import 'annotate_class_logic.dart'; +import 'widget/completed_annotate_item.dart'; + +class AnnotateClassPage extends StatefulWidget { + const AnnotateClassPage({Key? key}) : super(key: key); + + @override + State createState() => _AnnotateClassPageState(); +} + +class _AnnotateClassPageState extends State { + final logic = Get.find(); + final state = Get.find().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.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: () => Navigator.of(context).pop(), + ), + actions: const [ + ReturnToHomepage(), + ], + ), + body: Padding( + padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), + child: Obx(() { + return 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, + ); + }).toList(), + ) + : ListView.builder( + itemCount: state.classList.length, + itemBuilder: (context, index) { + AnnotatedClass taskItem = state.classList[index]; + return CompletedAnnotateItem( + taskItem: taskItem, + logic: logic, + ); + }) + : 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( + item: item, + font: 8.sp, + name: state.name.value, + logic: logic, + ); + }, + ) + : ListView.builder( + itemCount: state.classList.length, + itemBuilder: (context, index) { + AnnotatedClass item = state.classList[index]; + return AnnotateItem( + item: item, + font: 12.sp, + name: state.name.value, + logic: logic, + ); + }); + }), + ), + ); + } + + @override + void dispose() { + Get.delete(); + super.dispose(); + } +} diff --git a/making_school_asignment_app/lib/page/home_page/children/annotate_class/widget/annotate_item.dart b/making_school_asignment_app/lib/page/home_page/children/annotate_class/widget/annotate_item.dart new file mode 100644 index 0000000..c618c81 --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/annotate_class/widget/annotate_item.dart @@ -0,0 +1,242 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:percent_indicator/percent_indicator.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/utils/enum_untils.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/page/home_page/children/annotate_class/annotate_class_logic.dart'; +import 'package:making_school_asignment_app/page/home_page/children/annotate_class/annotate_class_state.dart'; +import 'package:making_school_asignment_app/page/home_page/children/annotate_class/widget/item_btn.dart'; +import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; + +class AnnotateItem extends StatefulWidget { + final AnnotatedClass item; + final double font; + final String name; + final AnnotateClassLogic logic; + const AnnotateItem({Key? key, required this.item, required this.font, required this.name, required this.logic}) : super(key: key); + + @override + State createState() => _AnnotateItemState(); +} + +class _AnnotateItemState extends State { + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only(top: 10.r), + margin: EdgeInsets.only(bottom: 10.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadiusDirectional.circular(4.r), + boxShadow: const [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.15), blurRadius: 10)], + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.r), + child: Row( + children: [ + Text( + '${EnumUtils.formatGrade(widget.item.grade)}${widget.item.className}', + style: TextStyle(fontSize: widget.font, color: const Color(0xFF000000)), + ), + const Spacer(), + Text( + '已交:${widget.item.commitStudentCount}', + style: TextStyle(fontSize: widget.font - 2.sp, color: const Color(0xFF6888FD)), + ), + SizedBox( + width: 20.r, + ), + Text( + '未交:${widget.item.noCommitStudentCount}', + style: TextStyle(fontSize: widget.font - 2.sp, color: const Color(0xFFFF5656)), + ), + ], + ), + ), + SizedBox( + height: 10.r, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 8.r), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget.item.finishTime != null + ? [ + Expanded( + flex: 4, + child: ItemBtn( + title: "收藏夹", + font: widget.font - 2.sp, + clickFunction: () {}, + ), + ), + const Expanded(flex: 1, child: SizedBox()), + const Expanded(flex: 4, child: SizedBox()), + const Expanded(flex: 1, child: SizedBox()), + const Expanded(flex: 4, child: SizedBox()), + ] + : [ + Expanded( + flex: 4, + child: ItemBtn( + title: "一键批阅", + font: widget.font - 2.sp, + clickFunction: () {}, + ), + ), + const Expanded( + flex: 1, + child: Text(''), + ), + Expanded( + flex: 4, + child: ItemBtn( + title: "数据快查", + font: widget.font - 2.sp, + clickFunction: () { + widget.logic.goQuickDataCheck(widget.item); + }, + ), + ), + const Expanded( + flex: 1, + child: Text(''), + ), + Expanded( + flex: 4, + child: ItemBtn( + title: "收藏夹", + font: widget.font - 2.sp, + clickFunction: () {}, + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), + child: Row( + children: [ + Expanded( + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 8.h, + animationDuration: 2500, + + percent: widget.item.annotateRate / 100, + linearGradient: LinearGradient( + tileMode: TileMode.mirror, + stops: const [0.0, 1.0], + colors: widget.item.annotateRate / 100 != 1 + ? [Theme.of(context).primaryColor.withOpacity(0.1), Theme.of(context).primaryColor] + : [ + const Color.fromRGBO(144, 224, 190, 1).withOpacity(0.1), + const Color.fromRGBO(144, 224, 190, 1), + ], + ), + // linearStrokeCap: LinearStrokeCap.butt, + // progressColor: Theme.of(context).primaryColor, + backgroundColor: const Color.fromRGBO(232, 232, 232, 1), + barRadius: Radius.circular(10.r), + ), + ), + SizedBox(width: 7.w), + quickText('${widget.item.annotateRate}%', size: widget.font - 2.sp, color: const Color.fromRGBO(70, 70, 70, 1)) + ], + ), + ), + ProgressBar( + title: '客观题正确率:', + color: const Color(0xFFB8C7FF), + percent: widget.item.kgtCorrectRate / 100, + marginEdg: EdgeInsets.zero, + padingEdg: EdgeInsets.only(top: 8.h, left: 14.r, right: 14.r), + fontSize: widget.font - 2.sp), + ProgressBar( + title: '主观题正确率:', + color: const Color(0xFFB8C7FF), + percent: widget.item.zgtCorrectRate / 100, + padingEdg: EdgeInsets.symmetric(horizontal: 10.r), + marginEdg: EdgeInsets.only(top: 8.h), + fontSize: widget.font - 2.sp), + ProgressBar( + title: '总正确率:', + color: const Color(0xFFB8C7FF), + percent: widget.item.correctRate / 100, + padingEdg: EdgeInsets.symmetric(horizontal: 10.r), + marginEdg: EdgeInsets.only(top: 8.h), + fontSize: widget.font - 2.sp), + Container( + margin: EdgeInsets.only(top: 10.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(4.r), bottomRight: Radius.circular(4.r)), + color: Colors.white, + boxShadow: const [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.15), + offset: Offset(0, -0.0001), //阴影y轴偏移量 + blurRadius: 4, //阴影模糊程度 + spreadRadius: 0, //阴影扩散程度 + ) + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget.item.finishTime != null + ? [ + Expanded( + child: InkWell( + onTap: () { + widget.logic.goQuickDataCheck(widget.item); + }, + child: Container( + alignment: Alignment.center, + child: quickText('数据快查', color: Color.fromRGBO(118, 118, 118, 1), size: widget.font), + ), + ), + ), + Container(width: 1.w, height: 30.h, color: const Color.fromRGBO(221, 221, 221, 1)), + Expanded( + child: InkWell( + onTap: () { + widget.logic.gojobReport(widget.item); + }, + child: Container( + alignment: Alignment.center, + child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: widget.font), + ), + )), + ] + : [ + Expanded( + child: InkWell( + onTap: () {}, + child: Container( + alignment: Alignment.center, + child: quickText('批阅', color: const Color.fromRGBO(118, 118, 118, 1), size: widget.font), + ), + ), + ), + Container(width: 1.w, height: 30.h, color: const Color.fromRGBO(221, 221, 221, 1)), + Expanded( + child: InkWell( + onTap: () {}, + child: Container( + alignment: Alignment.center, + child: quickText('结束批阅', color: const Color.fromRGBO(118, 118, 118, 1), size: widget.font), + ), + )), + ], + ), + ) + ], + ), + ); + } +} diff --git a/lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart b/making_school_asignment_app/lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart similarity index 74% rename from lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart rename to making_school_asignment_app/lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart index c657bb7..afdcd56 100644 --- a/lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart +++ b/making_school_asignment_app/lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart @@ -2,23 +2,27 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/page/global_widget/show_student_list.dart'; -import 'package:school_asignment_app/page/home_page/children/annotate_class/annotate_class_logic.dart'; -import 'package:school_asignment_app/page/home_page/widget/progress_bar.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/page/global_widget/show_student_list.dart'; +import 'package:making_school_asignment_app/page/home_page/children/annotate_class/annotate_class_logic.dart'; +import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart'; class CompletedAnnotateItem extends StatelessWidget { final AnnotatedClass taskItem; final AnnotateClassLogic logic; - const CompletedAnnotateItem({Key? key,required this.taskItem,required this.logic}) : super(key: key); + const CompletedAnnotateItem({Key? key, required this.taskItem, required this.logic}) : super(key: key); - void showStudentList(context,List students,[bool submitted = false]) async { + void showStudentList(context, List students, [bool submitted = false]) async { showDialog( context: context, builder: (BuildContext context) { - return ShowStudentList(title:'${taskItem.className ?? ''} ${submitted ? '已提交' : '未提交'}作业学生',studentList:students,homeworkId: logic.state.homeworkId.value,); + return ShowStudentList( + title: '${taskItem.className ?? ''} ${submitted ? '已提交' : '未提交'}作业学生', + studentList: students, + homeworkId: logic.state.homeworkId.value, + ); }, ); EasyLoading.dismiss(); @@ -44,16 +48,16 @@ class CompletedAnnotateItem extends StatelessWidget { children: [ ProgressBar( color: Color.fromRGBO(76, 199, 147, 1), - percent: taskItem.kgtCorrectRate/100, + percent: taskItem.kgtCorrectRate / 100, title: '客观题正确率:', - padingEdg: EdgeInsets.only(left: 10.w, right: 10.w), + padingEdg: EdgeInsets.only(left: 10.w, right: 10.w), fontSize: 8.sp, lineHeight: 5.h, marginEdg: EdgeInsets.only(top: 5.h), ), ProgressBar( color: Color.fromRGBO(76, 199, 147, 1), - percent: taskItem.zgtCorrectRate / 100, + percent: taskItem.zgtCorrectRate / 100, title: '主观题正确率:', fontSize: 8.sp, lineHeight: 5.h, @@ -71,7 +75,7 @@ class CompletedAnnotateItem extends StatelessWidget { ), ], ), - SizedBox(height: Utils.isPad()?4.h:10.h), + SizedBox(height: Utils.isPad() ? 4.h : 10.h), Padding( padding: EdgeInsets.only(left: 10.w, right: 10.w), child: Row( @@ -83,9 +87,9 @@ class CompletedAnnotateItem extends StatelessWidget { color: Color.fromRGBO(244, 244, 244, 1), borderRadius: BorderRadius.circular(16.r), child: InkWell( - onTap: (){ + onTap: () { EasyLoading.show(status: 'loading...'); - showStudentList(context,taskItem.commitStudent!,true); + showStudentList(context, taskItem.commitStudent!, true); }, borderRadius: BorderRadius.circular(8.r), splashColor: Theme.of(context).primaryColor, @@ -95,8 +99,7 @@ class CompletedAnnotateItem extends StatelessWidget { decoration: BoxDecoration( borderRadius: BorderRadius.circular(20.r), ), - child: quickText('已提交:${taskItem.commitStudentCount}', - size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), + child: quickText('已提交:${taskItem.commitStudentCount}', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), ), ), ), @@ -110,7 +113,7 @@ class CompletedAnnotateItem extends StatelessWidget { child: InkWell( onTap: () { EasyLoading.show(status: 'loading...'); - showStudentList(context,taskItem.noCommitStudent!); + showStudentList(context, taskItem.noCommitStudent!); }, splashColor: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(8.r), @@ -118,8 +121,7 @@ class CompletedAnnotateItem extends StatelessWidget { alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 4.h), decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), - child: quickText('未提交:${taskItem.noCommitStudentCount}', - size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), + child: quickText('未提交:${taskItem.noCommitStudentCount}', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), ), ), ), @@ -131,24 +133,21 @@ class CompletedAnnotateItem extends StatelessWidget { color: Color.fromRGBO(244, 244, 244, 1), borderRadius: BorderRadius.circular(20.r), child: InkWell( - onTap: () { - - }, + onTap: () {}, splashColor: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(8.r), child: Container( alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 4.h), decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), - child: quickText('收藏夹', - size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), + child: quickText('收藏夹', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), ), ), )), ], ), ), - SizedBox(height: Utils.isPad()?4.h:10.h), + SizedBox(height: Utils.isPad() ? 4.h : 10.h), Container( decoration: BoxDecoration( borderRadius: BorderRadius.only( @@ -169,7 +168,7 @@ class CompletedAnnotateItem extends StatelessWidget { Expanded( child: InkWell( onTap: () { - logic.goQuickDataCheck(taskItem); + logic.goQuickDataCheck(taskItem); }, child: Container( alignment: Alignment.center, @@ -180,14 +179,14 @@ class CompletedAnnotateItem extends StatelessWidget { Container(width: 1.w, height: 26.h, color: Color.fromRGBO(221, 221, 221, 1)), Expanded( child: InkWell( - onTap: (){ - logic.gojobReport(taskItem); - }, - child: Container( - alignment: Alignment.center, - child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 10.sp), - ), - )), + onTap: () { + logic.gojobReport(taskItem); + }, + child: Container( + alignment: Alignment.center, + child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 10.sp), + ), + )), ]), ), ], diff --git a/lib/page/home_page/children/annotate_class/widget/item_btn.dart b/making_school_asignment_app/lib/page/home_page/children/annotate_class/widget/item_btn.dart similarity index 100% rename from lib/page/home_page/children/annotate_class/widget/item_btn.dart rename to making_school_asignment_app/lib/page/home_page/children/annotate_class/widget/item_btn.dart diff --git a/lib/page/home_page/children/class_student/class_student_binding.dart b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_binding.dart similarity index 100% rename from lib/page/home_page/children/class_student/class_student_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/class_student/class_student_binding.dart diff --git a/lib/page/home_page/children/class_student/class_student_logic.dart b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_logic.dart similarity index 57% rename from lib/page/home_page/children/class_student/class_student_logic.dart rename to making_school_asignment_app/lib/page/home_page/children/class_student/class_student_logic.dart index 41822f8..1efc3d5 100644 --- a/lib/page/home_page/children/class_student/class_student_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_logic.dart @@ -2,39 +2,39 @@ import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; import 'package:get_storage/get_storage.dart'; -import 'package:school_asignment_app/common/job/student_item.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/job/student_item.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; import 'class_student_state.dart'; -class ClassStudentLogic extends GetxController with RequestToolMixin{ +class ClassStudentLogic extends GetxController with RequestToolMixin { final ClassStudentState state = ClassStudentState(); late final EasyRefreshController refreshController; @override void onInit() { super.onInit(); - state.title.value = Get.arguments['title']??''; - state.classId = Get.arguments['classId']??''; - state.subject = Get.arguments['subject']??-1; - state.page = Get.arguments['page']??''; + state.title.value = Get.arguments['title'] ?? ''; + state.classId = Get.arguments['classId'] ?? ''; + state.subject = Get.arguments['subject'] ?? -1; + state.page = Get.arguments['page'] ?? ''; EasyLoading.show(status: 'loading...'); refreshController = EasyRefreshController(); getList(); } - void getList() async{ - List res = await getClient().getStudentList(state.classId,state.subject); + void getList() async { + List res = await getClient().getStudentList(state.classId, state.subject); state.studentList.value = res; - state.studentList.sort((a, b) => a.priorityAnnotate?-1:1); + state.studentList.sort((a, b) => a.priorityAnnotate ? -1 : 1); EasyLoading.dismiss(); refreshController.finishRefresh(); } - void setJobReadLevel(studentId,priorityAnnotate) async{ - if(state.isClicking){ + void setJobReadLevel(studentId, priorityAnnotate) async { + if (state.isClicking) { state.isClicking = false; - await getClient().getAnnotateStudent(state.classId,studentId,priorityAnnotate,state.subject); + await getClient().getAnnotateStudent(state.classId, studentId, priorityAnnotate, state.subject); state.isClicking = true; getList(); } diff --git a/lib/page/home_page/children/class_student/class_student_state.dart b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_state.dart similarity index 72% rename from lib/page/home_page/children/class_student/class_student_state.dart rename to making_school_asignment_app/lib/page/home_page/children/class_student/class_student_state.dart index d786f5a..bb2e695 100644 --- a/lib/page/home_page/children/class_student/class_student_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_state.dart @@ -1,12 +1,12 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/student_item.dart'; +import 'package:making_school_asignment_app/common/job/student_item.dart'; class ClassStudentState { ClassStudentState() { ///Initialize variables } - late RxString title = ''.obs; + late RxString title = ''.obs; late final String classId; late final int subject; late RxList studentList = RxList(); 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 new file mode 100644 index 0000000..2f7161d --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart @@ -0,0 +1,323 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:making_school_asignment_app/common/job/student_item.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; + +import 'class_student_logic.dart'; + +class ClassStudentPage extends StatefulWidget { + const ClassStudentPage({Key? key}) : super(key: key); + + @override + State createState() => _ClassStudentPageState(); +} + +class _ClassStudentPageState extends State { + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + title: Obx(() { + return Text( + state.title.value, + style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333)), + ); + }), + centerTitle: true, + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Navigator.of(context).pop(), + ), + actions: const [ + ReturnToHomepage(), + ], + ), + body: 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)), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + }), + ) + : 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: 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: 24.r, + width: 82.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(4.r)), + color: const Color(0xFFE1E1E1), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 3.r), + child: Image.asset( + 'assets/images/youx_icon_default.png', + width: 14.r, + height: 14.r, + ), + ), + Padding( + padding: EdgeInsets.only(top: 2.r, left: 4.r), + child: Text( + '优先批阅', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8A9691)), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + }, + itemCount: state.studentList.length, + ) + : const MyEmptyWidget(), + ); + }), + ), + ); + } + + @override + void dispose() { + Get.delete(); + super.dispose(); + } +} diff --git a/lib/page/home_page/children/job_report/job_report_binding.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_binding.dart similarity index 100% rename from lib/page/home_page/children/job_report/job_report_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/job_report/job_report_binding.dart diff --git a/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_logic.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_logic.dart new file mode 100644 index 0000000..ea611da --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_logic.dart @@ -0,0 +1,56 @@ +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:get/get.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; + +import 'job_report_state.dart'; + +class JobReportLogic extends GetxController with RequestToolMixin { + final JobReportState state = JobReportState(); + + @override + void onInit() { + super.onInit(); + state.title.value = Get.arguments['title'] ?? ''; + state.homeworkId.value = Get.arguments['homeworkId'] ?? ''; + state.classId.value = Get.arguments['classId'] ?? ''; + state.className.value = Get.arguments['className'] ?? ''; + state.grade = Get.arguments['grade'] ?? ''; + EasyLoading.show(status: 'loading...'); + getClass(); + } + + void getClass() async { + List data = await getClient().getAnnotatedClassList(state.homeworkId.value); + state.involveClasses.value = data; + + state.involveClasses.value = [state.classData.value, ...(data ?? [])]; + for (var element in state.involveClasses) { + if (element.className == state.className.value && element.grade == state.grade) { + state.classData.value = element; + } + } + getWorkData(); + } + + void getWorkData() async { + HomeworkDetails data = + await getClient().getHomeworkDetails(state.homeworkId.value, state.classData.value.classId != '-1' ? state.classData.value.classId : ''); + state.dataCount = Utils.getHomeworkData(data); + state.homeData = data; + state.kgReport.value = data.questions.where((w) => w.questionType == 1).toList(); + state.zgReport.value = data.questions.where((w) => w.questionType == 2).toList(); + state.studentList.value = [...data.students]; + state.knowsList.value = data.knows; + state.hasData.value = true; + EasyLoading.dismiss(); + + state.studentList.sort((a, b) { + int num1 = a.kgtOkCount! + a.zgtOkCount!; + int num2 = b.kgtOkCount! + b.zgtOkCount!; + return num2.compareTo(num1); + }); + } +} diff --git a/lib/page/home_page/children/job_report/job_report_state.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_state.dart similarity index 62% rename from lib/page/home_page/children/job_report/job_report_state.dart rename to making_school_asignment_app/lib/page/home_page/children/job_report/job_report_state.dart index cb642c9..bb986c0 100644 --- a/lib/page/home_page/children/job_report/job_report_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_state.dart @@ -1,7 +1,7 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_state.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_state.dart'; class JobReportState { JobReportState() { @@ -21,6 +21,6 @@ class JobReportState { late RxList knowsList = RxList(); late HomeworkDetails homeData; late RxList involveClasses = RxList(); - late AnnotatedClass defaultClass = AnnotatedClass('',-1,'-1','','',-1,-1,-1,-1,-1,[],[],-1,-1,-1,-1,-1,[],[]); + late AnnotatedClass defaultClass = AnnotatedClass('', -1, '-1', '', '', -1, -1, -1, -1, -1, [], [], -1, -1, -1, -1, -1, [], []); late Rx classData = defaultClass.obs; } diff --git a/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 similarity index 57% rename from lib/page/home_page/children/job_report/job_report_view.dart rename to making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart index 21e53b1..0ba162e 100644 --- a/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 @@ -1,14 +1,14 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart'; -import 'package:school_asignment_app/page/home_page/children/job_report/widget/dropdown_selection.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/page/home_page/children/job_report/widget/knowledge_point.dart'; -import 'package:school_asignment_app/page/home_page/children/job_report/widget/personnel_data_overview.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; +import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/dropdown_selection.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/knowledge_point.dart'; +import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/personnel_data_overview.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart'; import 'job_report_logic.dart'; @@ -21,9 +21,7 @@ class JobReportPage extends StatefulWidget { class _JobReportPageState extends State { final logic = Get.find(); - final state = Get - .find() - .state; + final state = Get.find().state; @override Widget build(BuildContext context) { @@ -32,14 +30,13 @@ class _JobReportPageState extends State { 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), - ); - })), + 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: () => Navigator.of(context).pop(), @@ -62,8 +59,8 @@ class _JobReportPageState extends State { child: Row( children: [ Obx(() { - return DropdownSelection(involveClasses: state - .involveClasses.value, + return DropdownSelection( + involveClasses: state.involveClasses.value, classData: state.classData.value, call: (AnnotatedClass item) { state.classData.value = item; @@ -79,19 +76,21 @@ class _JobReportPageState extends State { /* TopCount( data, classData == null ? '' : classData!.className, widget.id),*/ //客观题、主观题 - KgtZgtTable(studentCount: state.dataCount.studentCount!, + 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)), + 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: KnowledgePoint( + knowsList: state.knowsList, + data: state.homeData, + className: state.classData.value.className, + homeworkId: state.homeworkId.value)), // 掌握知识点的情况 /* Container( margin: EdgeInsets.symmetric(horizontal: 10.r), @@ -101,23 +100,16 @@ class _JobReportPageState extends State { 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() - ); + return Padding(padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), child: const MyEmptyWidget()); } }), ); @@ -128,4 +120,4 @@ class _JobReportPageState extends State { Get.delete(); super.dispose(); } -} \ No newline at end of file +} diff --git a/lib/page/home_page/children/job_report/widget/dropdown_selection.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/dropdown_selection.dart similarity index 63% rename from lib/page/home_page/children/job_report/widget/dropdown_selection.dart rename to making_school_asignment_app/lib/page/home_page/children/job_report/widget/dropdown_selection.dart index 094fd1a..fd0a208 100644 --- a/lib/page/home_page/children/job_report/widget/dropdown_selection.dart +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/dropdown_selection.dart @@ -1,14 +1,14 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/common/utils/enum_untils.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/utils/enum_untils.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; class DropdownSelection extends StatefulWidget { - final List? involveClasses; - final AnnotatedClass? classData; - final Function(AnnotatedClass) call; - const DropdownSelection({Key? key,required this.involveClasses,required this.classData,required this.call}) : super(key: key); + final List? involveClasses; + final AnnotatedClass? classData; + final Function(AnnotatedClass) call; + const DropdownSelection({Key? key, required this.involveClasses, required this.classData, required this.call}) : super(key: key); @override State createState() => _DropdownSelectionState(); @@ -17,7 +17,7 @@ class DropdownSelection extends StatefulWidget { class _DropdownSelectionState extends State { @override Widget build(BuildContext context) { - return Container( + return Container( // width: 200.r, padding: EdgeInsets.symmetric(horizontal: 10.r), decoration: const BoxDecoration( @@ -34,11 +34,7 @@ class _DropdownSelectionState extends State { items: widget.involveClasses?.map((e) { return DropdownMenuItem( value: e.classId!, - child: quickText( - e.classId == '-1' - ? '全部' - : - ' ${EnumUtils.formatGrade(e.grade)}${e.className}', size: 12.sp, color: Colors.black), + child: quickText(e.classId == '-1' ? '全部' : ' ${EnumUtils.formatGrade(e.grade)}${e.className}', size: 12.sp, color: Colors.black), ); }).toList(), onChanged: (value) { diff --git a/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart new file mode 100644 index 0000000..27cc43d --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart @@ -0,0 +1,297 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:percent_indicator/linear_percent_indicator.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; + +class KnowledgePoint extends StatefulWidget { + final RxList knowsList; + final HomeworkDetails data; + final String className; + final String homeworkId; + KnowledgePoint({Key? key, required this.knowsList, required this.data, required this.className, required this.homeworkId}) : super(key: key); + + @override + State createState() => _KnowledgePointState(); +} + +class _KnowledgePointState extends State { + void goQuickCheckPersonalPath(studentId) { + if (studentId != null) { + Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': studentId, 'homeworkId': widget.homeworkId}); + } + } + + void showPeopleListDialog({ + required BuildContext context, + required String title, + required List arr, + }) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + // insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r), + backgroundColor: const Color(0xFFFFFFFF), + contentPadding: EdgeInsets.all(20.r), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))), + content: SizedBox( + width: MediaQuery.of(context).size.width * 0.7, + height: MediaQuery.of(context).size.height * 0.7, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Text( + title, + style: TextStyle(fontSize: 15.sp, color: const Color(0xFF3C3C3C), fontWeight: FontWeight.w500), + ), + ), + SizedBox( + height: 10.r, + ), + Row( + children: [ + Expanded( + flex: 2, + child: Center( + child: Text( + '姓名', + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF6A6A6A)), + ))), + SizedBox( + width: 10.r, + ), + Expanded( + flex: 1, + child: Center( + child: Text( + '班级', + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF6A6A6A)), + ))), + SizedBox( + width: 10.r, + ), + Expanded( + flex: 2, + child: Center( + child: Text( + '掌握度', + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF6A6A6A)), + ))), + SizedBox( + width: 10.r, + ), + Expanded( + flex: 3, + child: Center( + child: Text( + '掌握情况', + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF6A6A6A)), + ))), + ], + ), + SizedBox( + height: 5.r, + ), + arr.isNotEmpty + ? Expanded( + child: ListView.builder( + shrinkWrap: true, + itemBuilder: (context, index) { + var item = arr[index]; + return Container( + padding: EdgeInsets.symmetric(vertical: 5.r), + color: const Color(0xFFF0F0F0), + margin: EdgeInsets.only(bottom: 2.r), + child: Row( + children: [ + Expanded( + flex: 2, + child: InkWell( + onTap: () { + goQuickCheckPersonalPath(item.studentId); + }, + child: Center( + child: Text( + item.studentName!, + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF323232)), + )))), + SizedBox( + width: 10.r, + ), + Expanded( + flex: 1, + child: Center( + child: Text( + widget.className == '' ? '全部' : widget.className, + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), + ))), + SizedBox( + width: 10.r, + ), + Expanded( + flex: 2, + child: Center( + child: Text( + '${item.okRate!.toStringAsFixed(0)}%', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), + ))), + SizedBox( + width: 10.r, + ), + Expanded( + flex: 3, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 2.r, horizontal: 5.r), + child: SingleChildScrollView( + child: Wrap( + direction: Axis.horizontal, + alignment: WrapAlignment.start, + spacing: 5, + runSpacing: 3, + children: List.generate(item.queDtls!.length, (index) { + Dtls kgInfo = item.queDtls![index]; + return Container( + width: 14.r, + height: 14.r, + decoration: BoxDecoration( + color: kgInfo.state == 0 + ? const Color(0xFFD3D3D3) + : kgInfo.state == 1 + ? Colors.white + : kgInfo.state == 2 + ? const Color(0xFFFF7474) + : const Color(0xFF4CC793), + borderRadius: BorderRadius.all(Radius.circular(7.r))), + child: Center( + child: Text( + kgInfo.questionNo.toString(), + style: TextStyle(fontSize: 8.sp, color: kgInfo.state == 1 ? Color(0xFF525252) : Colors.white), + )), + ); + })), + ), + ), + ), + ], + ), + ); + }, + itemCount: arr.length, + ), + ) + : const MyEmptyWidget() + ], + ), + ), + ); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(top: 10.h), + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w), + constraints: BoxConstraints(maxHeight: 320.h), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)), + child: Column( + children: [ + Container( + margin: EdgeInsets.only(bottom: 24.h), + child: quickText('知识点掌握情况', color: const Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), + ), + Expanded( + child: ListView( + children: widget.knowsList.value.map((item) { + return Container( + margin: EdgeInsets.only(bottom: 15.h, left: 15.r, right: 15.r), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Expanded( + flex: 10, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + quickText(item.knowledgeName, size: 12.sp, color: const Color.fromRGBO(152, 152, 152, 1)), + quickText('${item.okRate!.toStringAsFixed(0)}%', size: 12.sp, color: const Color.fromRGBO(64, 64, 64, 1)), + ], + ), + ), + SizedBox(width: 10.w), + const Expanded(flex: 1, child: SizedBox()), + ], + ), + SizedBox(height: 3.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 10, + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 10.h, + animationDuration: 2500, + percent: item.okRate! / 100, + progressColor: Theme.of(context).primaryColor, + backgroundColor: const Color.fromRGBO(219, 224, 243, 1), + barRadius: Radius.circular(10.r), + )), + SizedBox(width: 10.w), + InkWell( + onTap: () { + List ques = + widget.data.questions.where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1).toList(); + List array2 = [...widget.data.students]; + for (var stu in array2) { + stu.queDtls = widget.data.dtls + .where((w) => + w.studentId == stu.studentId && + ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1) + .toList(); + int okCount = stu.queDtls!.where((w) => w.state == 3).length; + int ttlCount = stu.queDtls!.length; + stu.okRate = Utils.calcRate(okCount, ttlCount); + stu.queDtls!.sort((a, b) { + int num1 = a.questionNo; + int num2 = b.questionNo; + return num1.compareTo(num2); + }); + } + + showPeopleListDialog( + context: context, + title: item.knowledgeName, + arr: array2, + ); + }, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + quickText('查看', size: 12.sp, color: const Color.fromRGBO(239, 135, 20, 1)), + Icon(Icons.arrow_forward_ios, size: 11.sp, color: const Color.fromRGBO(239, 135, 20, 1)), + ], + ), + ), + ], + ) + ], + ), + ); + }).toList()), + ), + ], + )); + } +} diff --git a/lib/page/home_page/children/job_report/widget/personnel_data_overview.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/personnel_data_overview.dart similarity index 78% rename from lib/page/home_page/children/job_report/widget/personnel_data_overview.dart rename to making_school_asignment_app/lib/page/home_page/children/job_report/widget/personnel_data_overview.dart index b3f6577..133e050 100644 --- a/lib/page/home_page/children/job_report/widget/personnel_data_overview.dart +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/personnel_data_overview.dart @@ -1,18 +1,17 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; class PersonnelDataOverview extends StatefulWidget { final List studentList; - const PersonnelDataOverview({Key? key,required this.studentList}) : super(key: key); + const PersonnelDataOverview({Key? key, required this.studentList}) : super(key: key); @override State createState() => _PersonnelDataOverviewState(); } class _PersonnelDataOverviewState extends State { - List names = []; List useTimes = []; List correctRates = []; @@ -21,11 +20,10 @@ class _PersonnelDataOverviewState extends State { Map> mapData = {}; @override - void initState(){ + void initState() { super.initState(); - - for (var i = 0;i { noAnswerCounts.add(student.noAnswerCount.toString()); rankings.add('${i + 1}名'); } - mapData = { + mapData = { '姓名': names, - '答题时长': useTimes, - '正确率': correctRates, - '未答题数': noAnswerCounts, - '班级排名': rankings, - }; - + '答题时长': useTimes, + '正确率': correctRates, + '未答题数': noAnswerCounts, + '班级排名': rankings, + }; } @override @@ -69,7 +66,7 @@ class _PersonnelDataOverviewState extends State { thumbVisibility: true, trackVisibility: true, radius: Radius.circular(10.r), - controller: ScrollController(),//滑动条使用的控制器 + controller: ScrollController(), //滑动条使用的控制器 child: SingleChildScrollView( scrollDirection: Axis.horizontal, primary: true, @@ -100,15 +97,15 @@ class _PersonnelDataOverviewState extends State { color: Color.fromRGBO(245, 245, 245, 1), child: isTransparentChineseNew ? quickText('透明', color: Colors.transparent, size: 12.sp) - :RegExp(r'^\d+$').hasMatch(e) || e.contains('%') - ? Row( - mainAxisSize: MainAxisSize.min, - children: [ - quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2), - quickText('透', color: Colors.transparent, size: 12.sp), - ], - ) - : quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2), + : RegExp(r'^\d+$').hasMatch(e) || e.contains('%') + ? Row( + mainAxisSize: MainAxisSize.min, + children: [ + quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2), + quickText('透', color: Colors.transparent, size: 12.sp), + ], + ) + : quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2), ); }).toList(), ], @@ -123,6 +120,7 @@ class _PersonnelDataOverviewState extends State { ); } } + // 定义一个类来保存转换后的时间单位 class TimeUnits { int hours; @@ -131,6 +129,7 @@ class TimeUnits { TimeUnits(this.hours, this.minutes, this.seconds); } + // 毫秒转小时、分钟、秒的函数 TimeUnits convertMilliseconds(int totalSeconds) { int hours = totalSeconds ~/ 3600; // 整除得到小时数 @@ -139,5 +138,4 @@ TimeUnits convertMilliseconds(int totalSeconds) { int seconds = remainingSeconds % 60; // 求余得到秒数 return TimeUnits(hours, minutes, seconds); - -} \ No newline at end of file +} diff --git a/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_binding.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_binding.dart similarity index 100% rename from lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_binding.dart diff --git a/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart similarity index 75% rename from lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart rename to making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart index a7e810c..22deb0f 100644 --- a/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/knowledge_points_grasp.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; import 'knowledge_points_grasp_state.dart'; -class KnowledgePointsGraspLogic extends GetxController with RequestToolMixin,GetSingleTickerProviderStateMixin { +class KnowledgePointsGraspLogic extends GetxController with RequestToolMixin, GetSingleTickerProviderStateMixin { final KnowledgePointsGraspState state = KnowledgePointsGraspState(); //文本输入框控制器 late final TextEditingController textController; @@ -15,7 +15,7 @@ class KnowledgePointsGraspLogic extends GetxController with RequestToolMixin,Get late TabController tabController; @override - void onInit(){ + void onInit() { super.onInit(); textController = TextEditingController(); refreshController = EasyRefreshController(); @@ -24,14 +24,14 @@ class KnowledgePointsGraspLogic extends GetxController with RequestToolMixin,Get getList(); } - void getList() async{ - List data = await getClient().getKnowledgeReport(state.dateStart,state.dateEnd,textController.text); + void getList() async { + List data = await getClient().getKnowledgeReport(state.dateStart, state.dateEnd, textController.text); state.dataList.value = data; EasyLoading.dismiss(); } @override - void dispose(){ + void dispose() { super.dispose(); textController.dispose(); refreshController.dispose(); diff --git a/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_state.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_state.dart similarity index 51% rename from lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_state.dart rename to making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_state.dart index a614247..7dc7c18 100644 --- a/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_state.dart @@ -1,6 +1,6 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/knowledge_points_grasp.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; class KnowledgePointsGraspState { KnowledgePointsGraspState() { @@ -9,8 +9,8 @@ class KnowledgePointsGraspState { late int page = 1; late int totalPages = 0; - late RxList dataList=RxList(); - late String dateStart = Utils.getWeekStartDate().toString().substring(0, 10); + late RxList dataList = RxList(); + late String dateStart = Utils.getWeekStartDate().toString().substring(0, 10); late String dateEnd = Utils.getWeekEndDate().toString().substring(0, 10); late RxString customTimeStr = '自定义'.obs; } 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 new file mode 100644 index 0000000..6392b80 --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart @@ -0,0 +1,249 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart'; +import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; +import 'package:syncfusion_flutter_datepicker/datepicker.dart'; + +import 'knowledge_points_grasp_logic.dart'; + +class KnowledgePointsGraspPage extends StatefulWidget { + const KnowledgePointsGraspPage({Key? key}) : super(key: key); + + @override + State createState() => _KnowledgePointsGraspPageState(); +} + +class _KnowledgePointsGraspPageState extends State { + final logic = Get.find(); + final state = Get.find().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: () => Navigator.of(context).pop(), + ), + 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), + ), + ), + ), + ) + ], + ), + ), + 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; + 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, + ), + ], + ), + ), + ], + ), + SizedBox( + height: 10.r, + ), + ProgressBar( + title: '正确率:', + color: Color(0xFF90E0BE), + percent: item.correctRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ], + ), + ), + ); + }) + : const MyEmptyWidget(), + ); + }), + ), + ), + ], + ), + ); + } + + @override + void dispose() { + Get.delete(); + super.dispose(); + } +} diff --git a/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_binding.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_binding.dart similarity index 100% rename from lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_binding.dart diff --git a/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_logic.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_logic.dart similarity index 61% rename from lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_logic.dart rename to making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_logic.dart index 4e116e1..cbda5f3 100644 --- a/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_logic.dart @@ -1,19 +1,18 @@ import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/job/knowledge_report_detail.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/job/knowledge_report_detail.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; import 'knowledge_points_grasp_detail_state.dart'; -class KnowledgePointsGraspDetailLogic extends GetxController with RequestToolMixin{ +class KnowledgePointsGraspDetailLogic extends GetxController with RequestToolMixin { final KnowledgePointsGraspDetailState state = KnowledgePointsGraspDetailState(); late final EasyRefreshController refreshController; - @override - void onInit(){ + void onInit() { super.onInit(); state.dateStart = Get.arguments['dateStart']; state.dateEnd = Get.arguments['dateEnd']; @@ -24,18 +23,19 @@ class KnowledgePointsGraspDetailLogic extends GetxController with RequestToolMix getList(); } - void getList() async{ - List data = await getClient().getKnowledgeReportDetail(state.dateStart,state.dateEnd,state.knowledgeId); + void getList() async { + List data = await getClient().getKnowledgeReportDetail(state.dateStart, state.dateEnd, state.knowledgeId); state.dataList.value = data; EasyLoading.dismiss(); } - getStudents(homeworkId,templateId,questionNo) async{ - List data = await getClient().getQuestionStudentState(homeworkId,templateId,questionNo); - state.studentList.value = data; + getStudents(homeworkId, templateId, questionNo) async { + List data = await getClient().getQuestionStudentState(homeworkId, templateId, questionNo); + state.studentList.value = data; } + @override - void dispose(){ + void dispose() { super.dispose(); refreshController.dispose(); } diff --git a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_state.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_state.dart new file mode 100644 index 0000000..3eaec13 --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_state.dart @@ -0,0 +1,16 @@ +import 'package:get/get.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/job/knowledge_report_detail.dart'; + +class KnowledgePointsGraspDetailState { + KnowledgePointsGraspDetailState() { + ///Initialize variables + } + + late String dateStart = ''; + late String dateEnd = ''; + late int knowledgeId = 0; + late RxList dataList = RxList(); + late RxList studentList = RxList(); + late RxString knowledgeName = ''.obs; +} 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 new file mode 100644 index 0000000..3a2c1b8 --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart @@ -0,0 +1,254 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:percent_indicator/percent_indicator.dart'; +import 'package:making_school_asignment_app/common/job/knowledge_report_detail.dart'; +import 'package:making_school_asignment_app/common/utils/toast_utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/page/global_widget/show_student_list.dart'; + +import 'knowledge_points_grasp_detail_logic.dart'; + +class KnowledgePointsGraspDetailPage extends StatefulWidget { + const KnowledgePointsGraspDetailPage({Key? key}) : super(key: key); + + @override + State createState() => _KnowledgePointsGraspDetailPageState(); +} + +class _KnowledgePointsGraspDetailPageState extends State { + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + void showImg(imgUrl, context) { + if (imgUrl != null && imgUrl != '') { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + insetPadding: EdgeInsets.symmetric(vertical: 55.r, horizontal: 45.r), + contentPadding: EdgeInsets.all(0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))), + content: Container( + width: MediaQuery.of(context).size.width, + // height: MediaQuery.of(context).size.height, + child: Image.network(imgUrl), + ), + ); + }, + ); + } else { + ToastUtils.showError('暂无图片'); + } + + EasyLoading.dismiss(); + } + + void showStudent(homeworkId, templateId, questionNo, title) async { + logic.getStudents(homeworkId, templateId, questionNo); + + showDialog( + context: context, + builder: (BuildContext context) { + return Obx(() { + return ShowStudentList( + title: title, + studentList: state.studentList.value, + homeworkId: homeworkId, + ); + }); + }, + ); + EasyLoading.dismiss(); + } + + 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: () => Navigator.of(context).pop(), + ), + 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, + 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, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h), + studentCall:showStudent(item.questionId,item.jobName), + ),*/ + ], + ), + ), + ); + }) + : const MyEmptyWidget(), + ); + }), + ), + ); + } + + @override + void dispose() { + Get.delete(); + super.dispose(); + } +} diff --git a/lib/page/home_page/children/my_info.dart b/making_school_asignment_app/lib/page/home_page/children/my_info.dart similarity index 96% rename from lib/page/home_page/children/my_info.dart rename to making_school_asignment_app/lib/page/home_page/children/my_info.dart index e8c474e..6a73a1a 100644 --- a/lib/page/home_page/children/my_info.dart +++ b/making_school_asignment_app/lib/page/home_page/children/my_info.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/user_info.dart'; -import 'package:school_asignment_app/common/job/user_info_detail.dart'; -import 'package:school_asignment_app/common/store/app_storage_key.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; -import 'package:school_asignment_app/common/utils/storage.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/job/user_info.dart'; +import 'package:making_school_asignment_app/common/job/user_info_detail.dart'; +import 'package:making_school_asignment_app/common/store/app_storage_key.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/common/utils/storage.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; class MyInfo extends StatefulWidget { const MyInfo({super.key}); diff --git a/lib/page/home_page/children/quick_data_check/quick_data_check_binding.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_binding.dart similarity index 100% rename from lib/page/home_page/children/quick_data_check/quick_data_check_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_binding.dart diff --git a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_logic.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_logic.dart new file mode 100644 index 0000000..97d035e --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_logic.dart @@ -0,0 +1,33 @@ +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:get/get.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; + +import 'quick_data_check_state.dart'; + +class QuickDataCheckLogic extends GetxController with RequestToolMixin { + final QuickDataCheckState state = QuickDataCheckState(); + + @override + void onInit() { + super.onInit(); + state.homeworkId.value = Get.arguments['homeworkId'] ?? ''; + state.classId.value = Get.arguments['classId'] ?? ''; + state.className.value = Get.arguments['className'] ?? ''; + state.grade = Get.arguments['grade']; + EasyLoading.show(status: 'loading...'); + getWorkData(); + } + + void getWorkData() async { + HomeworkDetails data = await getClient().getHomeworkDetails(state.homeworkId.value, state.classId.value); + state.dataCount = Utils.getHomeworkData(data); + state.homeData = data; + state.kgReport.value = data.questions.where((w) => w.questionType == 1).toList(); + state.zgReport.value = data.questions.where((w) => w.questionType == 2).toList(); + state.studentList.value = data.students; + state.hasData.value = true; + EasyLoading.dismiss(); + } +} diff --git a/lib/page/home_page/children/quick_data_check/quick_data_check_state.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_state.dart similarity index 67% rename from lib/page/home_page/children/quick_data_check/quick_data_check_state.dart rename to making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_state.dart index e99610a..43ef248 100644 --- a/lib/page/home_page/children/quick_data_check/quick_data_check_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_state.dart @@ -1,5 +1,5 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; class QuickDataCheckState { QuickDataCheckState() { @@ -34,7 +34,21 @@ class CountData extends Object { int? studentCount = 0; List? priorityStudents = []; int? studentSubmitCount = 0; - CountData({this.kgtOkCount, this.kgtDtlCount,this.kgtAnswerRate,this.kgtAnswerCount,this.kgtOkRate,this.studentCount, - this.kgtCount,this.zgtAnswerCount,this.zgtOkCount,this.zgtDtlCount,this.zgtAnswerRate,this.zgtOkRate,this.zgtCount,this.priorityStudents, - this.studentSubmitCount,}); + CountData({ + this.kgtOkCount, + this.kgtDtlCount, + this.kgtAnswerRate, + this.kgtAnswerCount, + this.kgtOkRate, + this.studentCount, + this.kgtCount, + this.zgtAnswerCount, + this.zgtOkCount, + this.zgtDtlCount, + this.zgtAnswerRate, + this.zgtOkRate, + this.zgtCount, + this.priorityStudents, + this.studentSubmitCount, + }); } diff --git a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart new file mode 100644 index 0000000..69bfd6b --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart @@ -0,0 +1,280 @@ +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:get_storage/get_storage.dart'; +import 'package:percent_indicator/percent_indicator.dart'; +import 'package:making_school_asignment_app/common/utils/enum_untils.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/widget/report_table.dart'; + +import 'quick_data_check_logic.dart'; + +class QuickDataCheckPage extends StatefulWidget { + const QuickDataCheckPage({Key? key}) : super(key: key); + + @override + State createState() => _QuickDataCheckPageState(); +} + +class _QuickDataCheckPageState extends State { + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return AnnotatedRegion( + value: const SystemUiOverlayStyle( + statusBarColor: Colors.transparent, + systemNavigationBarIconBrightness: Brightness.light, + statusBarIconBrightness: Brightness.light, + statusBarBrightness: Brightness.dark, + ), + child: Container( + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + height: MediaQuery.of(context).size.height, + decoration: const BoxDecoration( + gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ + Color(0xFF6889FD), + Color(0xFFF5F5F5), + ], stops: [ + 0.09, + 0.3 + ])), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + IconButton( + icon: const Icon(Icons.arrow_back_ios, color: Colors.white), + onPressed: () => Navigator.of(context).pop(), + ), + Expanded( + child: Padding( + padding: EdgeInsets.only(right: 8.r), + child: Center( + child: Text( + '数据快查', + style: TextStyle(fontSize: 14.sp, color: Colors.white), + )), + )), + const ReturnToHomepage( + bgColor: Colors.white, + ), + ], + ), + SizedBox(height: 10.r), + Obx(() { + if (state.hasData.value) { + return Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 14.r, top: 2.r), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/job_report_class_icon.png', + width: 22.r, + height: 22.r, + ), + SizedBox( + width: 6.r, + ), + Obx(() { + return Text( + '${EnumUtils.formatGrade(state.grade)}${state.className.value}', + style: TextStyle(fontSize: 14.r, color: Colors.white), + ); + }) + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(vertical: 15.r, horizontal: 15.r), + margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6.r))), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2.r, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 12.r, + height: 12.r, + decoration: BoxDecoration(color: const Color(0xFF4CC793), borderRadius: BorderRadius.all(Radius.circular(7.r))), + ), + SizedBox( + width: 6.r, + ), + Text( + '已提交', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF333333)), + ), + SizedBox( + width: 35.r, + ), + Container( + width: 12.r, + height: 12.r, + decoration: BoxDecoration(color: const Color(0xFF6888FD), borderRadius: BorderRadius.all(Radius.circular(7.r))), + ), + SizedBox( + width: 6.r, + ), + Text( + '未提交', + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF333333)), + ) + ], + ), + SizedBox( + height: 2.r, + ), + //环形图 + SizedBox( + height: MediaQuery.of(context).size.width * 0.3, + child: PieChart( + PieChartData( + borderData: FlBorderData(show: false), + sectionsSpace: 0, + centerSpaceRadius: MediaQuery.of(context).size.width * 0.06, + sections: [ + PieChartSectionData( + color: const Color(0xFF4CC793), + value: state.dataCount.studentSubmitCount! / state.dataCount.studentCount! * 100, + radius: MediaQuery.of(context).size.width * 0.07 + 5, + title: '${state.dataCount.studentSubmitCount}人', + titleStyle: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + PieChartSectionData( + color: const Color(0xFF6888FD), + value: + (state.dataCount.studentCount! - state.dataCount.studentSubmitCount!) / state.dataCount.studentCount! * 100, + radius: MediaQuery.of(context).size.width * 0.07, + title: '${state.dataCount.studentCount! - state.dataCount.studentSubmitCount!}人', + titleStyle: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + ], + ), + ), + ), + // 客观进度条 + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '客观题答题进度', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)), + ), + Text( + '${state.dataCount.kgtAnswerRate!.toStringAsFixed(0)}%', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF333333)), + ), + ], + ), + SizedBox(height: 6.r), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 10, + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 9.h, + animationDuration: 2500, + percent: state.dataCount.kgtAnswerRate! / 100, + progressColor: const Color(0xFFFF7F22), + backgroundColor: const Color(0xFFEAEAEA), + barRadius: Radius.circular(10.r), + )), + ], + ), + SizedBox(height: 20.r), + // 主观进度条 + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '主观题答题进度', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)), + ), + Text( + '${state.dataCount.zgtAnswerRate!.toStringAsFixed(0)}%', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF333333)), + ), + ], + ), + SizedBox(height: 6.r), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 10, + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 9.h, + animationDuration: 2500, + percent: state.dataCount.zgtAnswerRate! / 100, + progressColor: const Color(0xFFFF7F22), + backgroundColor: const Color(0xFFEAEAEA), + barRadius: Radius.circular(10.r), + )), + ], + ), + ], + ), + ), + QuickDataCheckBottom( + jobData: state.studentList.value, + jobId: state.homeworkId.value, + kgCount: state.dataCount.kgtDtlCount!, + zgCount: state.dataCount.zgtDtlCount!, + ), + //客观题、主观题 + 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)), + ], + ), + )); + } else { + return Padding(padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), child: const MyEmptyWidget()); + } + }) + ], + ), + ), + ); + } + + @override + void dispose() { + Get.delete(); + super.dispose(); + } +} diff --git a/lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart similarity index 68% rename from lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart rename to making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart index 3694375..a045efa 100644 --- a/lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart @@ -1,10 +1,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/widget/report_table.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/widget/report_table.dart'; class KgtZgtTable extends StatefulWidget { final int studentCount; @@ -54,20 +54,14 @@ class _KgtZgtTableState extends State { children: [ Text( '客观题', - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF5C5C5C), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600), ), SizedBox( width: 10.r, ), Text( '${widget.kgtOkRate}%', - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF6888FD), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 14.sp, color: Color(0xFF6888FD), fontWeight: FontWeight.w600), ), ], ), @@ -75,10 +69,7 @@ class _KgtZgtTableState extends State { height: 6.r, ), SizedBox( - height: widget.kgReport.length > 10 - ? 300.r - : widget.kgReport.length * 40.r + - (Utils.isPad() == true ? 40.r : 65.r), + height: widget.kgReport.length > 10 ? 300.r : widget.kgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r), child: ReportTable( headList: const ['题', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'], bodyList: widget.kgReport, @@ -88,8 +79,7 @@ class _KgtZgtTableState extends State { studentCount: widget.studentCount, ), ), - if(widget.kgReport.isEmpty) - MyEmptyWidget(imgWidth:100.r,imgHeight: 100.r,font:8.sp), + if (widget.kgReport.isEmpty) MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp), ], ), ), @@ -109,20 +99,14 @@ class _KgtZgtTableState extends State { children: [ Text( '主观题', - style: TextStyle( - fontSize: 14.sp, - color: const Color(0xFF5C5C5C), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600), ), SizedBox( width: 6.r, ), Text( '${widget.zgtOkRate}%', - style: TextStyle( - fontSize: 14.sp, - color: const Color(0xFF6888FD), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 14.sp, color: const Color(0xFF6888FD), fontWeight: FontWeight.w600), ), ], ), @@ -130,10 +114,7 @@ class _KgtZgtTableState extends State { height: 10.r, ), SizedBox( - height: widget.zgReport.length > 10 - ? 300.r - : widget.zgReport.length * 40.r + - (Utils.isPad() == true ? 40.r : 65.r), + height: widget.zgReport.length > 10 ? 300.r : widget.zgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r), child: ReportTable( headList: const ['题', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况'], bodyList: widget.zgReport, @@ -144,8 +125,7 @@ class _KgtZgtTableState extends State { studentCount: widget.studentCount, ), ), - if(widget.zgReport.isEmpty) - MyEmptyWidget(imgWidth:100.r,imgHeight: 100.r,font:8.sp), + if (widget.zgReport.isEmpty) MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp), ], ), ), diff --git a/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart similarity index 88% rename from lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart rename to making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart index 563d5af..61e8a63 100644 --- a/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart'; class QuickDataCheckBottom extends StatefulWidget { final String jobId; @@ -10,9 +10,7 @@ class QuickDataCheckBottom extends StatefulWidget { final int zgCount; final List? jobData; - const QuickDataCheckBottom( - {Key? key, required this.jobId, required this.jobData, required this.kgCount, required this.zgCount}) - : super(key: key); + const QuickDataCheckBottom({Key? key, required this.jobId, required this.jobData, required this.kgCount, required this.zgCount}) : super(key: key); @override State createState() => _QuickDataCheckBottomState(); @@ -29,7 +27,7 @@ class _QuickDataCheckBottomState extends State { super.initState(); showList.value = widget.jobData!; for (var e in widget.jobData!) { - if(e.priorityAnnotate!){ + if (e.priorityAnnotate!) { followList.add(e); } } @@ -40,9 +38,7 @@ class _QuickDataCheckBottomState extends State { return Container( padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r), margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(6.r))), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6.r))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -63,7 +59,6 @@ class _QuickDataCheckBottomState extends State { return b.state.compareTo(a.state); }); } - }, child: Obx(() { return Row( @@ -85,8 +80,7 @@ class _QuickDataCheckBottomState extends State { ), Text( sortType.value ? '已提交排序' : '未提交排序', - style: - TextStyle(fontSize: 12.sp, color: Color(0xFF707070)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF707070)), ), ], ); @@ -131,8 +125,7 @@ class _QuickDataCheckBottomState extends State { ), Text( '看关注学生', - style: TextStyle( - fontSize: 12.sp, color: const Color(0xFF707070)), + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF707070)), ), ], ); @@ -147,8 +140,7 @@ class _QuickDataCheckBottomState extends State { children: [ Text( '注:', - style: - TextStyle(fontSize: 8.sp, color: const Color(0xFF717171)), + style: TextStyle(fontSize: 8.sp, color: const Color(0xFF717171)), ), Container( width: 10.r, @@ -226,8 +218,7 @@ class _QuickDataCheckBottomState extends State { ), Text( '未做', - style: TextStyle( - fontSize: 8.sp, color: const Color(0xFF717171)), + style: TextStyle(fontSize: 8.sp, color: const Color(0xFF717171)), ), ], ), @@ -236,8 +227,7 @@ class _QuickDataCheckBottomState extends State { ), Obx(() { return SizedBox( - height: showList.value.length > 5 ? 350.r : showList.value - .length * 50.r + 40.r, + height: showList.value.length > 5 ? 350.r : showList.value.length * 50.r + 40.r, child: QuickStudentDataTable( headList: ['学生姓名', '客观题', '主观题', '客观题状态', '主观题状态', '未批阅'], bodyList: showList.value, diff --git a/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart similarity index 55% rename from lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart rename to making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart index 72042b0..61d0f12 100644 --- a/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart @@ -2,8 +2,8 @@ import 'package:data_table_2/data_table_2.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; class QuickStudentDataTable extends StatefulWidget { final List headList; @@ -36,7 +36,6 @@ class _QuickStudentDataTableState extends State { int? _sortColumnIndex; final bool _sortAscending = true; - DataRow _getRow(int index, [Color? color]) { assert(index >= 0); Students item = widget.bodyList[index]; @@ -50,7 +49,7 @@ class _QuickStudentDataTableState extends State { cells: [ DataCell(InkWell( onTap: () { - Get.toNamed(Routes.studentPersonalPage,arguments: {'studentId':item.studentId,'homeworkId':widget.jobId}); + Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': item.studentId, 'homeworkId': widget.jobId}); }, child: Center( child: Padding( @@ -59,9 +58,7 @@ class _QuickStudentDataTableState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text(item.studentName!, - style: - TextStyle(fontSize: 10.sp, color: const Color(0xFF6888FD),overflow: TextOverflow.ellipsis)), + Text(item.studentName!, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF6888FD), overflow: TextOverflow.ellipsis)), SizedBox( width: 5.r, ), @@ -81,15 +78,9 @@ class _QuickStudentDataTableState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - '${item.kgtOkCount}', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF4CC793))), - Text( - '/', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), - Text( - '${item.kgtErrorCount}', - style: TextStyle(fontSize: 10.sp, color: Color(0xFFFF7474))), + Text('${item.kgtOkCount}', style: TextStyle(fontSize: 10.sp, color: Color(0xFF4CC793))), + Text('/', style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), + Text('${item.kgtErrorCount}', style: TextStyle(fontSize: 10.sp, color: Color(0xFFFF7474))), ], ), ), @@ -100,15 +91,9 @@ class _QuickStudentDataTableState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - '${item.zgtOkCount}', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF4CC793))), - Text( - '/', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), - Text( - '${item.zgtErrorCount}', - style: TextStyle(fontSize: 10.sp, color: Color(0xFFFF7474))), + Text('${item.zgtOkCount}', style: TextStyle(fontSize: 10.sp, color: Color(0xFF4CC793))), + Text('/', style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), + Text('${item.zgtErrorCount}', style: TextStyle(fontSize: 10.sp, color: Color(0xFFFF7474))), ], ), ), @@ -130,18 +115,16 @@ class _QuickStudentDataTableState extends State { decoration: BoxDecoration( color: kgInfo.state == 0 ? const Color(0xFFD3D3D3) - : kgInfo.state == 1?Colors.white:kgInfo.state == 2 - ? const Color(0xFFFF7474) - : const Color(0xFF4CC793), + : kgInfo.state == 1 + ? Colors.white + : kgInfo.state == 2 + ? const Color(0xFFFF7474) + : const Color(0xFF4CC793), borderRadius: BorderRadius.all(Radius.circular(7.r))), child: Center( child: Text( kgInfo.questionNo.toString(), - style: TextStyle( - fontSize: 8.sp, - color: kgInfo.state == 1 - ? Color(0xFF525252) - : Colors.white), + style: TextStyle(fontSize: 8.sp, color: kgInfo.state == 1 ? Color(0xFF525252) : Colors.white), )), ); })), @@ -165,40 +148,36 @@ class _QuickStudentDataTableState extends State { decoration: BoxDecoration( color: kgInfo.state == 0 ? const Color(0xFFD3D3D3) - : kgInfo.state == 1?Colors.white:kgInfo.state == 2 - ? const Color(0xFFFF7474) - : const Color(0xFF4CC793), + : kgInfo.state == 1 + ? Colors.white + : kgInfo.state == 2 + ? const Color(0xFFFF7474) + : const Color(0xFF4CC793), borderRadius: BorderRadius.all(Radius.circular(7.r))), child: Center( child: Text( kgInfo.questionNo.toString(), - style: TextStyle( - fontSize: 8.sp, - color: kgInfo.state == 1 - ? Color(0xFF525252) - : Colors.white), + style: TextStyle(fontSize: 8.sp, color: kgInfo.state == 1 ? Color(0xFF525252) : Colors.white), )), ); })), ), ), ), - if(widget.hasUnrated) - DataCell(Center( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text('${item.zgtUnrated}', - style: - TextStyle(fontSize: 10.sp, color: const Color(0xFF6888FD))), - ), - )), + if (widget.hasUnrated) + DataCell(Center( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 5.r), + child: Text('${item.zgtUnrated}', style: TextStyle(fontSize: 10.sp, color: const Color(0xFF6888FD))), + ), + )), ], ); } @override Widget build(BuildContext context) { - if(!widget.hasUnrated){ + if (!widget.hasUnrated) { widget.headList.removeLast(); } return DataTable2( @@ -209,14 +188,10 @@ class _QuickStudentDataTableState extends State { bottomMargin: 0, dataRowHeight: 50.r, border: const TableBorder( - horizontalInside: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid), - bottom: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid), - verticalInside: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid)), - headingRowColor: MaterialStateProperty.resolveWith((states) => - widget.fixedCols! > 0 ? Colors.white : Colors.transparent), + horizontalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid), + bottom: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid), + verticalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid)), + headingRowColor: MaterialStateProperty.resolveWith((states) => widget.fixedCols! > 0 ? Colors.white : Colors.transparent), headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)), fixedColumnsColor: Color(0xFFE6E6E6), fixedCornerColor: Colors.grey[400], @@ -228,42 +203,32 @@ class _QuickStudentDataTableState extends State { // onSelectAll: (val) => setState(() => selectAll(val)), columns: List.generate(widget.headList.length, (index) { var item = widget.headList[index]; - return index == 1?DataColumn2( - label: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text(item, - style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), - Text('(${widget.kgCount})', - style: TextStyle(fontSize: 8.sp, color: Color(0xFF505767))), - ] - ), - // size: ColumnSize.S, - fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / widget.headList.length, - ):index == 2?DataColumn2( - label: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text(item, - style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), - Text('(${widget.zgCount})', - style: TextStyle(fontSize: 8.sp, color: Color(0xFF505767))), - ] - ), - // size: ColumnSize.S, - fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / widget.headList.length, - ):DataColumn2( - label: Center( - child: Text(item, - style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), - ), - // size: ColumnSize.S, - fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / widget.headList.length, - ); + return index == 1 + ? DataColumn2( + label: Row(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ + Text(item, style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), + Text('(${widget.kgCount})', style: TextStyle(fontSize: 8.sp, color: Color(0xFF505767))), + ]), + // size: ColumnSize.S, + fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / widget.headList.length, + ) + : index == 2 + ? DataColumn2( + label: Row(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ + Text(item, style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), + Text('(${widget.zgCount})', style: TextStyle(fontSize: 8.sp, color: Color(0xFF505767))), + ]), + // size: ColumnSize.S, + fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / widget.headList.length, + ) + : DataColumn2( + label: Center( + child: Text(item, style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), + ), + // size: ColumnSize.S, + fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / widget.headList.length, + ); }), - rows: List.generate(widget.bodyList.length, - (index) => _getRow(index, Color(0xFFF5F5F5)))); + rows: List.generate(widget.bodyList.length, (index) => _getRow(index, Color(0xFFF5F5F5)))); } } diff --git a/lib/page/home_page/children/quick_data_check/widget/report_table.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart similarity index 61% rename from lib/page/home_page/children/quick_data_check/widget/report_table.dart rename to making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart index 15487e0..0aa29e3 100644 --- a/lib/page/home_page/children/quick_data_check/widget/report_table.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart @@ -2,14 +2,13 @@ import 'package:data_table_2/data_table_2.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/annotated_class.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/utils/toast_utils.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/imgDialog.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; - +import 'package:making_school_asignment_app/common/job/annotated_class.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/utils/toast_utils.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/imgDialog.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; class ReportTable extends StatefulWidget { final List headList; @@ -40,20 +39,14 @@ class _ReportTableState extends State { int? _sortColumnIndex; final bool _sortAscending = true; - void showPeopleListDialog( - {required BuildContext context, - required String title, - required String questionNo, - required List arr, - List? dcList}) { + void showPeopleListDialog({required BuildContext context, required String title, required String questionNo, required List arr, List? dcList}) { showDialog( context: context, builder: (BuildContext context) { return AlertDialog( // insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r), contentPadding: EdgeInsets.all(20.r), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(15.r))), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))), content: SizedBox( width: MediaQuery.of(context).size.width * 0.7, height: MediaQuery.of(context).size.height * 0.7, @@ -63,10 +56,7 @@ class _ReportTableState extends State { Center( child: Text( title, - style: TextStyle( - fontSize: 15.sp, - color: const Color(0xFF3C3C3C), - fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 15.sp, color: const Color(0xFF3C3C3C), fontWeight: FontWeight.w500), ), ), SizedBox( @@ -76,18 +66,15 @@ class _ReportTableState extends State { children: [ Text( widget.isKG == true ? '主观题' : '客观题', - style: TextStyle( - fontSize: 14.sp, color: const Color(0xFF436CFF)), + style: TextStyle(fontSize: 14.sp, color: const Color(0xFF436CFF)), ), Text( '―', - style: TextStyle( - fontSize: 14.sp, color: const Color(0xFF436CFF)), + style: TextStyle(fontSize: 14.sp, color: const Color(0xFF436CFF)), ), Text( '第$questionNo题', - style: TextStyle( - fontSize: 14.sp, color: Color(0xFF436CFF)), + style: TextStyle(fontSize: 14.sp, color: Color(0xFF436CFF)), ), ], ), @@ -102,27 +89,21 @@ class _ReportTableState extends State { child: Center( child: Text( '未作答人', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF6A6A6A)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)), ))), Expanded( flex: 1, child: Center( child: Text( '答对人数', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF6A6A6A)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)), ))), Expanded( flex: 1, child: Center( child: Text( '答错人', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF6A6A6A)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)), ))), ], ) @@ -130,8 +111,7 @@ class _ReportTableState extends State { padding: EdgeInsets.only(left: 15.r), child: Text( title, - style: TextStyle( - fontSize: 12.sp, color: Color(0xFF6A6A6A)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)), ), ), SizedBox( @@ -145,51 +125,41 @@ class _ReportTableState extends State { var item = arr[index]; return Container( padding: EdgeInsets.symmetric(vertical: 5.r), - color: - index.isOdd ? Colors.white : Color(0xFFF0F0F0), + color: index.isOdd ? Colors.white : Color(0xFFF0F0F0), child: Row( children: [ Expanded( flex: 1, child: InkWell( onTap: () { - goQuickCheckPersonalPath( - item['noAnswerStudents'].studentId); + goQuickCheckPersonalPath(item['noAnswerStudents'].studentId); }, child: Center( child: Text( - item['noAnswerStudents']?.studentName??'--', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), + item['noAnswerStudents']?.studentName ?? '--', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), )))), Expanded( flex: 1, child: InkWell( onTap: () { - goQuickCheckPersonalPath( - item['answerOkStudents'].studentId); + goQuickCheckPersonalPath(item['answerOkStudents'].studentId); }, child: Center( child: Text( - item['answerOkStudents']?.studentName??'--', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), + item['answerOkStudents']?.studentName ?? '--', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), )))), Expanded( flex: 1, child: InkWell( onTap: () { - goQuickCheckPersonalPath( - item['answerNgStudents'].studentId); + goQuickCheckPersonalPath(item['answerNgStudents'].studentId); }, child: Center( child: Text( - item['answerNgStudents']?.studentName??'--', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), + item['answerNgStudents']?.studentName ?? '--', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), )))), ], ), @@ -210,16 +180,11 @@ class _ReportTableState extends State { goQuickCheckPersonalPath(item.studentId); }, child: Container( - padding: EdgeInsets.symmetric( - vertical: 5.r, horizontal: 15.r), - color: index.isOdd - ? Colors.white - : Color(0xFFF0F0F0), + padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 15.r), + color: index.isOdd ? Colors.white : Color(0xFFF0F0F0), child: Text( - item.studentName!??'--', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), + item.studentName! ?? '--', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), ), ), ); @@ -237,64 +202,47 @@ class _ReportTableState extends State { void goQuickCheckPersonalPath(id) { if (id != null) { - Get.toNamed(Routes.studentPersonalPage,arguments: {'studentId':id,'homeworkId':widget.jobId}); + Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': id, 'homeworkId': widget.jobId}); } } - void zdHandle(BuildContext context, String title, String questionNo, - List noAnswerStudents, List answerNgStudents, List answerOkStudents) { + void zdHandle(BuildContext context, String title, String questionNo, List noAnswerStudents, List answerNgStudents, List answerOkStudents) { List list = []; // Questions student = Questions('','',-1,-1,'',-1,'','',[],-1,-1,[] as double?); - if (noAnswerStudents.length > answerNgStudents.length && - noAnswerStudents.length > answerOkStudents.length) { + if (noAnswerStudents.length > answerNgStudents.length && noAnswerStudents.length > answerOkStudents.length) { for (int i = 0; i < noAnswerStudents.length; i++) { var obj = { 'noAnswerStudents': noAnswerStudents[i], - 'answerNgStudents': - answerNgStudents.length > i ? answerNgStudents[i] : null, - 'answerOkStudents': - answerOkStudents.length > i ? answerOkStudents[i] : null + 'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null, + 'answerOkStudents': answerOkStudents.length > i ? answerOkStudents[i] : null }; list.add(obj); } - } else if (answerNgStudents.length > noAnswerStudents.length && - answerNgStudents.length > answerOkStudents.length) { + } else if (answerNgStudents.length > noAnswerStudents.length && answerNgStudents.length > answerOkStudents.length) { for (int i = 0; i < answerNgStudents.length; i++) { var obj = { - 'noAnswerStudents': - noAnswerStudents.length > i ? noAnswerStudents[i] : null, + 'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null, 'answerNgStudents': answerNgStudents[i], - 'answerOkStudents': - answerOkStudents.length > i ? answerOkStudents[i] : null + 'answerOkStudents': answerOkStudents.length > i ? answerOkStudents[i] : null }; list.add(obj); } - } else if (answerOkStudents.length > noAnswerStudents.length && - answerOkStudents.length > answerNgStudents.length) { + } else if (answerOkStudents.length > noAnswerStudents.length && answerOkStudents.length > answerNgStudents.length) { for (int i = 0; i < answerOkStudents.length; i++) { var obj = { - 'noAnswerStudents': - noAnswerStudents.length > i ? noAnswerStudents[i] : null, - 'answerNgStudents': - answerNgStudents.length > i ? answerNgStudents[i] : null, + 'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null, + 'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null, 'answerOkStudents': answerOkStudents[i] }; list.add(obj); } } - showPeopleListDialog( - context: context, - title: title, - questionNo: questionNo, - arr: list, - dcList: []); + showPeopleListDialog(context: context, title: title, questionNo: questionNo, arr: list, dcList: []); } - void dcHandle( - BuildContext context, String title, String questionNo, List arr) { - showPeopleListDialog( - context: context, title: title, questionNo: questionNo, arr: arr); + void dcHandle(BuildContext context, String title, String questionNo, List arr) { + showPeopleListDialog(context: context, title: title, questionNo: questionNo, arr: arr); } DataRow _getRow(int index, [Color? color]) { @@ -307,21 +255,18 @@ class _ReportTableState extends State { DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text(item.questionNo.toString(), - style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))), + child: Text(item.questionNo.toString(), style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))), ), )), DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text('${item.answerRate.toStringAsFixed(0)}%', - style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))), + child: Text('${item.answerRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))), ), )), DataCell(InkWell( onTap: () { - zdHandle(context, '作答人数', item.questionNo.toString(), item.noAnswerStudents, - item.answerNgStudents, item.answerOkStudents); + zdHandle(context, '作答人数', item.questionNo.toString(), item.noAnswerStudents, item.answerNgStudents, item.answerOkStudents); }, child: Center( child: Padding( @@ -329,9 +274,7 @@ class _ReportTableState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text('${item.answerCount}/${widget.studentCount}', - style: - TextStyle(fontSize: 10.sp, color: const Color(0xFF4CC793))), + Text('${item.answerCount}/${widget.studentCount}', style: TextStyle(fontSize: 10.sp, color: const Color(0xFF4CC793))), Image.asset( 'assets/images/green_right_icon.png', width: 12.r, @@ -345,8 +288,7 @@ class _ReportTableState extends State { DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text('${item.okRate.toStringAsFixed(0)}%', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), + child: Text('${item.okRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), ), )), DataCell(Center( @@ -357,30 +299,21 @@ class _ReportTableState extends State { onTap: () { if (item.questionPicture == null) { ToastUtils.showInfo('当前试题没有原题'); - }else{ - ImageDialog.showImgDialog(context,item.questionPicture); + } else { + ImageDialog.showImgDialog(context, item.questionPicture); } }, - child: Text('原题', - style: TextStyle( - fontSize: 10.sp, - color: widget.isKG == true - ? const Color(0xFFFF8A00) - : const Color(0xFF4CC793))), + child: + Text('原题', style: TextStyle(fontSize: 10.sp, color: widget.isKG == true ? const Color(0xFFFF8A00) : const Color(0xFF4CC793))), ) : Text(item.answer, - style: TextStyle( - fontSize: 10.sp, - color: widget.isKG == true - ? const Color(0xFFFF8A00) - : const Color(0xFF4CC793))), + style: TextStyle(fontSize: 10.sp, color: widget.isKG == true ? const Color(0xFFFF8A00) : const Color(0xFF4CC793))), ), )), DataCell(InkWell( onTap: () { // List parts = item.priorityGeneral.split('人'); - dcHandle(context, '优先批阅答错人', item.questionNo.toString(), - item.priorityInfo); + dcHandle(context, '优先批阅答错人', item.questionNo.toString(), item.priorityInfo); }, child: Center( child: Padding( @@ -388,9 +321,7 @@ class _ReportTableState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text('${item.priorityInfo.length}人答错', - style: - TextStyle(fontSize: 10.sp, color: const Color(0xFF6888FD))), + Text('${item.priorityInfo.length}人答错', style: TextStyle(fontSize: 10.sp, color: const Color(0xFF6888FD))), Image.asset( 'assets/images/job_data_right_icon.png', width: 10.r, @@ -416,14 +347,10 @@ class _ReportTableState extends State { dataRowHeight: 40.r, bottomMargin: 0, border: const TableBorder( - horizontalInside: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid), - bottom: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid), - verticalInside: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid)), - headingRowColor: MaterialStateProperty.resolveWith((states) => - widget.fixedCols! > 0 ? Colors.white : Colors.transparent), + horizontalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid), + bottom: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid), + verticalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid)), + headingRowColor: MaterialStateProperty.resolveWith((states) => widget.fixedCols! > 0 ? Colors.white : Colors.transparent), headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)), fixedColumnsColor: Color(0xFFE6E6E6), fixedCornerColor: Colors.grey[400], @@ -441,8 +368,7 @@ class _ReportTableState extends State { var item = widget.headList[index]; return DataColumn2( label: Center( - child: Text(item, - style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), + child: Text(item, style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), ), // size: ColumnSize.S, fixedWidth: index == 0 @@ -450,12 +376,10 @@ class _ReportTableState extends State { : widget.headList.length > 6 ? 80.r : isPadFlag - ? (MediaQuery.of(context).size.width - 8.r) / - widget.headList.length + ? (MediaQuery.of(context).size.width - 8.r) / widget.headList.length : 85.r, ); }), - rows: List.generate(widget.bodyList.length, - (index) => _getRow(index, Color(0xFFF5F5F5)))); + rows: List.generate(widget.bodyList.length, (index) => _getRow(index, Color(0xFFF5F5F5)))); } } diff --git a/lib/page/home_page/children/read_over/read_over_binding.dart b/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_binding.dart similarity index 100% rename from lib/page/home_page/children/read_over/read_over_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/read_over/read_over_binding.dart diff --git a/lib/page/home_page/children/read_over/read_over_logic.dart b/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_logic.dart similarity index 89% rename from lib/page/home_page/children/read_over/read_over_logic.dart rename to making_school_asignment_app/lib/page/home_page/children/read_over/read_over_logic.dart index 819ba22..5c09c9a 100644 --- a/lib/page/home_page/children/read_over/read_over_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_logic.dart @@ -2,15 +2,15 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/enum_subject.dart'; -import 'package:school_asignment_app/common/job/work_student.dart'; -import 'package:school_asignment_app/common/job/work_student_params.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/common/job/enum_subject.dart'; +import 'package:making_school_asignment_app/common/job/work_student.dart'; +import 'package:making_school_asignment_app/common/job/work_student_params.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; import 'read_over_state.dart'; -class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProviderStateMixin{ +class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProviderStateMixin { final ReadOverState state = ReadOverState(); late TabController tabController; late TabController tabController2; @@ -37,16 +37,17 @@ class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProvi vsync: this, ); tabController2 = TabController(length: 4, vsync: this); - EasyLoading.show(status:'loading...'); + EasyLoading.show(status: 'loading...'); getList(); } + //待批阅列表 void getList() async { WorkStudent data = WorkStudent([], 0); - if(state.tabIndex.value == 0){ + if (state.tabIndex.value == 0) { params.pageNumber = state.page; data = await getClient().getUnAnnotateList(params); - }else{ + } else { params2.pageNumber = state.page; data = await getClient().getAnnotatedList(params2); } @@ -57,6 +58,7 @@ class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProvi EasyLoading.dismiss(); print('state.workList.length=${state.workList.length}'); } + /// 刷新方法 Future onMyRefresh(EasyRefreshController controller, int tab) async { /* params.page = RequestConfig.basePage.page; @@ -68,7 +70,7 @@ class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProvi getList(); } - void getCollect(item) async{ + void getCollect(item) async { await getClient().getCollect(item.id); getList(); } diff --git a/lib/page/home_page/children/read_over/read_over_state.dart b/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_state.dart similarity index 80% rename from lib/page/home_page/children/read_over/read_over_state.dart rename to making_school_asignment_app/lib/page/home_page/children/read_over/read_over_state.dart index 1ca5173..9d46958 100644 --- a/lib/page/home_page/children/read_over/read_over_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_state.dart @@ -1,5 +1,5 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/work_student.dart'; +import 'package:making_school_asignment_app/common/job/work_student.dart'; class ReadOverState { ReadOverState() { diff --git a/lib/page/home_page/children/read_over/read_over_view.dart b/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_view.dart similarity index 70% rename from lib/page/home_page/children/read_over/read_over_view.dart rename to making_school_asignment_app/lib/page/home_page/children/read_over/read_over_view.dart index 4d28cef..1698c93 100644 --- a/lib/page/home_page/children/read_over/read_over_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_view.dart @@ -5,17 +5,18 @@ import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:functional_widget_annotation/functional_widget_annotation.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/work_student.dart'; -import 'package:school_asignment_app/common/utils/enum_untils.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/page/home_page/children/read_over/widget/task_list_item.dart'; -import 'package:school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/job/work_student.dart'; +import 'package:making_school_asignment_app/common/utils/enum_untils.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/page/home_page/children/read_over/widget/task_list_item.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'package:syncfusion_flutter_datepicker/datepicker.dart'; import 'read_over_logic.dart'; +part 'read_over_view.g.dart'; class ReadOverPage extends StatefulWidget { const ReadOverPage({Key? key}) : super(key: key); @@ -47,8 +48,7 @@ class _ReadOverPageState extends State { children: [ Container( color: Colors.white, - margin: - EdgeInsets.only(top: MediaQuery.of(context).padding.top), + margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), padding: EdgeInsets.only(bottom: 9.h, top: 4.h), child: Row( crossAxisAlignment: CrossAxisAlignment.center, @@ -111,23 +111,14 @@ class _ReadOverPageState extends State { width: 140.w, alignment: Alignment.center, decoration: BoxDecoration( - color: state.tabIndex.value == 0 - ? const Color.fromRGBO( - 255, 255, 255, 1) - : null, - borderRadius: BorderRadius.all( - Radius.circular(8.r)), + color: state.tabIndex.value == 0 ? const Color.fromRGBO(255, 255, 255, 1) : null, + borderRadius: BorderRadius.all(Radius.circular(8.r)), ), child: quickText( '待批阅', size: 14.sp, - color: state.tabIndex.value == 0 - ? Theme.of(context).primaryColor - : const Color.fromRGBO( - 80, 94, 110, 1), - fontWeight: state.tabIndex.value == 0 - ? FontWeight.bold - : null, + color: state.tabIndex.value == 0 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1), + fontWeight: state.tabIndex.value == 0 ? FontWeight.bold : null, ), ); }), @@ -140,23 +131,14 @@ class _ReadOverPageState extends State { width: 140.w, alignment: Alignment.center, decoration: BoxDecoration( - color: state.tabIndex.value == 1 - ? const Color.fromRGBO( - 255, 255, 255, 1) - : null, - borderRadius: BorderRadius.all( - Radius.circular(8.r)), + color: state.tabIndex.value == 1 ? const Color.fromRGBO(255, 255, 255, 1) : null, + borderRadius: BorderRadius.all(Radius.circular(8.r)), ), child: quickText( '已批阅', size: 14.sp, - color: state.tabIndex.value == 1 - ? Theme.of(context).primaryColor - : const Color.fromRGBO( - 80, 94, 110, 1), - fontWeight: state.tabIndex.value == 1 - ? FontWeight.bold - : null, + color: state.tabIndex.value == 1 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1), + fontWeight: state.tabIndex.value == 1 ? FontWeight.bold : null, ), ); }), @@ -169,13 +151,9 @@ class _ReadOverPageState extends State { flex: 1, child: InkWell( onTap: () { - Get.toNamed(Routes.studentHistoryWorkPage, - arguments: {'page': 'set'}); + Get.toNamed(Routes.studentHistoryWorkPage, arguments: {'page': 'set'}); }, - child: Icon( - const IconData(0xe63e, fontFamily: "AlibabaIcon"), - color: const Color.fromRGBO(44, 48, 63, 1), - size: 24.sp), + child: Icon(const IconData(0xe63e, fontFamily: "AlibabaIcon"), color: const Color.fromRGBO(44, 48, 63, 1), size: 24.sp), ), ), ], @@ -188,23 +166,14 @@ class _ReadOverPageState extends State { controller: logic.tabController2, hasAll: true, jobType: 1, - customTime: logic.tabController2.index != 3 || - (logic.params2.startDate == null && - logic.params2.endDate == null) + customTime: logic.tabController2.index != 3 || (logic.params2.startDate == null && logic.params2.endDate == null) ? null : PickerDateRange( - logic.params2.startDate == null - ? null - : DateTime.parse( - logic.params2.startDate!), - logic.params2.endDate == null - ? null - : DateTime.parse(logic.params2.endDate!), + logic.params2.startDate == null ? null : DateTime.parse(logic.params2.startDate!), + logic.params2.endDate == null ? null : DateTime.parse(logic.params2.endDate!), ), onTimeFilter: (String? startTime, String? endTime) { - if (startTime == null && - endTime == null && - logic.tabController2.index == 3) { + if (startTime == null && endTime == null && logic.tabController2.index == 3) { logic.tabController2.animateTo(0); } logic.params2.endDate = endTime; @@ -215,20 +184,14 @@ class _ReadOverPageState extends State { }, refreshTime: (value) { if (value != null && value.startDate != null) { - state.customTimeStr.value = value.startDate - ?.toString() - .substring(0, 10) ?? - ''; + state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? ''; if (value.endDate != null) { - if (!Utils.isPad() && - value.startDate!.year == - value.endDate!.year) { + 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)}'; + state.customTimeStr.value = '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}'; } } } @@ -239,7 +202,7 @@ class _ReadOverPageState extends State { return IndexedStack( index: state.tabIndex.value, children: [ - $easyRefresh( + $EasyRefresh( controller: logic.refreshController1, tab: 1, type: state.active, @@ -247,7 +210,7 @@ class _ReadOverPageState extends State { onLoad: logic.onMyLoad, onRefresh: logic.onMyRefresh, logic: logic), - $easyRefresh( + $EasyRefresh( controller: logic.refreshController2, tab: 2, type: state.active, @@ -279,10 +242,8 @@ class _ReadOverPageState extends State { @swidget Widget $easyRefresh({ required EasyRefreshController controller, - required Future Function(EasyRefreshController controller, int tab) - onRefresh, - required Future Function(EasyRefreshController controller, int tab) - onLoad, + required Future Function(EasyRefreshController controller, int tab) onRefresh, + required Future Function(EasyRefreshController controller, int tab) onLoad, required List data, required int tab, required int type, @@ -302,8 +263,7 @@ Widget $easyRefresh({ footer: TaurusFooter(), child: completed && isPadFlag ? GridView( - padding: EdgeInsets.only( - top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), + padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, //横轴三个子widget mainAxisSpacing: 10.h, @@ -313,13 +273,11 @@ Widget $easyRefresh({ children: List.generate(data.length, (index) { Items item = data[index]; String subjectName = EnumUtils.formatSubject(item.subject); - return $reviewedItem( - jobTaskItem: item, type: type, subjectName: subjectName,logic: logic); + return $reviewedItem(jobTaskItem: item, type: type, subjectName: subjectName, logic: logic); }), ) : ListView.builder( - padding: EdgeInsets.only( - top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), + padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), itemBuilder: (context, index) { Items item = data[index]; return TaskListItem( @@ -338,21 +296,18 @@ Widget $easyRefresh({ } @swidget -Widget $reviewedItem( - {required Items jobTaskItem, - required int type, - required String subjectName, - required ReadOverLogic logic,}) { +Widget $reviewedItem({ + required Items jobTaskItem, + required int type, + required String subjectName, + required ReadOverLogic logic, +}) { EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w); return InkWell( onTap: () { - Get.toNamed(Routes.annotateClassPage, arguments: { - 'id': jobTaskItem.id, - 'name': jobTaskItem.name, - 'grade': jobTaskItem.grade, - 'completed': true - }); + Get.toNamed(Routes.annotateClassPage, + arguments: {'id': jobTaskItem.id, 'name': jobTaskItem.name, 'grade': jobTaskItem.grade, 'completed': true}); }, child: Container( padding: EdgeInsets.only(top: 10.h), @@ -383,9 +338,7 @@ Widget $reviewedItem( alignment: Alignment.center, padding: EdgeInsets.only(left: 2.w), decoration: BoxDecoration( - color: type == 1 - ? const Color.fromRGBO(104, 136, 253, 1) - : const Color.fromRGBO(255, 175, 56, 1), + color: type == 1 ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1), borderRadius: BorderRadius.only( topLeft: Radius.circular(14.r), topRight: Radius.circular(3.r), @@ -394,49 +347,39 @@ Widget $reviewedItem( ), ), margin: EdgeInsets.only(right: 4.w), - child: quickText(type == 1 ? '作业' : '考试', - color: Colors.white, size: 10.sp), + child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp), ), Expanded( - child: quickText(jobTaskItem.name, - size: 14.sp, - color: const Color.fromRGBO(70, 70, 70, 1), - maxLines: 2), + child: quickText(jobTaskItem.name, size: 14.sp, color: const Color.fromRGBO(70, 70, 70, 1), maxLines: 2), ) ], ), ), - if(jobTaskItem.isFixed!) - Padding( - padding: padEdg, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - '已订正', - style: TextStyle( - fontSize: 10.sp, color: const Color(0xFFF16262)), - ), - ], + if (jobTaskItem.isFixed!) + Padding( + padding: padEdg, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + '已订正', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFFF16262)), + ), + ], + ), ), - ), Padding( padding: padEdg, child: Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ quickText( - DateTime.parse(jobTaskItem.publishTime) - .toString() - .substring(0, 10), + DateTime.parse(jobTaskItem.publishTime).toString().substring(0, 10), color: const Color.fromRGBO(97, 97, 97, 1), size: 10.sp, fontWeight: FontWeight.w500, ), - quickText(' / ', - color: const Color.fromRGBO(76, 199, 147, 1), - size: 10.sp, - fontWeight: FontWeight.w500), + quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500), quickText( '参与班级:', color: const Color.fromRGBO(76, 199, 147, 1), @@ -447,10 +390,7 @@ Widget $reviewedItem( color: const Color.fromRGBO(76, 199, 147, 1), size: 10.sp, ), - quickText(' / ', - color: const Color.fromRGBO(116, 145, 253, 1), - size: 10.sp, - fontWeight: FontWeight.w500), + quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 10.sp, fontWeight: FontWeight.w500), quickText( '科目:$subjectName', color: const Color.fromRGBO(116, 145, 253, 1), @@ -470,9 +410,7 @@ Widget $reviewedItem( Container( padding: EdgeInsets.symmetric(vertical: 6.h), decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(6.r), - bottomRight: Radius.circular(6.r)), + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), color: Colors.white, boxShadow: const [ BoxShadow( @@ -488,21 +426,18 @@ Widget $reviewedItem( Expanded( flex: 1, child: InkWell( - onTap: (){ - if(!jobTaskItem.isFixed!){ - EasyLoading.show(status:'loading...'); + onTap: () { + if (!jobTaskItem.isFixed!) { + EasyLoading.show(status: 'loading...'); logic.getCollect(jobTaskItem); } }, child: Container( alignment: Alignment.center, decoration: BoxDecoration( - border: Border( - right: BorderSide( - width: 1.r, color: const Color(0xFFDCDCDC))), + border: Border(right: BorderSide(width: 1.r, color: const Color(0xFFDCDCDC))), ), - child: quickText('收集订正', - color: const Color(0xFF4CC793), size: 11.sp), + child: quickText('收集订正', color: const Color(0xFF4CC793), size: 11.sp), ), ), ), @@ -510,17 +445,12 @@ Widget $reviewedItem( flex: 1, child: InkWell( onTap: () { - Get.toNamed(Routes.jobReportPage, arguments: { - 'title': jobTaskItem.name, - 'homeworkId': jobTaskItem.id, - 'grade': jobTaskItem.grade - }); + Get.toNamed(Routes.jobReportPage, + arguments: {'title': jobTaskItem.name, 'homeworkId': jobTaskItem.id, 'grade': jobTaskItem.grade}); }, child: Container( alignment: Alignment.center, - child: quickText('查看报告', - color: const Color.fromRGBO(118, 118, 118, 1), - size: 11.sp), + child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 11.sp), ), ), ), diff --git a/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_view.g.dart b/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_view.g.dart new file mode 100644 index 0000000..4e65044 --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/read_over/read_over_view.g.dart @@ -0,0 +1,104 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'read_over_view.dart'; + +// ************************************************************************** +// FunctionalWidgetGenerator +// ************************************************************************** + +/// 已阅卷 +/// OnRefreshCallback? onRefresh +/// +class $EasyRefresh extends StatelessWidget { + /// 已阅卷 + /// OnRefreshCallback? onRefresh + /// + const $EasyRefresh({ + Key? key, + required this.controller, + required this.onRefresh, + required this.onLoad, + required this.data, + required this.tab, + required this.type, + required this.logic, + }) : super(key: key); + + /// 已阅卷 + /// OnRefreshCallback? onRefresh + /// + final EasyRefreshController controller; + + /// 已阅卷 + /// OnRefreshCallback? onRefresh + /// + final Future Function( + EasyRefreshController, + int, + ) onRefresh; + + /// 已阅卷 + /// OnRefreshCallback? onRefresh + /// + final Future Function( + EasyRefreshController, + int, + ) onLoad; + + /// 已阅卷 + /// OnRefreshCallback? onRefresh + /// + final List data; + + /// 已阅卷 + /// OnRefreshCallback? onRefresh + /// + final int tab; + + /// 已阅卷 + /// OnRefreshCallback? onRefresh + /// + final int type; + + /// 已阅卷 + /// OnRefreshCallback? onRefresh + /// + final ReadOverLogic logic; + + @override + Widget build(BuildContext _context) => $easyRefresh( + controller: controller, + onRefresh: onRefresh, + onLoad: onLoad, + data: data, + tab: tab, + type: type, + logic: logic, + ); +} + +class $ReviewedItem extends StatelessWidget { + const $ReviewedItem({ + Key? key, + required this.jobTaskItem, + required this.type, + required this.subjectName, + required this.logic, + }) : super(key: key); + + final Items jobTaskItem; + + final int type; + + final String subjectName; + + final ReadOverLogic logic; + + @override + Widget build(BuildContext _context) => $reviewedItem( + jobTaskItem: jobTaskItem, + type: type, + subjectName: subjectName, + logic: logic, + ); +} diff --git a/making_school_asignment_app/lib/page/home_page/children/read_over/widget/task_list_item.dart b/making_school_asignment_app/lib/page/home_page/children/read_over/widget/task_list_item.dart new file mode 100644 index 0000000..930902a --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/read_over/widget/task_list_item.dart @@ -0,0 +1,311 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:percent_indicator/percent_indicator.dart'; +import 'package:making_school_asignment_app/common/job/work_student.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/utils/enum_untils.dart'; +import 'package:making_school_asignment_app/common/utils/toast_utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/home_page/children/read_over/read_over_logic.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; + +class TaskListItem extends StatefulWidget { + final bool completed; + final Items jobTaskItem; + final int type; + final ReadOverLogic logic; + + const TaskListItem({Key? key, required this.completed, required this.jobTaskItem, required this.type, required this.logic}) : super(key: key); + + @override + State createState() => _TaskListItemState(); +} + +class _TaskListItemState extends State { + @override + Widget build(BuildContext context) { + return widget.completed + ? InkWell( + onTap: () { + Get.toNamed(Routes.annotateClassPage, + arguments: {'id': widget.jobTaskItem.id, 'name': widget.jobTaskItem.name, 'grade': widget.jobTaskItem.grade, 'completed': true}); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.only(top: 20.h), + margin: EdgeInsets.only(bottom: 12.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.r), + color: const Color.fromRGBO(255, 255, 255, 1), + boxShadow: const [ + BoxShadow( + color: Color.fromRGBO(210, 216, 241, 1), + offset: Offset.zero, //阴影y轴偏移量 + blurRadius: 5.8, //阴影模糊程度 + spreadRadius: 0, //阴影扩散程度 + ) + ], + ), + child: Column( + children: [ + // 顶部任务名称 + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: Utils.isPad() ? 32.w : 36.w, + height: 18.h, + alignment: Alignment.center, + padding: EdgeInsets.only(left: Utils.isPad() ? 2.w : 3.w), + decoration: BoxDecoration( + color: const Color.fromRGBO(104, 136, 253, 1), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(14.r), + topRight: Radius.circular(3.r), + bottomLeft: Radius.circular(4.r), + bottomRight: Radius.circular(4.r), + ), + ), + margin: EdgeInsets.only(right: 4.w), + child: quickText('作业', color: Colors.white, size: 10.sp), + ), + Expanded( + child: quickText( + widget.jobTaskItem.name, + maxLines: 2, + size: 16.sp, + color: const Color.fromRGBO(70, 70, 70, 1), + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ), + + SizedBox(height: 12.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + quickText( + DateTime.parse(widget.jobTaskItem.publishTime).toString().substring(0, 10), + color: const Color.fromRGBO(97, 97, 97, 1), + size: 12.sp, + fontWeight: FontWeight.w500, + ), + quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), size: 12.sp, fontWeight: FontWeight.w500), + quickText( + '参与班级:${widget.jobTaskItem.classCount}', + color: const Color.fromRGBO(76, 199, 147, 1), + size: 12.sp, + fontWeight: FontWeight.w600, + ), + quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 12.sp, fontWeight: FontWeight.w500), + quickText( + '科目:${EnumUtils.formatSubject(widget.jobTaskItem.subject)}', + color: const Color.fromRGBO(116, 145, 253, 1), + size: 12.sp, + fontWeight: FontWeight.w600, + ), + const Expanded(child: SizedBox()), + /* FavoriteButton( + jobTaskItem.id, + jobTaskItem.title, + margin: EdgeInsets.zero, + isRow: false, + ),*/ + ], + ), + ), + + SizedBox(height: 20.h), + Container( + padding: EdgeInsets.symmetric(vertical: 10.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), + color: Colors.white, + boxShadow: const [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.15), + offset: Offset(0, -0.0001), //阴影y轴偏移量 + blurRadius: 4, //阴影模糊程度 + spreadRadius: 0, //阴影扩散程度 + ) + ], + ), + child: Row(children: [ + Expanded( + child: InkWell( + onTap: () {}, + child: Container( + alignment: Alignment.center, + child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 13.sp), + ), + )), + ]), + ), + ], + ), + ), + ) + : InkWell( + onTap: () { + Get.toNamed(Routes.annotateClassPage, + arguments: {'id': widget.jobTaskItem.id, 'name': widget.jobTaskItem.name, 'grade': widget.jobTaskItem.grade}); + }, + child: Stack( + alignment: const FractionalOffset(0.95, 0), + children: [ + Container( + margin: EdgeInsets.only(bottom: 16.h), + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 10.w), + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.r), + color: const Color.fromRGBO(255, 255, 255, 1), + boxShadow: const [ + BoxShadow( + color: Color.fromRGBO(210, 216, 241, 1), + offset: Offset.zero, //阴影y轴偏移量 + blurRadius: 5.8, //阴影模糊程度 + spreadRadius: 0, //阴影扩散程度 + ) + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 30.h), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: Utils.isPad() ? 32.w : 38.w, + height: 18.h, + alignment: Alignment.center, + padding: EdgeInsets.only(left: Utils.isPad() ? 2.w : 3.w), + decoration: BoxDecoration( + color: widget.type == 1 ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(14.r), + topRight: Radius.circular(3.r), + bottomLeft: Radius.circular(4.r), + bottomRight: Radius.circular(4.r), + ), + ), + margin: EdgeInsets.only(right: 4.w), + child: quickText(widget.type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp), + ), + Expanded( + child: quickText( + widget.jobTaskItem.name, + maxLines: 2, + size: Utils.isPad() ? 14.sp : 16.sp, + color: const Color.fromRGBO(70, 70, 70, 1), + fontWeight: FontWeight.bold, + ), + ) + ], + ), + SizedBox(height: 10.h), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + quickText( + EnumUtils.formatSubject(widget.jobTaskItem.subject), + color: const Color.fromRGBO(97, 97, 97, 1), + size: 12.sp, + ), + quickText(' / ', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500), + Container( + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + quickText('题量:', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp), + quickText( + '10', + color: const Color.fromRGBO(97, 97, 97, 1), + size: 13.sp, + ), + ], + ), + ), + quickText(' / ', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500), + quickText(DateTime.parse(widget.jobTaskItem.publishTime).toString().substring(0, 10), + color: const Color.fromRGBO(97, 97, 97, 1), size: 12.sp), + ], + ), + SizedBox(height: 10.h), + InkWell( + onTap: () { + if (!widget.jobTaskItem.isFixed!) { + EasyLoading.show(status: 'loading...'); + widget.logic.getCollect(widget.jobTaskItem); + } + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 4.r, horizontal: 20.r), + decoration: BoxDecoration( + color: widget.jobTaskItem.isFixed! ? Color(0xFFF4F4F4) : Color(0xFFF2FFFA), + border: Border.all(width: 1.r, color: widget.jobTaskItem.isFixed! ? Colors.transparent : Color(0xFF4CC793)), + borderRadius: BorderRadius.all(Radius.circular(20.r)), + ), + child: Text( + widget.jobTaskItem.isFixed! ? '已订正' : '收集订正', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF4CC793)), + ), + ), + ), + // FavoriteButton(jobTaskItem.id, jobTaskItem.title), + ], + ), + ), + Container( + padding: EdgeInsets.all(9.r), + decoration: const BoxDecoration(shape: BoxShape.circle, color: Colors.white), + child: CircularPercentIndicator( + radius: 40.r, + lineWidth: 10.r, + animation: true, + percent: widget.jobTaskItem.annotateRate == null ? 0 : widget.jobTaskItem.annotateRate! / 100, + center: Text.rich(TextSpan(children: [ + TextSpan( + text: Utils.getDoubleRemoveZero(widget.jobTaskItem.annotateRate, '0'), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Theme.of(context).primaryColor, + ), + ), + TextSpan( + text: "%", + style: TextStyle(color: const Color.fromRGBO(70, 70, 70, 1), fontSize: 12.sp, fontWeight: FontWeight.bold), + ), + ])), + circularStrokeCap: CircularStrokeCap.round, + // progressColor: Theme.of(context).primaryColor, + linearGradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + tileMode: TileMode.clamp, + stops: const [0.0, 1.0], + colors: [ + Theme.of(context).primaryColor.withOpacity(0.1), + Theme.of(context).primaryColor, + ], + ), + backgroundColor: const Color.fromRGBO(244, 244, 244, 1), + ), + ), + ], + ), + ); + } +} diff --git a/lib/page/home_page/widget/top_user_info.dart b/making_school_asignment_app/lib/page/home_page/children/read_over/widget/top_user_info.dart similarity index 79% rename from lib/page/home_page/widget/top_user_info.dart rename to making_school_asignment_app/lib/page/home_page/children/read_over/widget/top_user_info.dart index 64fd320..7061bb6 100644 --- a/lib/page/home_page/widget/top_user_info.dart +++ b/making_school_asignment_app/lib/page/home_page/children/read_over/widget/top_user_info.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/page/home_page/home_logic.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/page/home_page/home_logic.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; class TopUserInfo extends StatelessWidget { TopUserInfo({Key? key}) : super(key: key); @@ -16,11 +16,7 @@ class TopUserInfo extends StatelessWidget { }, child: Container( color: Colors.white, - padding: EdgeInsets.only( - top: MediaQuery.of(context).padding.top + 4.h, - left: 14.w, - right: 14.w, - bottom: 19.h), + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 4.h, left: 14.w, right: 14.w, bottom: 19.h), child: Row( children: [ Container( @@ -38,17 +34,14 @@ class TopUserInfo extends StatelessWidget { alignment: Alignment.center, color: const Color.fromRGBO(163, 211, 255, 1), padding: EdgeInsets.all(1.r), - child: Image.asset('assets/images/login_logo.png', - width: 32.w, height: 32.w), + child: Image.asset('assets/images/login_logo.png', width: 32.w, height: 32.w), ), ), Container( margin: EdgeInsets.only(left: 10.h), child: Text( state.userInfo.value!.givenname, - style: TextStyle( - fontSize: 15.sp, - color: const Color.fromRGBO(45, 56, 76, 0.9)), + style: TextStyle(fontSize: 15.sp, color: const Color.fromRGBO(45, 56, 76, 0.9)), ), ), Container( diff --git a/lib/page/home_page/children/student_history_work/student_history_work_binding.dart b/making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_binding.dart similarity index 100% rename from lib/page/home_page/children/student_history_work/student_history_work_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_binding.dart diff --git a/lib/page/home_page/children/student_history_work/student_history_work_logic.dart b/making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_logic.dart similarity index 66% rename from lib/page/home_page/children/student_history_work/student_history_work_logic.dart rename to making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_logic.dart index d218e59..c7928d0 100644 --- a/lib/page/home_page/children/student_history_work/student_history_work_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_logic.dart @@ -2,9 +2,9 @@ import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; import 'package:get_storage/get_storage.dart'; -import 'package:school_asignment_app/common/job/class_item.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/job/class_item.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'student_history_work_state.dart'; @@ -15,7 +15,7 @@ class StudentHistoryWorkLogic extends GetxController with RequestToolMixin { @override void onInit() { super.onInit(); - nextPage = Get.arguments['page']??''; + nextPage = Get.arguments['page'] ?? ''; EasyLoading.show(status: 'loading...'); refreshController = EasyRefreshController(); getList(); @@ -28,8 +28,8 @@ class StudentHistoryWorkLogic extends GetxController with RequestToolMixin { refreshController.finishRefresh(); } - void goNextPage(String id,String title,int subject) { - Get.toNamed(Routes.classStudentPage,arguments: {'title':title,'classId':id,'page':nextPage,'subject':subject}); + void goNextPage(String id, String title, int subject) { + Get.toNamed(Routes.classStudentPage, arguments: {'title': title, 'classId': id, 'page': nextPage, 'subject': subject}); } @override diff --git a/lib/page/home_page/children/student_history_work/student_history_work_state.dart b/making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_state.dart similarity index 70% rename from lib/page/home_page/children/student_history_work/student_history_work_state.dart rename to making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_state.dart index e7dd14d..6beac18 100644 --- a/lib/page/home_page/children/student_history_work/student_history_work_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_state.dart @@ -1,5 +1,5 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/class_item.dart'; +import 'package:making_school_asignment_app/common/job/class_item.dart'; class StudentHistoryWorkState { StudentHistoryWorkState() { diff --git a/lib/page/home_page/children/student_history_work/student_history_work_view.dart b/making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_view.dart similarity index 85% rename from lib/page/home_page/children/student_history_work/student_history_work_view.dart rename to making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_view.dart index 0e8b497..ebacea4 100644 --- a/lib/page/home_page/children/student_history_work/student_history_work_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_history_work/student_history_work_view.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart'; -import 'package:school_asignment_app/page/home_page/widget/student_group_list.dart'; +import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; +import 'package:making_school_asignment_app/page/home_page/widget/student_group_list.dart'; import 'student_history_work_logic.dart'; @@ -45,10 +45,10 @@ class _StudentHistoryWorkPageState extends State { controller: logic.refreshController, header: MaterialHeader(), footer: TaurusFooter(), - onRefresh: () async{ + onRefresh: () async { logic.getList(); }, - child: StudentGroupList(state.clssList,logic.goNextPage), + child: StudentGroupList(state.clssList, logic.goNextPage), ), ), ); @@ -59,4 +59,4 @@ class _StudentHistoryWorkPageState extends State { Get.delete(); super.dispose(); } -} \ No newline at end of file +} diff --git a/lib/page/home_page/children/student_personal/student_personal_binding.dart b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_binding.dart similarity index 100% rename from lib/page/home_page/children/student_personal/student_personal_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_binding.dart diff --git a/lib/page/home_page/children/student_personal/student_personal_logic.dart b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_logic.dart similarity index 63% rename from lib/page/home_page/children/student_personal/student_personal_logic.dart rename to making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_logic.dart index ad5d317..21dad65 100644 --- a/lib/page/home_page/children/student_personal/student_personal_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_logic.dart @@ -1,23 +1,22 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/student_personal_info.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/job/student_personal_info.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; import 'student_personal_state.dart'; -class StudentPersonalLogic extends GetxController with RequestToolMixin{ +class StudentPersonalLogic extends GetxController with RequestToolMixin { final StudentPersonalState state = StudentPersonalState(); @override - void onInit(){ + void onInit() { super.onInit(); state.studentId = Get.arguments['studentId']; state.homeworkId = Get.arguments['homeworkId']; getInfo(); } - void getInfo() async{ - StudentPersonalInfo data = await getClient().getStudentHomework(state.homeworkId,state.studentId); + void getInfo() async { + StudentPersonalInfo data = await getClient().getStudentHomework(state.homeworkId, state.studentId); state.studentInfo.value = data; - } } diff --git a/lib/page/home_page/children/student_personal/student_personal_state.dart b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_state.dart similarity index 54% rename from lib/page/home_page/children/student_personal/student_personal_state.dart rename to making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_state.dart index 89b4b56..0eb0c66 100644 --- a/lib/page/home_page/children/student_personal/student_personal_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_state.dart @@ -1,13 +1,12 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/job/student_personal_info.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/job/student_personal_info.dart'; class StudentPersonalState { StudentPersonalState() { ///Initialize variables } - late Rx studentInfo = Rx(StudentPersonalInfo(0,'',0,0,[],0,[])); + late Rx studentInfo = Rx(StudentPersonalInfo(0, '', 0, 0, [], 0, [])); late int studentId; late String homeworkId; - } diff --git a/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 similarity index 78% rename from lib/page/home_page/children/student_personal/student_personal_view.dart rename to making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_view.dart index 19b4ae9..c6af9e4 100644 --- a/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 @@ -1,11 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/ReturnToHomepage.dart'; -import 'package:school_asignment_app/page/home_page/children/student_personal/widget/student_kg_table.dart'; -import 'package:school_asignment_app/page/home_page/children/student_personal/widget/student_zg_table.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_personal/widget/student_kg_table.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_personal/widget/student_zg_table.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'student_personal_logic.dart'; @@ -18,9 +18,7 @@ class StudentPersonalPage extends StatefulWidget { class _StudentPersonalPageState extends State { final logic = Get.find(); - final state = Get - .find() - .state; + final state = Get.find().state; @override Widget build(BuildContext context) { @@ -54,10 +52,8 @@ class _StudentPersonalPageState extends State { 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 - }); + Get.toNamed(Routes.studentWorkDetailPage, + arguments: {'studentId': state.studentInfo.value.studentId, 'studentName': state.studentInfo.value.studentName}); }, child: Container( width: 93.r, @@ -69,8 +65,7 @@ class _StudentPersonalPageState extends State { child: Center( child: Text( '历史作业', - style: TextStyle(fontSize: 10.r, - color: Color(0xFF2080F7)), + style: TextStyle(fontSize: 10.r, color: Color(0xFF2080F7)), ), ), ), @@ -94,8 +89,7 @@ class _StudentPersonalPageState extends State { child: Center( child: Text( '原稿笔迹', - style: TextStyle(fontSize: 10.r, - color: Color(0xFF4CC793)), + style: TextStyle(fontSize: 10.r, color: Color(0xFF4CC793)), ), ), ), @@ -119,9 +113,7 @@ class _StudentPersonalPageState extends State { children: [ Text( '客观题', - style: TextStyle(fontSize: 14.sp, - color: Color(0xFF5C5C5C), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600), ), SizedBox( width: 10.r, @@ -129,9 +121,7 @@ class _StudentPersonalPageState extends State { Obx(() { return Text( '${state.studentInfo.value.kgtCorrectRate}%', - style: TextStyle(fontSize: 14.sp, - color: Color(0xFF6888FD), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 14.sp, color: Color(0xFF6888FD), fontWeight: FontWeight.w600), ); }), ], @@ -141,10 +131,7 @@ class _StudentPersonalPageState extends State { ), Obx(() { return SizedBox( - height: state.studentInfo.value.kgtList.length > 8 - ? 300.r - : state - .studentInfo.value.kgtList.length * 40.r + 40.r, + height: state.studentInfo.value.kgtList.length > 8 ? 300.r : state.studentInfo.value.kgtList.length * 40.r + 40.r, child: StudentKgTable( headList: ['题号', '学生答案', '标准答案'], bodyList: state.studentInfo.value.kgtList, @@ -178,9 +165,7 @@ class _StudentPersonalPageState extends State { children: [ Text( '主观题', - style: TextStyle(fontSize: 14.sp, - color: Color(0xFF5C5C5C), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600), ), SizedBox( width: 10.r, @@ -188,9 +173,7 @@ class _StudentPersonalPageState extends State { Obx(() { return Text( '${state.studentInfo.value.zgtCorrectRate}%', - style: TextStyle(fontSize: 14.sp, - color: Color(0xFF6888FD), - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 14.sp, color: Color(0xFF6888FD), fontWeight: FontWeight.w600), ); }), ], @@ -200,10 +183,7 @@ class _StudentPersonalPageState extends State { ), Obx(() { return SizedBox( - height: state.studentInfo.value.zgtList.length > 8 - ? 300.r - : state - .studentInfo.value.zgtList.length * 40.r + 40.r, + height: state.studentInfo.value.zgtList.length > 8 ? 300.r : state.studentInfo.value.zgtList.length * 40.r + 40.r, child: StudentZgTable( headList: ['题号', '用时', '批注结果', '答案'], bodyList: state.studentInfo.value.zgtList, @@ -229,4 +209,4 @@ class _StudentPersonalPageState extends State { Get.delete(); super.dispose(); } -} \ No newline at end of file +} diff --git a/lib/page/home_page/children/student_personal/widget/student_kg_table.dart b/making_school_asignment_app/lib/page/home_page/children/student_personal/widget/student_kg_table.dart similarity index 96% rename from lib/page/home_page/children/student_personal/widget/student_kg_table.dart rename to making_school_asignment_app/lib/page/home_page/children/student_personal/widget/student_kg_table.dart index 5d129eb..dfc3527 100644 --- a/lib/page/home_page/children/student_personal/widget/student_kg_table.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_personal/widget/student_kg_table.dart @@ -1,8 +1,8 @@ import 'package:data_table_2/data_table_2.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/job/student_personal_info.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/job/student_personal_info.dart'; class StudentKgTable extends StatefulWidget { final List headList; diff --git a/lib/page/home_page/children/student_personal/widget/student_zg_table.dart b/making_school_asignment_app/lib/page/home_page/children/student_personal/widget/student_zg_table.dart similarity index 73% rename from lib/page/home_page/children/student_personal/widget/student_zg_table.dart rename to making_school_asignment_app/lib/page/home_page/children/student_personal/widget/student_zg_table.dart index cdcc303..940e1fa 100644 --- a/lib/page/home_page/children/student_personal/widget/student_zg_table.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_personal/widget/student_zg_table.dart @@ -1,10 +1,10 @@ import 'package:data_table_2/data_table_2.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:school_asignment_app/common/job/homework_details.dart'; -import 'package:school_asignment_app/common/job/student_personal_info.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/imgDialog.dart'; +import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/common/job/student_personal_info.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/imgDialog.dart'; class StudentZgTable extends StatefulWidget { final List headList; @@ -47,16 +47,14 @@ class _StudentZgTableState extends State { child: Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text(item.questionNo.toString(), - style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))), + child: Text(item.questionNo.toString(), style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))), ), ), )), DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text(Utils.second2HMS(item.useTime!), - style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))), + child: Text(Utils.second2HMS(item.useTime!), style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))), ), )), /* DataCell(InkWell( @@ -76,8 +74,7 @@ class _StudentZgTableState extends State { child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), child: item.isCorrect == null - ? Text('', - style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))) + ? Text('', style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))) : item.isCorrect! ? Image.asset( 'assets/images/job_personal_correct_icon.png', @@ -98,8 +95,7 @@ class _StudentZgTableState extends State { child: Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text('查看', - style: TextStyle(fontSize: 12.sp, color: Color(0xFF3661FE))), + child: Text('查看', style: TextStyle(fontSize: 12.sp, color: Color(0xFF3661FE))), ), ), )), @@ -118,14 +114,10 @@ class _StudentZgTableState extends State { headingRowHeight: 40.r, dataRowHeight: 40.r, border: TableBorder( - horizontalInside: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid), - bottom: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid), - verticalInside: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid)), - headingRowColor: MaterialStateProperty.resolveWith((states) => - widget.fixedCols! > 0 ? Colors.white : Colors.transparent), + horizontalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid), + bottom: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid), + verticalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid)), + headingRowColor: MaterialStateProperty.resolveWith((states) => widget.fixedCols! > 0 ? Colors.white : Colors.transparent), headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)), fixedColumnsColor: Color(0xFFE6E6E6), fixedCornerColor: Colors.grey[400], @@ -139,14 +131,12 @@ class _StudentZgTableState extends State { var item = widget.headList[index]; return DataColumn2( label: Center( - child: Text(item, - style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))), + child: Text(item, style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))), ), // size: ColumnSize.S, fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / 4, ); }), - rows: List.generate(widget.bodyList.length, - (index) => _getRow(index, Color(0xFFF5F5F5)))); + rows: List.generate(widget.bodyList.length, (index) => _getRow(index, Color(0xFFF5F5F5)))); } } diff --git a/lib/page/home_page/children/student_work_detail/student_work_detail_binding.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_binding.dart similarity index 100% rename from lib/page/home_page/children/student_work_detail/student_work_detail_binding.dart rename to making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_binding.dart diff --git a/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart similarity index 80% rename from lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart rename to making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart index 74db89f..76d9f20 100644 --- a/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/student_history.dart'; -import 'package:school_asignment_app/common/job/student_history_params.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/job/student_history.dart'; +import 'package:making_school_asignment_app/common/job/student_history_params.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; import 'student_work_detail_state.dart'; -class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSingleTickerProviderStateMixin{ +class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSingleTickerProviderStateMixin { final StudentWorkDetailState state = StudentWorkDetailState(); late TabController tabController; late final EasyRefreshController refreshController; @@ -26,7 +26,7 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi void getList() async { StudentHistoryParams params = StudentHistoryParams( - assessType: state.isJob.value?0:1, + assessType: state.isJob.value ? 0 : 1, studentId: state.studentId, dateStart: state.dateStart, dateEnd: state.dateEnd, @@ -35,7 +35,7 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi ); StudentHistory data = await getClient().getStudentHistory(params); state.studentData.value = data; - for(var element in state.studentData.value.items.items){ + for (var element in state.studentData.value.items.items) { int num = 0; for (var item in element.kgtList) { if (item.state == 0) { @@ -50,7 +50,6 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi if (num == (element.kgtList.length + element.zgtList.length)) { element.allNotDone = true; } - } EasyLoading.dismiss(); } diff --git a/lib/page/home_page/children/student_work_detail/student_work_detail_state.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_state.dart similarity index 56% rename from lib/page/home_page/children/student_work_detail/student_work_detail_state.dart rename to making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_state.dart index 09ca2f5..6e0cd30 100644 --- a/lib/page/home_page/children/student_work_detail/student_work_detail_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_state.dart @@ -1,6 +1,6 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/student_history.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/common/job/student_history.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; class StudentWorkDetailState { StudentWorkDetailState() { @@ -12,8 +12,8 @@ class StudentWorkDetailState { late RxBool isJob = true.obs; late int page = 1; late int totalPages = 0; - late String dateStart = Utils.getWeekStartDate().toString().substring(0, 10); + late String dateStart = Utils.getWeekStartDate().toString().substring(0, 10); late String dateEnd = Utils.getWeekEndDate().toString().substring(0, 10); late RxString customTimeStr = '自定义'.obs; - late Rx studentData = Rx(StudentHistory(0,0,Items([],0),0)); + late Rx studentData = Rx(StudentHistory(0, 0, Items([], 0), 0)); } 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 new file mode 100644 index 0000000..d47e4b6 --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart @@ -0,0 +1,519 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:making_school_asignment_app/common/job/student_history.dart'; +import 'package:making_school_asignment_app/common/utils/enum_untils.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart'; +import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; +import 'package:syncfusion_flutter_datepicker/datepicker.dart'; + +import 'student_work_detail_logic.dart'; + +class StudentWorkDetailPage extends StatefulWidget { + const StudentWorkDetailPage({Key? key}) : super(key: key); + + @override + State createState() => _StudentWorkDetailPageState(); +} + +class _StudentWorkDetailPageState extends State { + final logic = Get.find(); + final state = Get.find().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: () => Navigator.of(context).pop(), + ), + 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)), + ); + })), + ), + ), + ], + ), + ), + 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.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)}'; + } + } + } + }); + }), + 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)), + ), + ), + 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轴偏移量 + blurRadius: 4, //阴影模糊程度 + 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, + ), + 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; + 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.end, + 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), + ), + ), + 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( + 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)), + ), + ], + ), + 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)), + ), + ], + ), + 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(), + ); + }), + ), + ), + ], + ), + ); + } + + @override + void dispose() { + Get.delete(); + super.dispose(); + } +} diff --git a/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart similarity index 88% rename from lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart rename to making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart index 3b2a7a4..e33210d 100644 --- a/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart @@ -1,19 +1,20 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart'; import 'package:syncfusion_flutter_datepicker/datepicker.dart'; class JobConditionFilter extends StatefulWidget { -final TabController controller; -final int jobType; -final PickerDateRange? customTime; -final Function? refreshTime; -final String customTimeStr; -final bool? hasAll; -final Function(String? startTime, String? endTime) onTimeFilter; - const JobConditionFilter({Key? key, + final TabController controller; + final int jobType; + final PickerDateRange? customTime; + final Function? refreshTime; + final String customTimeStr; + final bool? hasAll; + final Function(String? startTime, String? endTime) onTimeFilter; + const JobConditionFilter({ + Key? key, required this.controller, required this.jobType, this.customTime, @@ -28,15 +29,13 @@ final Function(String? startTime, String? endTime) onTimeFilter; } class _JobConditionFilterState extends State { - var customTimeState = const PickerDateRange(null, null); @override void initState() { super.initState(); if (widget.customTime != null) { - customTimeState = PickerDateRange(widget.customTime!.startDate, - widget.customTime!.endDate); + customTimeState = PickerDateRange(widget.customTime!.startDate, widget.customTime!.endDate); } } @@ -57,8 +56,6 @@ class _JobConditionFilterState extends State { return now; } - - @override Widget build(BuildContext context) { return Container( @@ -73,19 +70,19 @@ class _JobConditionFilterState extends State { customTimeStr: widget.customTimeStr, hasAll: widget.hasAll, onTap: (int val) async { - if(val == 0 && widget.hasAll == true){ + if (val == 0 && widget.hasAll == true) { widget.onTimeFilter(null, null); - }else if((val == 1 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)){ + } else if ((val == 1 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)) { widget.onTimeFilter( Utils.getWeekStartDate().toString().substring(0, 10), Utils.getWeekEndDate().toString().substring(0, 10), ); - }else if((val == 2 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)){ + } else if ((val == 2 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)) { widget.onTimeFilter( getMonthStartDate().toString().substring(0, 10), getMonthEndDate().toString().substring(0, 10), ); - }else{ + } else { var dialogData = await showDialog( context: context, builder: (BuildContext context1) { @@ -120,7 +117,7 @@ class _JobConditionFilterState extends State { ); customTimeState = dialogData!; } - /* switch (val) { + /* switch (val) { case 0: // 全部 widget.onTimeFilter(null, null); break; diff --git a/lib/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart similarity index 100% rename from lib/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart rename to making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart diff --git a/lib/page/home_page/home_binding.dart b/making_school_asignment_app/lib/page/home_page/home_binding.dart similarity index 100% rename from lib/page/home_page/home_binding.dart rename to making_school_asignment_app/lib/page/home_page/home_binding.dart diff --git a/lib/page/home_page/home_logic.dart b/making_school_asignment_app/lib/page/home_page/home_logic.dart similarity index 68% rename from lib/page/home_page/home_logic.dart rename to making_school_asignment_app/lib/page/home_page/home_logic.dart index 26fc330..98bb209 100644 --- a/lib/page/home_page/home_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/home_logic.dart @@ -1,9 +1,9 @@ import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/work_student.dart'; -import 'package:school_asignment_app/common/job/work_student_params.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/common/job/work_student.dart'; +import 'package:making_school_asignment_app/common/job/work_student_params.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; import 'home_state.dart'; @@ -17,15 +17,17 @@ class HomeLogic extends GetxController with RequestToolMixin, GetTickerProviderS refreshController = EasyRefreshController(); getList(); } + void getList() async { WorkStudentParams params = WorkStudentParams( assessType: 0, ); WorkStudent data = await getClient().getUnAnnotateList(params); UserStore.to.readOver.value = data.items.length; - state.workList.value = data.items; + state.workList.value = data.items; refreshController.finishRefresh(); } + @override void dispose() { super.dispose(); diff --git a/lib/page/home_page/home_state.dart b/making_school_asignment_app/lib/page/home_page/home_state.dart similarity index 52% rename from lib/page/home_page/home_state.dart rename to making_school_asignment_app/lib/page/home_page/home_state.dart index 9b50314..8a56e56 100644 --- a/lib/page/home_page/home_state.dart +++ b/making_school_asignment_app/lib/page/home_page/home_state.dart @@ -1,7 +1,7 @@ import 'package:get/get.dart'; -import 'package:school_asignment_app/common/job/user_info.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; -import 'package:school_asignment_app/common/job/work_student.dart'; +import 'package:making_school_asignment_app/common/job/user_info.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/common/job/work_student.dart'; class HomeState { HomeState() { diff --git a/lib/page/home_page/home_view.dart b/making_school_asignment_app/lib/page/home_page/home_view.dart similarity index 62% rename from lib/page/home_page/home_view.dart rename to making_school_asignment_app/lib/page/home_page/home_view.dart index bfc59fb..254238b 100644 --- a/lib/page/home_page/home_view.dart +++ b/making_school_asignment_app/lib/page/home_page/home_view.dart @@ -6,15 +6,17 @@ import 'package:functional_widget_annotation/functional_widget_annotation.dart'; import 'package:get/get.dart'; import 'package:badges/badges.dart' as badges; import 'package:percent_indicator/percent_indicator.dart'; -import 'package:school_asignment_app/common/job/work_student.dart'; -import 'package:school_asignment_app/common/utils/enum_untils.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/job/work_student.dart'; +import 'package:making_school_asignment_app/common/utils/enum_untils.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'home_logic.dart'; +part 'home_view.g.dart'; + class HomePage extends StatefulWidget { const HomePage({Key? key}) : super(key: key); @@ -22,8 +24,7 @@ class HomePage extends StatefulWidget { State createState() => _HomePageState(); } -class _HomePageState extends State - with AutomaticKeepAliveClientMixin { +class _HomePageState extends State with AutomaticKeepAliveClientMixin { final logic = Get.find(); final state = Get.find().state; @@ -57,42 +58,27 @@ class _HomePageState extends State ), SizedBox(height: 30.h), Obx(() { - return $TermRow( - context, - [ - EntranceModel( - title: '作业批阅', - image: 'assets/images/job_home_marking.png', - navigationUrl: Routes.readOverPage), - EntranceModel( - title: '学生历史作业', - image: 'assets/images/job_home_history.png', - navigationUrl: Routes.studentHistoryWorkPage, - page: 'history', - ), - EntranceModel( - title: '知识点点掌握', - image: 'assets/images/job_home_knowledge.png', - navigationUrl: Routes.knowledgePointsGraspPage) - ], - state.readOver.value); + return $TermRow([ + EntranceModel(title: '作业批阅', image: 'assets/images/job_home_marking.png', navigationUrl: Routes.readOverPage), + EntranceModel( + title: '学生历史作业', + image: 'assets/images/job_home_history.png', + navigationUrl: Routes.studentHistoryWorkPage, + page: 'history', + ), + EntranceModel(title: '知识点点掌握', image: 'assets/images/job_home_knowledge.png', navigationUrl: Routes.knowledgePointsGraspPage) + ], state.readOver.value); }), spaceWidth, - $TermRow( - context, - [ - EntranceModel( - title: '答题轨迹', - image: 'assets/images/job_home_answer_record.png', - navigationUrl: ''), - EntranceModel( - title: '优先批阅设定', - image: 'assets/images/job_home_youxian.png', - navigationUrl: Routes.studentHistoryWorkPage, - page: 'set', - ) - ], - 0), + $TermRow([ + EntranceModel(title: '答题轨迹', image: 'assets/images/job_home_answer_record.png', navigationUrl: ''), + EntranceModel( + title: '优先批阅设定', + image: 'assets/images/job_home_youxian.png', + navigationUrl: Routes.studentHistoryWorkPage, + page: 'set', + ) + ], 0), /* $TermRow( context, @@ -111,17 +97,12 @@ class _HomePageState extends State header: MaterialHeader(), footer: TaurusFooter(), child: ListView.builder( - padding: EdgeInsets.only( - top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), + padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), itemBuilder: (context, index) { Items item = state.workList[index]; return InkWell( onTap: () { - Get.toNamed(Routes.annotateClassPage, arguments: { - 'id': item.id, - 'name': item.name, - 'grade': item.grade - }); + Get.toNamed(Routes.annotateClassPage, arguments: {'id': item.id, 'name': item.name, 'grade': item.grade}); }, child: Container( margin: EdgeInsets.only(bottom: 16.h), @@ -129,8 +110,7 @@ class _HomePageState extends State children: [ SizedBox(height: 30.h), Container( - padding: EdgeInsets.symmetric( - vertical: 16.h, horizontal: 10.w), + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 10.w), width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.r), @@ -154,14 +134,9 @@ class _HomePageState extends State width: Utils.isPad() ? 32.w : 38.w, height: 18.h, alignment: Alignment.center, - padding: EdgeInsets.only( - left: Utils.isPad() ? 2.w : 3.w), + padding: EdgeInsets.only(left: Utils.isPad() ? 2.w : 3.w), decoration: BoxDecoration( - color: state.type == 1 - ? const Color.fromRGBO( - 104, 136, 253, 1) - : const Color.fromRGBO( - 255, 175, 56, 1), + color: state.type == 1 ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1), borderRadius: BorderRadius.only( topLeft: Radius.circular(14.r), topRight: Radius.circular(3.r), @@ -170,18 +145,14 @@ class _HomePageState extends State ), ), margin: EdgeInsets.only(right: 4.w), - child: quickText( - state.type == 1 ? '作业' : '考试', - color: Colors.white, - size: 10.sp), + child: quickText(state.type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp), ), Expanded( child: quickText( item.name, maxLines: 2, size: Utils.isPad() ? 14.sp : 16.sp, - color: - const Color.fromRGBO(70, 70, 70, 1), + color: const Color.fromRGBO(70, 70, 70, 1), fontWeight: FontWeight.bold, ), ) @@ -193,45 +164,26 @@ class _HomePageState extends State children: [ quickText( EnumUtils.formatSubject(item.subject), - color: - const Color.fromRGBO(97, 97, 97, 1), + color: const Color.fromRGBO(97, 97, 97, 1), size: 12.sp, ), - quickText(' / ', - color: const Color.fromRGBO( - 130, 130, 130, 1), - size: 11.sp, - fontWeight: FontWeight.w500), + quickText(' / ', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500), Container( child: Row( - crossAxisAlignment: - CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, children: [ - quickText('题量:', - color: const Color.fromRGBO( - 130, 130, 130, 1), - size: 11.sp), + quickText('题量:', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp), quickText( '10', - color: const Color.fromRGBO( - 97, 97, 97, 1), + color: const Color.fromRGBO(97, 97, 97, 1), size: 13.sp, ), ], ), ), - quickText(' / ', - color: const Color.fromRGBO( - 130, 130, 130, 1), - size: 11.sp, - fontWeight: FontWeight.w500), - quickText( - DateTime.parse(item.publishTime) - .toString() - .substring(0, 10), - color: - const Color.fromRGBO(97, 97, 97, 1), - size: 12.sp), + quickText(' / ', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500), + quickText(DateTime.parse(item.publishTime).toString().substring(0, 10), + color: const Color.fromRGBO(97, 97, 97, 1), size: 12.sp), ], ), SizedBox(height: 10.h), @@ -240,19 +192,16 @@ class _HomePageState extends State Expanded( child: Container( decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(10.r), + borderRadius: BorderRadius.circular(10.r), ), child: LinearPercentIndicator( padding: EdgeInsets.zero, animation: true, lineHeight: 8.h, animationDuration: 2500, - percent: item.annotateRate == null?0:item.annotateRate! / 100, - progressColor: - const Color(0xFF6888FD), - backgroundColor: - const Color(0xFFE8E8E8), + percent: item.annotateRate == null ? 0 : item.annotateRate! / 100, + progressColor: const Color(0xFF6888FD), + backgroundColor: const Color(0xFFE8E8E8), barRadius: Radius.circular(10.r), ), ), @@ -260,10 +209,7 @@ class _HomePageState extends State SizedBox( width: 10.r, ), - quickText( - '${item.annotateRate!.toStringAsFixed(0)}%', - size: 10.sp, - color: const Color(0xFF464646)), + quickText('${item.annotateRate!.toStringAsFixed(0)}%', size: 10.sp, color: const Color(0xFF464646)), ], ), // FavoriteButton(jobTaskItem.id, jobTaskItem.title), @@ -297,35 +243,29 @@ class EntranceModel extends Object { String navigationUrl; String? page; - EntranceModel( - {required this.title, - required this.image, - required this.navigationUrl, - this.page}); + EntranceModel({required this.title, required this.image, required this.navigationUrl, this.page}); } @swidget -Widget $TermRow(BuildContext context, List items, int? data) { +Widget $termRow(BuildContext context, List items, int? data) { var leng = items.length; Widget childWidget; switch (leng) { case 1: - childWidget = - Row(children: [Expanded(child: $TermItem(context, items[0], data!))]); + childWidget = Row(children: [Expanded(child: $TermItem(items[0], data!))]); break; case 2: childWidget = Row(children: [ - Expanded(flex: 9, child: $TermItem(context, items[0], data!)), + Expanded(flex: 9, child: $TermItem(items[0], data!)), const Expanded(flex: 1, child: SizedBox()), - Expanded(flex: 9, child: $TermItem(context, items[1], data!)), + Expanded(flex: 9, child: $TermItem(items[1], data!)), ]); break; case 3: double theHeight = ScreenUtil().screenWidth / 19 + 54.h * 2; childWidget = Row( children: [ - Expanded( - child: $TermItem(context, items[0], data!, theHeight: theHeight)), + Expanded(child: $TermItem(items[0], data!, theHeight: theHeight)), SizedBox(width: ScreenUtil().screenWidth / 19), Expanded( child: SizedBox( @@ -333,8 +273,8 @@ Widget $TermRow(BuildContext context, List items, int? data) { child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - $TermItem(context, items[1], data), - $TermItem(context, items[2], data), + $TermItem(items[1], data), + $TermItem(items[2], data), ], ), ), @@ -346,13 +286,11 @@ Widget $TermRow(BuildContext context, List items, int? data) { childWidget = Container(); } - return Container( - padding: EdgeInsets.symmetric(horizontal: 14.w), child: childWidget); + return Container(padding: EdgeInsets.symmetric(horizontal: 14.w), child: childWidget); } @swidget -Widget $TermItem(BuildContext context, EntranceModel e, int data, - {double? theHeight}) { +Widget $termItem(BuildContext context, EntranceModel e, int data, {double? theHeight}) { bool isJob = e.title == '作业批阅'; return Material( @@ -381,14 +319,10 @@ Widget $TermItem(BuildContext context, EntranceModel e, int data, badgeStyle: badges.BadgeStyle( badgeColor: const Color.fromRGBO(255, 105, 105, 1), shape: badges.BadgeShape.square, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.r), - topRight: Radius.circular(8.5.r), - bottomRight: Radius.circular(8.5.r)), + borderRadius: BorderRadius.only(topLeft: Radius.circular(10.r), topRight: Radius.circular(8.5.r), bottomRight: Radius.circular(8.5.r)), // borderSide: BorderSide(color: Colors.white, width: 2), elevation: 1, - padding: EdgeInsets.symmetric( - horizontal: Utils.isPad() ? 11.w : 16.w, vertical: 2.h), + padding: EdgeInsets.symmetric(horizontal: Utils.isPad() ? 11.w : 16.w, vertical: 2.h), ), position: badges.BadgePosition.topEnd(top: 10.r, end: 10.r), child: Container( @@ -411,25 +345,17 @@ Widget $TermItem(BuildContext context, EntranceModel e, int data, ? Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset(e.image, - height: 32.r, width: 32.r, fit: BoxFit.cover), + Image.asset(e.image, height: 32.r, width: 32.r, fit: BoxFit.cover), SizedBox(height: 6.r), - quickText(e.title, - size: 12.sp, - color: const Color.fromRGBO(79, 79, 79, 1), - fontWeight: FontWeight.w500), + quickText(e.title, size: 12.sp, color: const Color.fromRGBO(79, 79, 79, 1), fontWeight: FontWeight.w500), ], ) : Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset(e.image, - height: 32.r, width: 32.r, fit: BoxFit.cover), + Image.asset(e.image, height: 32.r, width: 32.r, fit: BoxFit.cover), SizedBox(width: 6.r), - quickText(e.title, - size: 12.sp, - color: const Color.fromRGBO(79, 79, 79, 1), - fontWeight: FontWeight.w500), + quickText(e.title, size: 12.sp, color: const Color.fromRGBO(79, 79, 79, 1), fontWeight: FontWeight.w500), ], ), ), diff --git a/making_school_asignment_app/lib/page/home_page/home_view.g.dart b/making_school_asignment_app/lib/page/home_page/home_view.g.dart new file mode 100644 index 0000000..0066c10 --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/home_view.g.dart @@ -0,0 +1,49 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'home_view.dart'; + +// ************************************************************************** +// FunctionalWidgetGenerator +// ************************************************************************** + +class $TermRow extends StatelessWidget { + const $TermRow( + this.items, + this.data, { + Key? key, + }) : super(key: key); + + final List items; + + final int? data; + + @override + Widget build(BuildContext _context) => $termRow( + _context, + items, + data, + ); +} + +class $TermItem extends StatelessWidget { + const $TermItem( + this.e, + this.data, { + Key? key, + this.theHeight, + }) : super(key: key); + + final EntranceModel e; + + final int data; + + final double? theHeight; + + @override + Widget build(BuildContext _context) => $termItem( + _context, + e, + data, + theHeight: theHeight, + ); +} diff --git a/lib/page/home_page/widget/progress_bar.dart b/making_school_asignment_app/lib/page/home_page/widget/progress_bar.dart similarity index 83% rename from lib/page/home_page/widget/progress_bar.dart rename to making_school_asignment_app/lib/page/home_page/widget/progress_bar.dart index be9ddae..aa275f1 100644 --- a/lib/page/home_page/widget/progress_bar.dart +++ b/making_school_asignment_app/lib/page/home_page/widget/progress_bar.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:percent_indicator/percent_indicator.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; class ProgressBar extends StatefulWidget { late double? fontSize; @@ -12,7 +12,16 @@ class ProgressBar extends StatefulWidget { final double percent; final EdgeInsets padingEdg; final EdgeInsets marginEdg; - ProgressBar({Key? key,this.fontSize,this.lineHeight,required this.title,required this.color,required this.percent,required this.marginEdg,required this.padingEdg}) : super(key: key); + ProgressBar( + {Key? key, + this.fontSize, + this.lineHeight, + required this.title, + required this.color, + required this.percent, + required this.marginEdg, + required this.padingEdg}) + : super(key: key); @override State createState() => _ProgressBarState(); diff --git a/making_school_asignment_app/lib/page/home_page/widget/student_group_list.dart b/making_school_asignment_app/lib/page/home_page/widget/student_group_list.dart new file mode 100644 index 0000000..6832245 --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/widget/student_group_list.dart @@ -0,0 +1,153 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:making_school_asignment_app/common/job/class_item.dart'; +import 'package:making_school_asignment_app/common/utils/enum_untils.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; + +class StudentGroupList extends StatelessWidget { + final List studentGroups; + final Function goNextPage; + final Widget? rightBtn; + + const StudentGroupList(this.studentGroups, this.goNextPage, {Key? key, this.rightBtn}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Obx(() { + return studentGroups != null && studentGroups.isNotEmpty + ? Utils.isPad() + ? GridView( + shrinkWrap: true, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + mainAxisSpacing: 10.r, + crossAxisSpacing: 10.r, + childAspectRatio: 556 / 112, + ), + children: List.generate(studentGroups.length, (index) { + ClassItem item = studentGroups[index]; + return InkWell( + onTap: () { + goNextPage(item.classId, '${EnumUtils.formatGrade(item.grade)}${item.className}', item.subject); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 10.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10.r)), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(right: 8.r), + child: Text( + '${EnumUtils.formatGrade(item.grade)}${item.className}', + style: TextStyle(fontSize: 10.sp, color: Color(0xFF6888FD)), + ), + ), + const Spacer(), + /*Expanded( + child: Text( + classNames, + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF999999), + overflow: TextOverflow.ellipsis, + ), + textAlign: TextAlign.end, + ), + ),*/ + rightBtn != null + ? rightBtn! + : Container( + margin: EdgeInsets.only(left: 5.r), + height: 20.r, + width: 55.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.r)), + color: const Color(0xFF6888FD), + ), + child: Center( + child: Text( + '详情', + style: TextStyle(fontSize: 10.sp, color: Colors.white), + ), + ), + ) + ], + ), + ), + ); + }), + ) + : ListView.builder( + shrinkWrap: true, + itemBuilder: (context, index) { + ClassItem item = studentGroups[index]; + return InkWell( + onTap: () { + goNextPage(item.classId, '${EnumUtils.formatGrade(item.grade)}${item.className}', item.subject); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 15.r, horizontal: 10.r), + margin: EdgeInsets.only(bottom: 10.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10.r)), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(right: 8.r), + child: Text( + '${EnumUtils.formatGrade(item.grade)}${item.className}', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF6888FD)), + ), + ), + const Spacer(), + /* Expanded( + child: Text( + classNames, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF999999), + overflow: TextOverflow.ellipsis, + ), + textAlign: TextAlign.end, + ), + ),*/ + rightBtn != null + ? rightBtn! + : Container( + margin: EdgeInsets.only(left: 5.r), + height: 24.r, + width: 55.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.r)), + color: const Color(0xFF6888FD), + ), + child: Center( + child: Text( + '详情', + style: TextStyle(fontSize: 10.sp, color: Colors.white), + ), + ), + ) + ], + ), + ), + ); + }, + itemCount: studentGroups.length, + ) + : Padding( + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), + child: const MyEmptyWidget(), + ); + }); + } +} diff --git a/lib/page/home_page/children/read_over/widget/top_user_info.dart b/making_school_asignment_app/lib/page/home_page/widget/top_user_info.dart similarity index 79% rename from lib/page/home_page/children/read_over/widget/top_user_info.dart rename to making_school_asignment_app/lib/page/home_page/widget/top_user_info.dart index 64fd320..7061bb6 100644 --- a/lib/page/home_page/children/read_over/widget/top_user_info.dart +++ b/making_school_asignment_app/lib/page/home_page/widget/top_user_info.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/page/home_page/home_logic.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/page/home_page/home_logic.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; class TopUserInfo extends StatelessWidget { TopUserInfo({Key? key}) : super(key: key); @@ -16,11 +16,7 @@ class TopUserInfo extends StatelessWidget { }, child: Container( color: Colors.white, - padding: EdgeInsets.only( - top: MediaQuery.of(context).padding.top + 4.h, - left: 14.w, - right: 14.w, - bottom: 19.h), + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 4.h, left: 14.w, right: 14.w, bottom: 19.h), child: Row( children: [ Container( @@ -38,17 +34,14 @@ class TopUserInfo extends StatelessWidget { alignment: Alignment.center, color: const Color.fromRGBO(163, 211, 255, 1), padding: EdgeInsets.all(1.r), - child: Image.asset('assets/images/login_logo.png', - width: 32.w, height: 32.w), + child: Image.asset('assets/images/login_logo.png', width: 32.w, height: 32.w), ), ), Container( margin: EdgeInsets.only(left: 10.h), child: Text( state.userInfo.value!.givenname, - style: TextStyle( - fontSize: 15.sp, - color: const Color.fromRGBO(45, 56, 76, 0.9)), + style: TextStyle(fontSize: 15.sp, color: const Color.fromRGBO(45, 56, 76, 0.9)), ), ), Container( diff --git a/lib/page/login_page/children/agreement_page.dart b/making_school_asignment_app/lib/page/login_page/children/agreement_page.dart similarity index 71% rename from lib/page/login_page/children/agreement_page.dart rename to making_school_asignment_app/lib/page/login_page/children/agreement_page.dart index 1bc7184..a741b6f 100644 --- a/lib/page/login_page/children/agreement_page.dart +++ b/making_school_asignment_app/lib/page/login_page/children/agreement_page.dart @@ -2,12 +2,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/const_text.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/common/const_text.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; // 协议富文本 class AgreementPage extends StatelessWidget { - const AgreementPage({super.key}); @override @@ -17,12 +16,12 @@ class AgreementPage extends StatelessWidget { return Scaffold( appBar: AppBar( backgroundColor: Theme.of(context).primaryColor, - title: quickText(agreement.title,color: Colors.white), + title: quickText(agreement.title, color: Colors.white), ), body: ListView( padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 8.h), children: [ - HtmlWidget(agreement.richText,textStyle:const TextStyle(color: Colors.black)), + HtmlWidget(agreement.richText, textStyle: const TextStyle(color: Colors.black)), ], ), ); diff --git a/lib/page/login_page/login_binding.dart b/making_school_asignment_app/lib/page/login_page/login_binding.dart similarity index 100% rename from lib/page/login_page/login_binding.dart rename to making_school_asignment_app/lib/page/login_page/login_binding.dart diff --git a/lib/page/login_page/login_logic.dart b/making_school_asignment_app/lib/page/login_page/login_logic.dart similarity index 90% rename from lib/page/login_page/login_logic.dart rename to making_school_asignment_app/lib/page/login_page/login_logic.dart index 6b4266b..aaf07ee 100644 --- a/lib/page/login_page/login_logic.dart +++ b/making_school_asignment_app/lib/page/login_page/login_logic.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; -import 'package:school_asignment_app/common/store/user_store.dart'; -import 'package:school_asignment_app/common/utils/storage.dart'; -import 'package:school_asignment_app/common/utils/toast_utils.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/store/user_store.dart'; +import 'package:making_school_asignment_app/common/utils/storage.dart'; +import 'package:making_school_asignment_app/common/utils/toast_utils.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'login_state.dart'; diff --git a/lib/page/login_page/login_state.dart b/making_school_asignment_app/lib/page/login_page/login_state.dart similarity index 100% rename from lib/page/login_page/login_state.dart rename to making_school_asignment_app/lib/page/login_page/login_state.dart diff --git a/lib/page/login_page/login_view.dart b/making_school_asignment_app/lib/page/login_page/login_view.dart similarity index 79% rename from lib/page/login_page/login_view.dart rename to making_school_asignment_app/lib/page/login_page/login_view.dart index 865a954..6d23aa5 100644 --- a/lib/page/login_page/login_view.dart +++ b/making_school_asignment_app/lib/page/login_page/login_view.dart @@ -2,10 +2,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/common/const_text.dart'; -import 'package:school_asignment_app/common/utils/utils.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; -import 'package:school_asignment_app/routes/app_pages.dart'; +import 'package:making_school_asignment_app/common/const_text.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'login_logic.dart'; @@ -58,15 +58,12 @@ class _LoginPageState extends State { child: SizedBox( height: 86.w, width: 86.w, - child: Image.asset('assets/images/login_logo.png', - fit: BoxFit.cover), + child: Image.asset('assets/images/login_logo.png', fit: BoxFit.cover), ), ), Container( - margin: EdgeInsets.symmetric( - horizontal: 32.w, vertical: 24.h), - padding: EdgeInsets.only( - top: 34.h, bottom: 16.h, left: 22.w, right: 22.w), + margin: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.h), + padding: EdgeInsets.only(top: 34.h, bottom: 16.h, left: 22.w, right: 22.w), color: Colors.transparent, /* decoration: BoxDecoration( color: Colors.transparent, @@ -84,15 +81,15 @@ class _LoginPageState extends State { child: Column(children: [ Container( padding: EdgeInsets.symmetric(horizontal: 10.r), - decoration: BoxDecoration( - color: Colors.transparent, - border: Border.all(width: 1.w, color: const Color(0xFFAECBFF)), - borderRadius: BorderRadius.all(Radius.circular(17.w)), - ), + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all(width: 1.w, color: const Color(0xFFAECBFF)), + borderRadius: BorderRadius.all(Radius.circular(17.w)), + ), child: Center( child: TextField( controller: state.userNameController, - /* maxLines: 1, + /* maxLines: 1, maxLength: 20,*/ textInputAction: TextInputAction.next, onEditingComplete: () { @@ -106,15 +103,21 @@ class _LoginPageState extends State { decoration: InputDecoration( hintText: "请输入账号", hintStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white,), + fontSize: 14.sp, + color: Colors.white, + ), // labelText: "账号", labelStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white,), - border: InputBorder.none, - prefixIcon:Image.asset('assets/images/login_account.png',width: 20.r,height: 20.r,), - /* suffixIcon: !state.hasNameVal + fontSize: 14.sp, + color: Colors.white, + ), + border: InputBorder.none, + prefixIcon: Image.asset( + 'assets/images/login_account.png', + width: 20.r, + height: 20.r, + ), + /* suffixIcon: !state.hasNameVal ? null : Transform.translate( offset: @@ -138,7 +141,9 @@ class _LoginPageState extends State { ), ), ), - SizedBox(height: 15.r,), + SizedBox( + height: 15.r, + ), Obx(() { return Container( padding: EdgeInsets.symmetric(horizontal: 10.r), @@ -162,7 +167,7 @@ class _LoginPageState extends State { ), decoration: InputDecoration( hintText: "请输入密码", - /* suffix: GestureDetector( + /* suffix: GestureDetector( onTap: logic.showPassword, child: Icon( Icons.remove_red_eye, @@ -171,16 +176,22 @@ class _LoginPageState extends State { : Colors.grey, ), ),*/ - prefixIcon: Image.asset('assets/images/login_pwd.png',width: 20.r,height: 20.r,), + prefixIcon: Image.asset( + 'assets/images/login_pwd.png', + width: 20.r, + height: 20.r, + ), hintStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white,), + fontSize: 14.sp, + color: Colors.white, + ), border: InputBorder.none, // labelText: "密码", isDense: true, labelStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white,), + fontSize: 14.sp, + color: Colors.white, + ), ), ), ); @@ -188,7 +199,7 @@ class _LoginPageState extends State { SizedBox( height: 22.h, ), - /* Row( + /* Row( children: [ Container( width: 30.w, @@ -200,10 +211,10 @@ class _LoginPageState extends State { value: state.keepPwd.value, onChanged: (value) { Get.focusScope?.nextFocus(); - *//* FocusScope.of(context).requestFocus( + */ /* FocusScope.of(context).requestFocus( state.pwdFocus); FocusScope.of(context).requestFocus( - state.theFocus);*//* + state.theFocus);*/ /* state.keepPwd.value = value ?? false; }, ); @@ -212,13 +223,13 @@ class _LoginPageState extends State { InkWell( onTap: () { Utils.hideKeyboard(); - *//*Get.focusScope?.nextFocus(); - Get.focusScope?.nextFocus();*//* + */ /*Get.focusScope?.nextFocus(); + Get.focusScope?.nextFocus();*/ /* - *//* FocusScope.of(context).requestFocus( + */ /* FocusScope.of(context).requestFocus( state.pwdFocus); FocusScope.of(context).requestFocus( - state.theFocus);*//* + state.theFocus);*/ /* state.keepPwd.value = !state.keepPwd.value; }, child: Text( @@ -240,13 +251,10 @@ class _LoginPageState extends State { return Container( margin: EdgeInsets.symmetric(vertical: 10.h), decoration: BoxDecoration( - color: state.canLogin.value - ? const Color.fromRGBO(107, 104, 252, 1) - : const Color(0xFFdddddd), + color: state.canLogin.value ? const Color.fromRGBO(107, 104, 252, 1) : const Color(0xFFdddddd), boxShadow: [ BoxShadow( - color: - const Color.fromRGBO(46, 91, 255, 0.5), + color: const Color.fromRGBO(46, 91, 255, 0.5), offset: Offset(6.w, 10.h), //阴影y轴偏移量 blurRadius: 14, //阴影模糊程度 spreadRadius: 0.5, //阴影扩散程度 @@ -261,8 +269,7 @@ class _LoginPageState extends State { height: 50.h, child: Text( '登 录', - style: TextStyle( - fontSize: 16.sp, color: Colors.white), + style: TextStyle(fontSize: 16.sp, color: Colors.white), ), ); }), @@ -290,23 +297,17 @@ class _LoginPageState extends State { ), InkWell( onTap: () { - Get.toNamed(Routes.agreementPage, arguments: { - "type": AGREEMENT_KEY.USER_AGREEMENT.name - }); + Get.toNamed(Routes.agreementPage, arguments: {"type": AGREEMENT_KEY.USER_AGREEMENT.name}); }, child: quickText('请仔细阅读', size: 13.sp), ), InkWell( onTap: () { - Get.toNamed(Routes.agreementPage, arguments: { - "type": AGREEMENT_KEY.USER_AGREEMENT.name - }); + Get.toNamed(Routes.agreementPage, arguments: {"type": AGREEMENT_KEY.USER_AGREEMENT.name}); }, child: Text( '《用户协议》', - style: TextStyle( - fontSize: 14.r, - color: Colors.deepOrangeAccent), + style: TextStyle(fontSize: 14.r, color: Colors.deepOrangeAccent), ), ), ], diff --git a/lib/page/work_page/work_binding.dart b/making_school_asignment_app/lib/page/work_page/work_binding.dart similarity index 100% rename from lib/page/work_page/work_binding.dart rename to making_school_asignment_app/lib/page/work_page/work_binding.dart diff --git a/lib/page/work_page/work_logic.dart b/making_school_asignment_app/lib/page/work_page/work_logic.dart similarity index 100% rename from lib/page/work_page/work_logic.dart rename to making_school_asignment_app/lib/page/work_page/work_logic.dart diff --git a/lib/page/work_page/work_state.dart b/making_school_asignment_app/lib/page/work_page/work_state.dart similarity index 100% rename from lib/page/work_page/work_state.dart rename to making_school_asignment_app/lib/page/work_page/work_state.dart diff --git a/lib/page/work_page/work_view.dart b/making_school_asignment_app/lib/page/work_page/work_view.dart similarity index 90% rename from lib/page/work_page/work_view.dart rename to making_school_asignment_app/lib/page/work_page/work_view.dart index a48e23b..7ad2a30 100644 --- a/lib/page/work_page/work_view.dart +++ b/making_school_asignment_app/lib/page/work_page/work_view.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:making_school_asignment_app/page/global_widget/my_text.dart'; import 'work_logic.dart'; diff --git a/making_school_asignment_app/lib/routes/app_pages.dart b/making_school_asignment_app/lib/routes/app_pages.dart new file mode 100644 index 0000000..bc12ce3 --- /dev/null +++ b/making_school_asignment_app/lib/routes/app_pages.dart @@ -0,0 +1,79 @@ +import 'package:get/get.dart'; +import 'package:making_school_asignment_app/page/global_widget/other_page.dart'; +import 'package:making_school_asignment_app/page/global_widget/start_page.dart'; +import 'package:making_school_asignment_app/page/home_page/children/annotate_class/annotate_class_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/annotate_class/annotate_class_view.dart'; +import 'package:making_school_asignment_app/page/home_page/children/class_student/class_student_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/class_student/class_student_view.dart'; +import 'package:making_school_asignment_app/page/home_page/children/job_report/job_report_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/job_report/job_report_view.dart'; +import 'package:making_school_asignment_app/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart'; +import 'package:making_school_asignment_app/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart'; +import 'package:making_school_asignment_app/page/home_page/children/my_info.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_view.dart'; +import 'package:making_school_asignment_app/page/home_page/children/read_over/read_over_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/read_over/read_over_view.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_history_work/student_history_work_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_history_work/student_history_work_view.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_personal/student_personal_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_personal/student_personal_view.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/student_work_detail_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/student_work_detail_view.dart'; +import 'package:making_school_asignment_app/page/home_page/home_binding.dart'; +import 'package:making_school_asignment_app/page/home_page/home_view.dart'; +import 'package:making_school_asignment_app/page/login_page/children/agreement_page.dart'; +import 'package:making_school_asignment_app/page/login_page/login_binding.dart'; +import 'package:making_school_asignment_app/page/login_page/login_view.dart'; +import 'package:making_school_asignment_app/page/work_page/work_binding.dart'; +import 'package:making_school_asignment_app/page/work_page/work_view.dart'; +part 'app_routes.dart'; + +abstract class AppPages { + static final pages = [ + GetPage(name: Routes.login, page: () => const LoginPage(), binding: LoginBinding(), transition: Transition.noTransition), + GetPage(name: Routes.agreementPage, page: () => const AgreementPage(), binding: LoginBinding(), transition: Transition.noTransition), + GetPage(name: Routes.home, page: () => const HomePage(), binding: HomeBinding(), transition: Transition.noTransition), + GetPage(name: Routes.startPage, page: () => const StartPage(), binding: StartPageIndexBinding(), transition: Transition.noTransition), + GetPage(name: Routes.myInfo, page: () => const MyInfo(), transition: Transition.noTransition), + GetPage(name: Routes.work, page: () => const WorkPage(), binding: WorkBinding(), transition: Transition.noTransition), + GetPage(name: Routes.otherPage, page: () => const OhterPage(), transition: Transition.noTransition), + GetPage(name: Routes.readOverPage, page: () => const ReadOverPage(), binding: ReadOverBinding(), transition: Transition.noTransition), + GetPage( + name: Routes.studentHistoryWorkPage, + page: () => const StudentHistoryWorkPage(), + binding: StudentHistoryWorkBinding(), + transition: Transition.noTransition), + GetPage(name: Routes.classStudentPage, page: () => const ClassStudentPage(), binding: ClassStudentBinding(), transition: Transition.noTransition), + GetPage( + name: Routes.annotateClassPage, page: () => const AnnotateClassPage(), binding: AnnotateClassBinding(), transition: Transition.noTransition), + GetPage( + name: Routes.quickDataCheckPage, + page: () => const QuickDataCheckPage(), + binding: QuickDataCheckBinding(), + transition: Transition.noTransition), + GetPage(name: Routes.jobReportPage, page: () => const JobReportPage(), binding: JobReportBinding(), transition: Transition.noTransition), + GetPage( + name: Routes.studentPersonalPage, + page: () => const StudentPersonalPage(), + binding: StudentPersonalBinding(), + transition: Transition.noTransition), + GetPage( + name: Routes.studentWorkDetailPage, + page: () => const StudentWorkDetailPage(), + binding: StudentWorkDetailBinding(), + transition: Transition.noTransition), + GetPage( + name: Routes.knowledgePointsGraspPage, + page: () => const KnowledgePointsGraspPage(), + binding: KnowledgePointsGraspBinding(), + transition: Transition.noTransition), + GetPage( + name: Routes.knowledgePointsGraspDetailPage, + page: () => const KnowledgePointsGraspDetailPage(), + binding: KnowledgePointsGraspDetailBinding(), + transition: Transition.noTransition), + ]; +} diff --git a/lib/routes/app_routes.dart b/making_school_asignment_app/lib/routes/app_routes.dart similarity index 100% rename from lib/routes/app_routes.dart rename to making_school_asignment_app/lib/routes/app_routes.dart diff --git a/making_school_asignment_app/linux/.gitignore b/making_school_asignment_app/linux/.gitignore new file mode 100644 index 0000000..d3896c9 --- /dev/null +++ b/making_school_asignment_app/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/making_school_asignment_app/linux/CMakeLists.txt b/making_school_asignment_app/linux/CMakeLists.txt new file mode 100644 index 0000000..068efa5 --- /dev/null +++ b/making_school_asignment_app/linux/CMakeLists.txt @@ -0,0 +1,145 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "making_school_asignment_app") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.yuanxuan.making_school_asignment_app") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/making_school_asignment_app/linux/flutter/CMakeLists.txt b/making_school_asignment_app/linux/flutter/CMakeLists.txt new file mode 100644 index 0000000..d5bd016 --- /dev/null +++ b/making_school_asignment_app/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/making_school_asignment_app/linux/flutter/generated_plugin_registrant.cc b/making_school_asignment_app/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..e71a16d --- /dev/null +++ b/making_school_asignment_app/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/making_school_asignment_app/linux/flutter/generated_plugin_registrant.h b/making_school_asignment_app/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/making_school_asignment_app/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/making_school_asignment_app/linux/flutter/generated_plugins.cmake b/making_school_asignment_app/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..2e1de87 --- /dev/null +++ b/making_school_asignment_app/linux/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/making_school_asignment_app/linux/main.cc b/making_school_asignment_app/linux/main.cc new file mode 100644 index 0000000..e7c5c54 --- /dev/null +++ b/making_school_asignment_app/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/making_school_asignment_app/linux/my_application.cc b/making_school_asignment_app/linux/my_application.cc new file mode 100644 index 0000000..dcfcc75 --- /dev/null +++ b/making_school_asignment_app/linux/my_application.cc @@ -0,0 +1,124 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "making_school_asignment_app"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "making_school_asignment_app"); + } + + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, + "flags", G_APPLICATION_NON_UNIQUE, + nullptr)); +} diff --git a/making_school_asignment_app/linux/my_application.h b/making_school_asignment_app/linux/my_application.h new file mode 100644 index 0000000..72271d5 --- /dev/null +++ b/making_school_asignment_app/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/making_school_asignment_app/macos/.gitignore b/making_school_asignment_app/macos/.gitignore new file mode 100644 index 0000000..746adbb --- /dev/null +++ b/making_school_asignment_app/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/making_school_asignment_app/macos/Flutter/Flutter-Debug.xcconfig b/making_school_asignment_app/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..c2efd0b --- /dev/null +++ b/making_school_asignment_app/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/making_school_asignment_app/macos/Flutter/Flutter-Release.xcconfig b/making_school_asignment_app/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..c2efd0b --- /dev/null +++ b/making_school_asignment_app/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/making_school_asignment_app/macos/Flutter/GeneratedPluginRegistrant.swift b/making_school_asignment_app/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..1985cf4 --- /dev/null +++ b/making_school_asignment_app/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,18 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import connectivity_plus +import package_info_plus +import path_provider_foundation +import sqflite + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) + FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) +} diff --git a/making_school_asignment_app/macos/Runner.xcodeproj/project.pbxproj b/making_school_asignment_app/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ddfbd95 --- /dev/null +++ b/making_school_asignment_app/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,705 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* making_school_asignment_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "making_school_asignment_app.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* making_school_asignment_app.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* making_school_asignment_app.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/making_school_asignment_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/making_school_asignment_app"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/making_school_asignment_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/making_school_asignment_app"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/making_school_asignment_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/making_school_asignment_app"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/making_school_asignment_app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/making_school_asignment_app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/making_school_asignment_app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/making_school_asignment_app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/making_school_asignment_app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..ed2a4ea --- /dev/null +++ b/making_school_asignment_app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/making_school_asignment_app/macos/Runner.xcworkspace/contents.xcworkspacedata b/making_school_asignment_app/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/making_school_asignment_app/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/making_school_asignment_app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/making_school_asignment_app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/making_school_asignment_app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/making_school_asignment_app/macos/Runner/AppDelegate.swift b/making_school_asignment_app/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..d53ef64 --- /dev/null +++ b/making_school_asignment_app/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a2ec33f --- /dev/null +++ b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..82b6f9d Binary files /dev/null and b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..13b35eb Binary files /dev/null and b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..0a3f5fa Binary files /dev/null and b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..bdb5722 Binary files /dev/null and b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..f083318 Binary files /dev/null and b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..326c0e7 Binary files /dev/null and b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..2f1632c Binary files /dev/null and b/making_school_asignment_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/making_school_asignment_app/macos/Runner/Base.lproj/MainMenu.xib b/making_school_asignment_app/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..80e867a --- /dev/null +++ b/making_school_asignment_app/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/making_school_asignment_app/macos/Runner/Configs/AppInfo.xcconfig b/making_school_asignment_app/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..938cf22 --- /dev/null +++ b/making_school_asignment_app/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = making_school_asignment_app + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2024 com.yuanxuan. All rights reserved. diff --git a/making_school_asignment_app/macos/Runner/Configs/Debug.xcconfig b/making_school_asignment_app/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..36b0fd9 --- /dev/null +++ b/making_school_asignment_app/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/making_school_asignment_app/macos/Runner/Configs/Release.xcconfig b/making_school_asignment_app/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..dff4f49 --- /dev/null +++ b/making_school_asignment_app/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/making_school_asignment_app/macos/Runner/Configs/Warnings.xcconfig b/making_school_asignment_app/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..42bcbf4 --- /dev/null +++ b/making_school_asignment_app/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/making_school_asignment_app/macos/Runner/DebugProfile.entitlements b/making_school_asignment_app/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..dddb8a3 --- /dev/null +++ b/making_school_asignment_app/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/making_school_asignment_app/macos/Runner/Info.plist b/making_school_asignment_app/macos/Runner/Info.plist new file mode 100644 index 0000000..4789daa --- /dev/null +++ b/making_school_asignment_app/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/making_school_asignment_app/macos/Runner/MainFlutterWindow.swift b/making_school_asignment_app/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..3cc05eb --- /dev/null +++ b/making_school_asignment_app/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/making_school_asignment_app/macos/Runner/Release.entitlements b/making_school_asignment_app/macos/Runner/Release.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/making_school_asignment_app/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/making_school_asignment_app/macos/RunnerTests/RunnerTests.swift b/making_school_asignment_app/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..61f3bd1 --- /dev/null +++ b/making_school_asignment_app/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/pubspec.lock b/making_school_asignment_app/pubspec.lock similarity index 61% rename from pubspec.lock rename to making_school_asignment_app/pubspec.lock index 9917f15..384aeab 100644 --- a/pubspec.lock +++ b/making_school_asignment_app/pubspec.lock @@ -5,32 +5,32 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 - url: "https://pub.dev" + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + url: "https://pub.flutter-io.cn" source: hosted - version: "64.0.0" + version: "67.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" - url: "https://pub.dev" + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + url: "https://pub.flutter-io.cn" source: hosted - version: "6.2.0" + version: "6.4.1" args: dependency: transitive description: name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 - url: "https://pub.dev" + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.2" + version: "2.5.0" async: dependency: transitive description: name: async sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.11.0" badges: @@ -38,7 +38,7 @@ packages: description: name: badges sha256: a7b6bbd60dce418df0db3058b53f9d083c22cdb5132a052145dc267494df0b84 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.2" boolean_selector: @@ -46,7 +46,7 @@ packages: description: name: boolean_selector sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" build: @@ -54,7 +54,7 @@ packages: description: name: build sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" build_config: @@ -62,39 +62,39 @@ packages: description: name: build_config sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" - url: "https://pub.dev" + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.1" + version: "4.0.2" build_resolvers: dependency: transitive description: name: build_resolvers sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.2" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22" - url: "https://pub.dev" + sha256: "1414d6d733a85d8ad2f1dfcb3ea7945759e35a123cb99ccfac75d0758f75edfa" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.9" + version: "2.4.10" build_runner_core: dependency: transitive description: name: build_runner_core sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "7.3.0" built_collection: @@ -102,23 +102,23 @@ packages: description: name: built_collection sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e - url: "https://pub.dev" + sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + url: "https://pub.flutter-io.cn" source: hosted - version: "8.9.1" + version: "8.9.2" cached_network_image: dependency: "direct main" description: name: cached_network_image sha256: "28ea9690a8207179c319965c13cd8df184d5ee721ae2ce60f398ced1219cea1f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.3.1" cached_network_image_platform_interface: @@ -126,23 +126,23 @@ packages: description: name: cached_network_image_platform_interface sha256: "9e90e78ae72caa874a323d78fa6301b3fb8fa7ea76a8f96dc5b5bf79f283bf2f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - sha256: "42a835caa27c220d1294311ac409a43361088625a4f23c820b006dd9bffb3316" - url: "https://pub.dev" + sha256: "205d6a9f1862de34b93184f22b9d2d94586b2f05c581d546695e3d8f6a805cd7" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.1" + version: "1.2.0" characters: dependency: transitive description: name: characters sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" checked_yaml: @@ -150,7 +150,7 @@ packages: description: name: checked_yaml sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" clock: @@ -158,7 +158,7 @@ packages: description: name: clock sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" code_builder: @@ -166,39 +166,39 @@ packages: description: name: code_builder sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.10.0" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" - url: "https://pub.dev" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.flutter-io.cn" source: hosted - version: "1.17.1" + version: "1.18.0" connectivity_plus: dependency: "direct main" description: name: connectivity_plus - sha256: b74247fad72c171381dbe700ca17da24deac637ab6d43c343b42867acb95c991 - url: "https://pub.dev" + sha256: db7a4e143dc72cc3cb2044ef9b052a7ebfe729513e6a82943bc3526f784365b8 + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.6" + version: "6.0.3" connectivity_plus_platform_interface: dependency: transitive description: name: connectivity_plus_platform_interface - sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a - url: "https://pub.dev" + sha256: b6a56efe1e6675be240de39107281d4034b64ac23438026355b4234042a35adb + url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.4" + version: "2.0.0" convert: dependency: transitive description: name: convert sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" crypto: @@ -206,7 +206,7 @@ packages: description: name: crypto sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.3" csslib: @@ -214,23 +214,23 @@ packages: description: name: csslib sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d - url: "https://pub.dev" + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.6" + version: "1.0.8" dart_style: dependency: transitive description: name: dart_style sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.6" data_table_2: @@ -238,7 +238,7 @@ packages: description: name: data_table_2 sha256: e403de6d9a58dddf27700114b614ea8ea5aa8442d7fbdfbe8b3d11b0512e7a49 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.5.12" dbus: @@ -246,23 +246,23 @@ packages: description: name: dbus sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.10" dio: dependency: "direct main" description: name: dio - sha256: "0978e9a3e45305a80a7210dbeaf79d6ee8bee33f70c8e542dc654c952070217f" - url: "https://pub.dev" + sha256: "11e40df547d418cc0c4900a9318b26304e665da6fa4755399a9ff9efd09034b5" + url: "https://pub.flutter-io.cn" source: hosted - version: "5.4.2+1" + version: "5.4.3+1" dropdown_button2: dependency: "direct main" description: name: dropdown_button2 sha256: b0fe8d49a030315e9eef6c7ac84ca964250155a6224d491c1365061bc974a9e1 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.9" equatable: @@ -270,7 +270,7 @@ packages: description: name: equatable sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" fake_async: @@ -278,23 +278,23 @@ packages: description: name: fake_async sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" - url: "https://pub.dev" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.2" file: dependency: transitive description: name: file sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.0" fixnum: @@ -302,17 +302,17 @@ packages: description: name: fixnum sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" fl_chart: dependency: "direct main" description: name: fl_chart - sha256: "48a1b69be9544e2b03d9a8e843affd89e43f3194c9248776222efcb4206bb1ec" - url: "https://pub.dev" + sha256: d0f0d49112f2f4b192481c16d05b6418bd7820e021e265a3c22db98acf7ed7fb + url: "https://pub.flutter-io.cn" source: hosted - version: "0.62.0" + version: "0.68.0" flutter: dependency: "direct main" description: flutter @@ -322,16 +322,16 @@ packages: dependency: transitive description: name: flutter_cache_manager - sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba" - url: "https://pub.dev" + sha256: "395d6b7831f21f3b989ebedbb785545932adb9afe2622c1ffacf7f4b53a7e544" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.3.1" + version: "3.3.2" flutter_easyloading: dependency: "direct main" description: name: flutter_easyloading sha256: ba21a3c883544e582f9cc455a4a0907556714e1e9cf0eababfcb600da191d17c - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.5" flutter_easyrefresh: @@ -339,17 +339,17 @@ packages: description: name: flutter_easyrefresh sha256: "5d161ee5dcac34da9065116568147d742dd25fb9bff3b10024d9054b195087ad" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.2" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.dev" + sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.3" + version: "3.0.2" flutter_localizations: dependency: "direct main" description: flutter @@ -359,26 +359,26 @@ packages: dependency: "direct main" description: name: flutter_screenutil - sha256: "0a122936b450324cbdfd51be0819cc6fcebb093eb65585e9cd92263f7a1a8a39" - url: "https://pub.dev" + sha256: b372c35a772a1dc84142a3b9c5ee89a390834bd258e5e6a450d9b975b985d1c9 + url: "https://pub.flutter-io.cn" source: hosted - version: "5.7.0" + version: "5.9.1" flutter_spinkit: dependency: transitive description: name: flutter_spinkit sha256: d2696eed13732831414595b98863260e33e8882fc069ee80ec35d4ac9ddb0472 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.2.1" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view - sha256: "1312314293acceb65b92754298754801b0e1f26a1845833b740b30415bbbcf07" - url: "https://pub.dev" + sha256: "19e7abb550c96fbfeb546b23f3ff356ee7c59a019a651f8f102a4ba9b7349395" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.2" + version: "0.7.0" flutter_test: dependency: "direct dev" description: flutter @@ -393,48 +393,56 @@ packages: dependency: "direct main" description: name: flutter_widget_from_html_core - sha256: "22140caa191cb4bba0fe4d5e4ad875c7e8a9ba47d61517f56d733019cf76396d" - url: "https://pub.dev" + sha256: cc1d9be3d187ce668ee02091cd5442dfb050cdaf98e0ab9a4d12ad008f966979 + url: "https://pub.flutter-io.cn" source: hosted - version: "0.10.6" + version: "0.14.12" fluttertoast: dependency: "direct main" description: name: fluttertoast - sha256: dfdde255317af381bfc1c486ed968d5a43a2ded9c931e87cbecd88767d6a71c1 - url: "https://pub.dev" + sha256: "81b68579e23fcbcada2db3d50302813d2371664afe6165bc78148050ab94bf66" + url: "https://pub.flutter-io.cn" source: hosted - version: "8.2.4" + version: "8.2.5" frontend_server_client: dependency: transitive description: name: frontend_server_client sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" + functional_widget: + dependency: "direct dev" + description: + name: functional_widget + sha256: "5a1c64661572d927a1ddab943dea2eb8dd261275a2e989a86aa0db7613d16185" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.10.2" functional_widget_annotation: dependency: "direct main" description: name: functional_widget_annotation sha256: f0612079cb7e226b7be32b473bdaf85fe680370886c0c13ea69a102ccc17a0c7 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.10.0" get: dependency: "direct main" description: name: get - sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" - url: "https://pub.dev" + sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e + url: "https://pub.flutter-io.cn" source: hosted - version: "4.6.5" + version: "4.6.6" get_storage: dependency: "direct main" description: name: get_storage sha256: "39db1fffe779d0c22b3a744376e86febe4ade43bf65e06eab5af707dc84185a2" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" glob: @@ -442,7 +450,7 @@ packages: description: name: glob sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" graphs: @@ -450,7 +458,7 @@ packages: description: name: graphs sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" html: @@ -458,23 +466,23 @@ packages: description: name: html sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.15.4" http: dependency: transitive description: name: http - sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" - url: "https://pub.dev" + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.2.1" http_multi_server: dependency: transitive description: name: http_multi_server sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" http_parser: @@ -482,111 +490,135 @@ packages: description: name: http_parser sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.2" intl: dependency: transitive description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 - url: "https://pub.dev" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.flutter-io.cn" source: hosted - version: "0.18.0" + version: "0.19.0" io: dependency: transitive description: name: io sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" js: dependency: transitive description: name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.7" + version: "0.7.1" json_annotation: dependency: "direct main" description: name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 - url: "https://pub.dev" + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.8.1" + version: "4.9.0" json_serializable: dependency: "direct dev" description: name: json_serializable - sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 - url: "https://pub.dev" + sha256: ea1432d167339ea9b5bb153f0571d0039607a873d6e04e0117af043f14a1fd4b + url: "https://pub.flutter-io.cn" source: hosted - version: "6.7.1" + version: "6.8.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.0.4" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.3" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.1" lints: dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.dev" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "3.0.0" logger: dependency: "direct main" description: name: logger - sha256: "7ad7215c15420a102ec687bb320a7312afd449bac63bfb1c60d9787c27b9767f" - url: "https://pub.dev" + sha256: af05cc8714f356fd1f3888fb6741cbe9fbe25cdb6eedbab80e1a6db21047d4a4 + url: "https://pub.flutter-io.cn" source: hosted - version: "1.4.0" + version: "2.3.0" logging: dependency: transitive description: name: logging sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" - url: "https://pub.dev" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.15" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 - url: "https://pub.dev" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.1" + version: "1.12.0" mime: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.4" + version: "1.0.5" nm: dependency: transitive description: name: nm sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.0" octo_image: @@ -594,7 +626,7 @@ packages: description: name: octo_image sha256: "45b40f99622f11901238e18d48f5f12ea36426d8eced9f4cbf58479c7aa2430d" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" package_config: @@ -602,55 +634,63 @@ packages: description: name: package_config sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" - package_info: + package_info_plus: dependency: "direct main" description: - name: package_info - sha256: "6c07d9d82c69e16afeeeeb6866fe43985a20b3b50df243091bfc4a4ad2b03b75" - url: "https://pub.dev" + name: package_info_plus + sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.2" + version: "8.0.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider: dependency: transitive description: name: path_provider - sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b - url: "https://pub.dev" + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.2" + version: "2.1.3" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" - url: "https://pub.dev" + sha256: "51f0d2c554cfbc9d6a312ab35152fc77e2f0b758ce9f1a444a3a1e5b8f3c6b7f" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.2" + version: "2.2.3" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" - url: "https://pub.dev" + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.2" + version: "2.4.0" path_provider_linux: dependency: transitive description: name: path_provider_linux sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" path_provider_platform_interface: @@ -658,7 +698,7 @@ packages: description: name: path_provider_platform_interface sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" path_provider_windows: @@ -666,7 +706,7 @@ packages: description: name: path_provider_windows sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" percent_indicator: @@ -674,31 +714,31 @@ packages: description: name: percent_indicator sha256: c37099ad833a883c9d71782321cb65c3a848c21b6939b6185f0ff6640d05814c - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.3" petitparser: dependency: transitive description: name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 - url: "https://pub.dev" + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.flutter-io.cn" source: hosted - version: "5.4.0" + version: "6.0.2" photo_view: dependency: "direct main" description: name: photo_view - sha256: "8036802a00bae2a78fc197af8a158e3e2f7b500561ed23b4c458107685e645bb" - url: "https://pub.dev" + sha256: "1fc3d970a91295fbd1364296575f854c9863f225505c28c46e0a03e48960c75e" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.14.0" + version: "0.15.0" platform: dependency: transitive description: name: platform sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.4" plugin_platform_interface: @@ -706,7 +746,7 @@ packages: description: name: plugin_platform_interface sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.8" pool: @@ -714,15 +754,23 @@ packages: description: name: pool sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.1" + protobuf: + dependency: transitive + description: + name: protobuf + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.0" pub_semver: dependency: transitive description: name: pub_semver sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" pubspec_parse: @@ -730,7 +778,7 @@ packages: description: name: pubspec_parse sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.3" retrofit: @@ -738,23 +786,23 @@ packages: description: name: retrofit sha256: "13a2865c0d97da580ea4e3c64d412d81f365fd5b26be2a18fca9582e021da37a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" retrofit_generator: dependency: "direct dev" description: name: retrofit_generator - sha256: "9499eb46b3657a62192ddbc208ff7e6c6b768b19e83c1ee6f6b119c864b99690" - url: "https://pub.dev" + sha256: a962be21403c2ecdd82d06c863340cff759642ae6ecac5a2c74a9a60377592c3 + url: "https://pub.flutter-io.cn" source: hosted - version: "7.0.8" + version: "8.1.0" rxdart: dependency: transitive description: name: rxdart sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.27.7" shelf: @@ -762,17 +810,17 @@ packages: description: name: shelf sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" - url: "https://pub.dev" + sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.4" + version: "2.0.0" sky_engine: dependency: transitive description: flutter @@ -783,7 +831,7 @@ packages: description: name: source_gen sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.0" source_helper: @@ -791,63 +839,63 @@ packages: description: name: source_helper sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.4" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.dev" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.1" + version: "1.10.0" sprintf: dependency: transitive description: name: sprintf sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.0" sqflite: dependency: transitive description: name: sqflite - sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6 - url: "https://pub.dev" + sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d + url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.2" + version: "2.3.3+1" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "28d8c66baee4968519fb8bd6cdbedad982d6e53359091f0b74544a9f32ec72d5" - url: "https://pub.dev" + sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.5.3" + version: "2.5.4" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: name: stream_transform sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" string_scanner: @@ -855,31 +903,31 @@ packages: description: name: string_scanner sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" syncfusion_flutter_core: dependency: transitive description: name: syncfusion_flutter_core - sha256: "8db8f55c77f56968681447d3837c10f27a9e861e238a898fda116c7531def979" - url: "https://pub.dev" + sha256: "63108a33f9b0d89f7b6b56cce908b8e519fe433dbbe0efcf41ad3e8bb2081bd9" + url: "https://pub.flutter-io.cn" source: hosted - version: "21.2.10" + version: "25.2.5" syncfusion_flutter_datepicker: dependency: "direct main" description: name: syncfusion_flutter_datepicker - sha256: "6b0dacfe2f968de2b9107e2dc24fcaa2499415ae655df8f0d3ad0356eb090213" - url: "https://pub.dev" + sha256: c2bda86a6137a64168584a36959bad9141cc9305f274b2a15f233074b92700a4 + url: "https://pub.flutter-io.cn" source: hosted - version: "21.2.10" + version: "25.2.5" synchronized: dependency: transitive description: name: synchronized sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0+1" term_glyph: @@ -887,23 +935,23 @@ packages: description: name: term_glyph sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb - url: "https://pub.dev" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.5.1" + version: "0.7.0" timing: dependency: transitive description: name: timing sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" tuple: @@ -911,7 +959,7 @@ packages: description: name: tuple sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" typed_data: @@ -919,73 +967,97 @@ packages: description: name: typed_data sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.2" uuid: dependency: transitive description: name: uuid - sha256: "22c94e5ad1e75f9934b766b53c742572ee2677c56bc871d850a57dad0f82127f" - url: "https://pub.dev" + sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.2.2" + version: "4.4.0" vector_math: dependency: transitive description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + url: "https://pub.flutter-io.cn" + source: hosted + version: "14.2.1" watcher: dependency: transitive description: name: watcher sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.5.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "217f49b5213796cb508d6a942a5dc604ce1cb6a0a6b3d8cb3f0c314f0ecea712" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.1.4" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b - url: "https://pub.dev" + sha256: a2d56211ee4d35d9b344d9d4ce60f362e4f5d1aafb988302906bd732bc731276 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.0" + version: "3.0.0" win32: dependency: transitive description: name: win32 - sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" - url: "https://pub.dev" + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 + url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.9" + version: "5.5.1" xdg_directories: dependency: transitive description: name: xdg_directories sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" xml: dependency: transitive description: name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" - url: "https://pub.dev" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.flutter-io.cn" source: hosted - version: "6.3.0" + version: "6.5.0" yaml: dependency: transitive description: name: yaml sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.2" sdks: - dart: ">=3.0.1 <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.4.1 <4.0.0" + flutter: ">=3.19.0" diff --git a/pubspec.yaml b/making_school_asignment_app/pubspec.yaml similarity index 86% rename from pubspec.yaml rename to making_school_asignment_app/pubspec.yaml index 3548ccc..7afcd22 100644 --- a/pubspec.yaml +++ b/making_school_asignment_app/pubspec.yaml @@ -1,8 +1,8 @@ -name: school_asignment_app -description: A new Flutter project. +name: making_school_asignment_app +description: "A new Flutter project." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: "none" # Remove this line if you wish to publish to pub.dev +publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -19,7 +19,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=3.0.1 <4.0.0" + sdk: '>=3.4.1 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -35,83 +35,86 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 + cupertino_icons: ^1.0.6 # 路由、依赖、状态插件 get: ^4.6.5 # loading插件 flutter_easyloading: ^3.0.5 # 日志插件 - logger: ^1.1.0 + logger: ^2.3.0 # 屏幕尺寸计算插件 - flutter_screenutil: 5.7.0 + flutter_screenutil: ^5.9.1 # http请求插件 dio: ^5.4.2+1 # 网络缓存图片 cached_network_image: ^3.2.1 # 上拉加载和下拉刷新的组件 flutter_easyrefresh: ^2.2.2 - photo_view: ^0.14.0 + photo_view: ^0.15.0 # 加密验签插件,支持SHA MD5 HMAC crypto: ^3.0.2 # 获取app版本号 - package_info: ^2.0.2 + package_info_plus: ^8.0.0 # 网络监控 - connectivity_plus: ^3.0.6 + connectivity_plus: ^6.0.3 # toast组件用于系统尚未初始化完成时 fluttertoast: ^8.0.9 # functional_widget_annotation: ^0.10.0 - flutter_widget_from_html_core: ^0.10.3 + flutter_widget_from_html_core: ^0.14.12 # APP内存及本地存储插件 get_storage: ^2.0.3 # start retrofit请求封装 - json_annotation: ^4.8.1 retrofit: ^4.1.0 + json_annotation: ^4.9.0 # end retrofit请求封装 # 进度条 percent_indicator: ^4.2.3 badges: ^3.1.2 # 图表 - fl_chart: ^0.62.0 + fl_chart: ^0.68.0 data_table_2: ^2.5.10 - flutter_staggered_grid_view: ^0.6.2 + flutter_staggered_grid_view: ^0.7.0 dropdown_button2: ^2.3.9 - syncfusion_flutter_datepicker: ^21.2.10 + syncfusion_flutter_datepicker: ^25.2.5 dev_dependencies: flutter_test: sdk: flutter - retrofit_generator: ^7.0.8 - build_runner: ^2.4.9 - json_serializable: ^6.3.1 - + retrofit_generator: ^8.1.0 + build_runner: ^2.4.10 + json_serializable: ^6.6.2 + # 分离样式 + functional_widget: ^0.10.2 # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^2.0.0 + flutter_lints: ^3.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter packages. flutter: + # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg assets: - assets/images/ - assets/images/2.0x/ - assets/images/3.0x/ - assets/images/4.0x/ + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware @@ -124,9 +127,10 @@ flutter: # list giving the asset and other descriptors for the font. For # example: fonts: - - family: AlibabaIcon - fonts: - - asset: assets/icons/iconfont.ttf + - family: AlibabaIcon + fonts: + - asset: assets/icons/iconfont.ttf + # fonts: # - family: Schyler # fonts: # - asset: fonts/Schyler-Regular.ttf diff --git a/test/widget_test.dart b/making_school_asignment_app/test/widget_test.dart similarity index 94% rename from test/widget_test.dart rename to making_school_asignment_app/test/widget_test.dart index e1a7acc..4483744 100644 --- a/test/widget_test.dart +++ b/making_school_asignment_app/test/widget_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:school_asignment_app/main.dart'; +import 'package:making_school_asignment_app/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { diff --git a/making_school_asignment_app/web/favicon.png b/making_school_asignment_app/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/making_school_asignment_app/web/favicon.png differ diff --git a/making_school_asignment_app/web/icons/Icon-192.png b/making_school_asignment_app/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/making_school_asignment_app/web/icons/Icon-192.png differ diff --git a/making_school_asignment_app/web/icons/Icon-512.png b/making_school_asignment_app/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/making_school_asignment_app/web/icons/Icon-512.png differ diff --git a/making_school_asignment_app/web/icons/Icon-maskable-192.png b/making_school_asignment_app/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/making_school_asignment_app/web/icons/Icon-maskable-192.png differ diff --git a/making_school_asignment_app/web/icons/Icon-maskable-512.png b/making_school_asignment_app/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/making_school_asignment_app/web/icons/Icon-maskable-512.png differ diff --git a/making_school_asignment_app/web/index.html b/making_school_asignment_app/web/index.html new file mode 100644 index 0000000..c684d25 --- /dev/null +++ b/making_school_asignment_app/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + making_school_asignment_app + + + + + + diff --git a/making_school_asignment_app/web/manifest.json b/making_school_asignment_app/web/manifest.json new file mode 100644 index 0000000..162479b --- /dev/null +++ b/making_school_asignment_app/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "making_school_asignment_app", + "short_name": "making_school_asignment_app", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/making_school_asignment_app/windows/.gitignore b/making_school_asignment_app/windows/.gitignore new file mode 100644 index 0000000..d492d0d --- /dev/null +++ b/making_school_asignment_app/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/making_school_asignment_app/windows/CMakeLists.txt b/making_school_asignment_app/windows/CMakeLists.txt new file mode 100644 index 0000000..5732e21 --- /dev/null +++ b/making_school_asignment_app/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(making_school_asignment_app LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "making_school_asignment_app") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/making_school_asignment_app/windows/flutter/CMakeLists.txt b/making_school_asignment_app/windows/flutter/CMakeLists.txt new file mode 100644 index 0000000..903f489 --- /dev/null +++ b/making_school_asignment_app/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/making_school_asignment_app/windows/flutter/generated_plugin_registrant.cc b/making_school_asignment_app/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..8777c93 --- /dev/null +++ b/making_school_asignment_app/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,14 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); +} diff --git a/making_school_asignment_app/windows/flutter/generated_plugin_registrant.h b/making_school_asignment_app/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/making_school_asignment_app/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/making_school_asignment_app/windows/flutter/generated_plugins.cmake b/making_school_asignment_app/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..cc1361d --- /dev/null +++ b/making_school_asignment_app/windows/flutter/generated_plugins.cmake @@ -0,0 +1,24 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + connectivity_plus +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/making_school_asignment_app/windows/runner/CMakeLists.txt b/making_school_asignment_app/windows/runner/CMakeLists.txt new file mode 100644 index 0000000..394917c --- /dev/null +++ b/making_school_asignment_app/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/making_school_asignment_app/windows/runner/Runner.rc b/making_school_asignment_app/windows/runner/Runner.rc new file mode 100644 index 0000000..841566a --- /dev/null +++ b/making_school_asignment_app/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.yuanxuan" "\0" + VALUE "FileDescription", "making_school_asignment_app" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "making_school_asignment_app" "\0" + VALUE "LegalCopyright", "Copyright (C) 2024 com.yuanxuan. All rights reserved." "\0" + VALUE "OriginalFilename", "making_school_asignment_app.exe" "\0" + VALUE "ProductName", "making_school_asignment_app" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/making_school_asignment_app/windows/runner/flutter_window.cpp b/making_school_asignment_app/windows/runner/flutter_window.cpp new file mode 100644 index 0000000..955ee30 --- /dev/null +++ b/making_school_asignment_app/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/making_school_asignment_app/windows/runner/flutter_window.h b/making_school_asignment_app/windows/runner/flutter_window.h new file mode 100644 index 0000000..6da0652 --- /dev/null +++ b/making_school_asignment_app/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/making_school_asignment_app/windows/runner/main.cpp b/making_school_asignment_app/windows/runner/main.cpp new file mode 100644 index 0000000..da6fc06 --- /dev/null +++ b/making_school_asignment_app/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"making_school_asignment_app", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/making_school_asignment_app/windows/runner/resource.h b/making_school_asignment_app/windows/runner/resource.h new file mode 100644 index 0000000..66a65d1 --- /dev/null +++ b/making_school_asignment_app/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/making_school_asignment_app/windows/runner/resources/app_icon.ico b/making_school_asignment_app/windows/runner/resources/app_icon.ico new file mode 100644 index 0000000..c04e20c Binary files /dev/null and b/making_school_asignment_app/windows/runner/resources/app_icon.ico differ diff --git a/making_school_asignment_app/windows/runner/runner.exe.manifest b/making_school_asignment_app/windows/runner/runner.exe.manifest new file mode 100644 index 0000000..a42ea76 --- /dev/null +++ b/making_school_asignment_app/windows/runner/runner.exe.manifest @@ -0,0 +1,20 @@ + + + + + PerMonitorV2 + + + + + + + + + + + + + + + diff --git a/making_school_asignment_app/windows/runner/utils.cpp b/making_school_asignment_app/windows/runner/utils.cpp new file mode 100644 index 0000000..3a0b465 --- /dev/null +++ b/making_school_asignment_app/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/making_school_asignment_app/windows/runner/utils.h b/making_school_asignment_app/windows/runner/utils.h new file mode 100644 index 0000000..3879d54 --- /dev/null +++ b/making_school_asignment_app/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/making_school_asignment_app/windows/runner/win32_window.cpp b/making_school_asignment_app/windows/runner/win32_window.cpp new file mode 100644 index 0000000..60608d0 --- /dev/null +++ b/making_school_asignment_app/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/making_school_asignment_app/windows/runner/win32_window.h b/making_school_asignment_app/windows/runner/win32_window.h new file mode 100644 index 0000000..e901dde --- /dev/null +++ b/making_school_asignment_app/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_