diff --git a/.gitignore b/.gitignore index 57cd9a1..8ac2b6e 100644 --- a/.gitignore +++ b/.gitignore @@ -187,3 +187,12 @@ marking_app/lib/pages/homework_correction/eventBus/job_notes_view_bus.g.dart marking_app/lib/common/model/job/job_report_model.g.dart marking_app/lib/common/model/job/job_report_join_class.g.dart marking_app/lib/pages/homework_correction/job_report.g.dart +marking_app/lib/common/model/report/detail_base_info.g.dart +marking_app/lib/common/model/report/exam_records_all.g.dart +marking_app/lib/common/model/report/exam_records_params.g.dart +marking_app/lib/common/model/report/exam_records.g.dart +marking_app/lib/common/model/report/question_know_point.g.dart +marking_app/lib/common/model/report/report_card_params.g.dart +marking_app/lib/common/model/report/report_card.g.dart +marking_app/lib/common/model/report/report_marking_detail_params.g.dart +marking_app/lib/common/model/report/report_marking_detail.g.dart diff --git a/marking_app/lib/common/config/request_config.dart b/marking_app/lib/common/config/request_config.dart index cb14e94..2073b94 100644 --- a/marking_app/lib/common/config/request_config.dart +++ b/marking_app/lib/common/config/request_config.dart @@ -15,13 +15,13 @@ class RequestConfig { static const devLoginBaseUrl = "http://192.168.2.9:6400"; // 基本请求接口 static const devBaseUrlOfReport = "http://192.168.2.9:4000"; // 获取报告接口*/ - static const devBaseUrl = "https://mk-api.23544.com/mb-cli"; // 基本请求 - static const devLoginBaseUrl = "https://mk-api.23544.com"; // 登录接口 + static const devBaseUrl = "https://mk-hw.23544.com"; // 基本请求 + static const devLoginBaseUrl = "https://mk-hw.23544.com"; // 登录接口 static const devBaseUrlOfReport = "https://dc-api.23544.com"; // 获取报告接口 /* 正式地址 */ - static const proBaseUrl = "https://mk-api.23544.com/mb-cli"; // 基本请求 - static const proLoginBaseUrl = "https://mk-api.23544.com"; // 登录接口 + static const proBaseUrl = "https://mk-hw.23544.com"; // 基本请求 + static const proLoginBaseUrl = "https://mk-hw.23544.com"; // 登录接口 static const proBaseUrlOfReport = "https://dc-api.23544.com"; // 获取报告接口 static const proBaseUrlOfHomework = "https://mk-hw.23544.com/hw"; // 获取作业接口 diff --git a/marking_app/lib/common/model/job/job_concerned_with_student_params.dart b/marking_app/lib/common/model/job/job_concerned_with_student_params.dart index e65a297..508bc78 100644 --- a/marking_app/lib/common/model/job/job_concerned_with_student_params.dart +++ b/marking_app/lib/common/model/job/job_concerned_with_student_params.dart @@ -2,15 +2,18 @@ import 'package:json_annotation/json_annotation.dart'; part 'job_concerned_with_student_params.g.dart'; -@JsonSerializable() +@JsonSerializable(includeIfNull: false) class JobConcernedWithStudentParams extends Object { @JsonKey(name: 'taskIds') List taskIds; + @JsonKey(name: 'pageIndex') + int? pageIndex; + @JsonKey(name: 'isCommit') bool? isCommit; - JobConcernedWithStudentParams(this.taskIds, {this.isCommit}); + JobConcernedWithStudentParams(this.taskIds, {this.isCommit, this.pageIndex}); factory JobConcernedWithStudentParams.fromJson(Map srcJson) => _$JobConcernedWithStudentParamsFromJson(srcJson); diff --git a/marking_app/lib/common/model/job/job_report_join_class.dart b/marking_app/lib/common/model/job/job_report_join_class.dart index 9260cfb..b9dccda 100644 --- a/marking_app/lib/common/model/job/job_report_join_class.dart +++ b/marking_app/lib/common/model/job/job_report_join_class.dart @@ -1,9 +1,13 @@ import 'package:json_annotation/json_annotation.dart'; +import 'package:uuid/uuid.dart'; part 'job_report_join_class.g.dart'; @JsonSerializable() class JobReportJoinClass extends Object { + @JsonKey(name: 'uniqueId') + String? uniqueId; + @JsonKey(name: 'schoolId') int schoolId; @@ -28,16 +32,11 @@ class JobReportJoinClass extends Object { @JsonKey(name: 'submitCount') int submitCount; - JobReportJoinClass( - this.schoolId, - this.schoolName, - this.gradeId, - this.gradeName, - this.graduationYear, - this.className, - this.toBeSubmitCount, - this.submitCount, - ); + JobReportJoinClass(this.schoolId, this.schoolName, this.gradeId, this.gradeName, this.graduationYear, this.className, + this.toBeSubmitCount, this.submitCount, + [this.uniqueId]) { + if (uniqueId == null) uniqueId = Uuid().v1(); + } factory JobReportJoinClass.fromJson(Map srcJson) => _$JobReportJoinClassFromJson(srcJson); diff --git a/marking_app/lib/common/model/job/job_report_model.dart b/marking_app/lib/common/model/job/job_report_model.dart index fc33424..4f90709 100644 --- a/marking_app/lib/common/model/job/job_report_model.dart +++ b/marking_app/lib/common/model/job/job_report_model.dart @@ -49,6 +49,22 @@ class JobReportModel extends Object { @JsonKey(name: 'overallTitles') List overallTitles; + // 前端自定义 -- 全对学生 + @JsonKey(name: 'allpairsStudents') + List? allpairsStudents; + + // 前端自定义 -- 及格学生 + @JsonKey(name: 'passStudents') + List? passStudents; + + // 前端自定义 -- 不及格学生 + @JsonKey(name: 'disqualifiedStudents') + List? disqualifiedStudents; + + // 前端自定义 -- 未做学生 + @JsonKey(name: 'notdoneStudents') + List? notdoneStudents; + JobReportModel( this.studentCount, this.finishRate, @@ -64,8 +80,36 @@ class JobReportModel extends Object { this.knowledgeInfos, this.questionAnswerInfos, this.studentAnswerInfos, - this.overallTitles, - ); + this.overallTitles, [ + this.allpairsStudents, + this.passStudents, + this.disqualifiedStudents, + this.notdoneStudents, + ]) { + this.allpairsStudents = []; + this.passStudents = []; + this.disqualifiedStudents = []; + this.notdoneStudents = []; + // 赋值数据 + studentAnswerInfos.forEach((item) { + if (item.correctRate == 100 && item.noAnswerCount == 0) { + // 全对 + allpairsStudents?.add(item); + } + if (item.correctRate >= 60 && item.correctRate < 100) { + // 及格 + passStudents?.add(item); + } + if (item.correctRate >= 0 && item.correctRate < 60) { + // 不及格 + disqualifiedStudents?.add(item); + } + if (questionAnswerInfos.length == item.noAnswerCount) { + // 未做 + notdoneStudents?.add(item); + } + }); + } factory JobReportModel.fromJson(Map srcJson) => _$JobReportModelFromJson(srcJson); diff --git a/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart b/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart index f5c2c6a..7887882 100644 --- a/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart +++ b/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart @@ -1,5 +1,4 @@ import 'package:achievement_view/achievement_view.dart'; -import 'package:badges/badges.dart'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; @@ -248,7 +247,13 @@ Widget $completedHomeworkView(BuildContext context, taskIds: jobTaskItem.markingTasks.map((e) => e.id).toList(), ), InkWell( - onTap: () {}, + onTap: () { + RouterManager.router.navigateTo( + context, + RouterManager.jobReportPagePath + '?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}', + transition: getTransition(), + ); + }, child: Row( children: [ Expanded(flex: 1, child: SizedBox()), diff --git a/marking_app/lib/pages/homework_correction/do_papers_job.dart b/marking_app/lib/pages/homework_correction/do_papers_job.dart index 0283d18..802a65c 100644 --- a/marking_app/lib/pages/homework_correction/do_papers_job.dart +++ b/marking_app/lib/pages/homework_correction/do_papers_job.dart @@ -113,6 +113,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, JobDoPapersStudentBus? studentBus = _useSwitchStudentAndType.studentBusInfo.value; if (studentBus != null && studentBus.pageIndex == thePageIndex) return; // 获取试卷详情数据 定位到对应学生的数据 无需再通知详情获取数据 if (thePageIndex != null) { + _useSwitchStudentAndType.getDataForStudents(taskId: taskId, pageIndex: thePageIndex); int indexLocated = _useSwitchStudentAndType.tabs.value.indexWhere((element) => element.pageIndex == thePageIndex); _useSwitchStudentAndType.eventFire( model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex, @@ -120,19 +121,22 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(indexLocated))); } }); - useValueChanged(_useSwitchStudentAndType.currentStudent.value, (_, __) { + useValueChanged(_useSwitchStudentAndType.currentStudent.value, (oldData, __) { var studentId = _useSwitchStudentAndType.currentStudent.value?.studentId; JobDoPapersStudentBus? studentBus = _useSwitchStudentAndType.studentBusInfo.value; if (studentBus != null && studentBus.studentId == studentId) return; // 获取试卷详情数据 定位到对应学生的数据 无需再通知详情获取数据 var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex; if (thePageIndex != null) // 通知详情数据 + { + int indexLocated = _useSwitchStudentAndType.tabs.value.indexWhere((element) => element.pageIndex == thePageIndex); _useSwitchStudentAndType.eventFire( model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex, studentId: studentId, - nextPageIndex: _useSwitchStudentAndType.getNextPageIndex(thePageIndex), - previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(thePageIndex)), + nextPageIndex: _useSwitchStudentAndType.getNextPageIndex(indexLocated), + previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(indexLocated)), ); + } }); useEffect(() { @@ -162,7 +166,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, print('是否是优先批阅1111:${_useSwitchStudentAndType.isFirst}'); break; case JobCheckSwitchingQuestionTabBus: - // 检查切换试题体型页码 + // 检查切换试题体型 _useSwitchStudentAndType.refreshQuestionTypeData(context, taskId: taskId, exitCallback: exitCallback); break; case MarkingTextQuestionJobTabParams: // 切换试题通知 diff --git a/marking_app/lib/pages/homework_correction/hooks/do_papers_job/use_switch_student_and_type.dart b/marking_app/lib/pages/homework_correction/hooks/do_papers_job/use_switch_student_and_type.dart index 3203178..0366fb6 100644 --- a/marking_app/lib/pages/homework_correction/hooks/do_papers_job/use_switch_student_and_type.dart +++ b/marking_app/lib/pages/homework_correction/hooks/do_papers_job/use_switch_student_and_type.dart @@ -64,11 +64,13 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin { } // 获取学生集合 - getDataForStudents({required int taskId}) async { + getDataForStudents({required int taskId, int? pageIndex}) async { RestClient client = await getClient(); - BaseStructureResult> result = await client.getJobWithStudents( - JobConcernedWithStudentParams([taskId], isCommit: true), - ); + if (pageIndex == null) { + pageIndex = currentTab.value?.pageIndex; + } + BaseStructureResult> result = + await client.getJobWithStudents(JobConcernedWithStudentParams([taskId], isCommit: true, pageIndex: pageIndex)); if (result.success && result.data != null) studentData.value = result.data!; } @@ -149,7 +151,8 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin { if (continueFlag == null || !continueFlag) return tabJob; // 不跳转 */ tabs.value = tabDatas; - currentTab.value = tabJob; + if (tabJob != null) currentTab.value = tabJob; + if (tabJob == null && exitPromptFlag.value) ToastUtils.showSuccess('最后一题提交成功'); return tabJob; } } diff --git a/marking_app/lib/pages/homework_correction/job_report.dart b/marking_app/lib/pages/homework_correction/job_report.dart index ea04596..b1b038a 100644 --- a/marking_app/lib/pages/homework_correction/job_report.dart +++ b/marking_app/lib/pages/homework_correction/job_report.dart @@ -44,7 +44,7 @@ class _JobReportState extends State with CommonMixin { BaseStructureResult> result = await _client.getJobReportJoinClasses(widget.id); if (result.success) { toUpState(setState, () { - involveClasses = [JobReportJoinClass(-1, '全部', -1, '全部', '全部', '全部', -1, -1), ...(result.data ?? [])]; + involveClasses = [JobReportJoinClass(-1, '全部', -1, '全部', '全部', '全部', -1, -1, '-1'), ...(result.data ?? [])]; }, mounted); } } catch (e) { @@ -75,11 +75,17 @@ class _JobReportState extends State with CommonMixin { appBar: AppBar( backgroundColor: Colors.white, title: quickText(widget.title, size: 16.sp, color: Color.fromRGBO(51, 51, 51, 1)), + leading: IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Navigator.of(context).pop(), + ), actions: [ // 下拉框 $DropdownSelection(involveClasses, classData, call: (JobReportJoinClass _classData) { classData = _classData; - toUpState(setState, () => _future = getReport(), mounted); + if (_classData.gradeId == -1) classData = null; + _future = getReport(); + toUpState(setState, () {}, mounted); }), ], ), @@ -96,7 +102,7 @@ class _JobReportState extends State with CommonMixin { ); return ListView( - padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 10.w), + padding: EdgeInsets.symmetric(horizontal: 10.w), children: [ // 顶部图形数据 $TopGraphic(data), @@ -119,27 +125,96 @@ class _JobReportState extends State with CommonMixin { @swidget Widget $dropdownSelection(List? involveClasses, JobReportJoinClass? classData, {required Function(JobReportJoinClass) call}) { - print('有几条数据+${involveClasses?.length}'); if (involveClasses == null) return Container(child: quickText('点击重试')); // 点击重试 return DropdownButton( - value: classData?.gradeId ?? -1, + value: classData?.uniqueId ?? '-1', style: TextStyle(color: Color.fromRGBO(89, 89, 89, 1), fontSize: 12.sp), items: involveClasses.map((e) { return DropdownMenuItem( - value: e.gradeId, - child: quickText(e.graduationYear, size: 12.sp, color: Colors.black), + value: e.uniqueId!, + child: quickText(e.graduationYear + e.className, size: 12.sp, color: Colors.black), ); }).toList(), - onChanged: (int? value) { + onChanged: (String? value) { if (value == null) return; - call(involveClasses.firstWhere((element) => element.gradeId == value)); + call(involveClasses.firstWhere((element) => element.uniqueId == value)); }, ); } /// 顶部图形数据 @swidget -Widget $topGraphic(JobReportModel data) { +Widget $topGraphic(BuildContext context, JobReportModel data) { + void showDetail(String showType) async { + // 全对 及格 不及格 未做 + List students = []; + String title = ''; + switch (showType) { + case '全对': + title = '全对'; + students = data.allpairsStudents!; + break; + case '及格': + title = '及格'; + students = data.passStudents!; + break; + case '不及格': + title = '不及格'; + students = data.disqualifiedStudents!; + break; + case '未做': + title = '未做'; + students = data.notdoneStudents!; + break; + } + + if (students.isEmpty) return ToastUtils.showInfo('没有$title学生'); + // 弹出框展示学生信息 + showDialog( + context: context, + builder: (BuildContext context1) { + return Container( + margin: EdgeInsets.symmetric(vertical: 150.h, horizontal: 24.w), + padding: EdgeInsets.symmetric(vertical: 15.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(18.sp), + ), + child: Column( + children: [ + Container(child: quickText('$title学生', color: Color.fromRGBO(60, 60, 60, 1), size: 15.sp)), + // Expanded( + // child: ListView(padding: EdgeInsets.symmetric(horizontal: 12.w), children: [ + // DataTable( + // columns: [ + // DataColumn( + // label: quickText('姓名', + // color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), + // numeric: true), + // DataColumn( + // label: quickText('正确率', + // color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), + // numeric: true), + // DataColumn( + // label: quickText('未答题数', + // color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), + // numeric: true), + // ], + // rows: [ + // DataRow(cells: [ + // DataCell(quickText('', color: Color.fromRGBO(61, 61, 61, 1))), + // ]), + // ], + // ), + // ]), + // ) + ], + ), + ); + }, + ); + } + return Container( margin: EdgeInsets.only(top: 16.h, bottom: 10.h), padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 14.h), @@ -218,18 +293,18 @@ Widget $topGraphic(JobReportModel data) { child: Row( children: [ Expanded( - flex: 2, - child: quickText('${data.validCount}份', - color: Colors.white, size: 10.sp, fontWeight: FontWeight.bold)), + flex: 2, + child: + quickText('${data.validCount}份', color: Colors.white, size: 10.sp, fontWeight: FontWeight.bold), + ), SizedBox(width: 1.2.w), Expanded( flex: 7, child: Container( padding: EdgeInsets.all(12.r), decoration: BoxDecoration( - shape: BoxShape.circle, // 设置为圆形 - color: Color.fromRGBO(76, 199, 147, 1), - ), + shape: BoxShape.circle, // 设置为圆形 + color: Color.fromRGBO(76, 199, 147, 1)), child: Row( children: [ Expanded( @@ -396,7 +471,7 @@ Widget $topGraphic(JobReportModel data) { ), SizedBox(height: 8.h), InkWell( - onTap: () {}, + onTap: () => showDetail('全对'), child: Container( width: 77.w, alignment: Alignment.center, @@ -484,7 +559,7 @@ Widget $topGraphic(JobReportModel data) { ), SizedBox(height: 8.h), InkWell( - onTap: () {}, + onTap: () => showDetail('及格'), child: Container( width: 77.w, alignment: Alignment.center, @@ -572,7 +647,7 @@ Widget $topGraphic(JobReportModel data) { ), SizedBox(height: 8.h), InkWell( - onTap: () {}, + onTap: () => showDetail('不及格'), child: Container( width: 77.w, alignment: Alignment.center, @@ -661,7 +736,7 @@ Widget $topGraphic(JobReportModel data) { ), SizedBox(height: 8.h), InkWell( - onTap: () {}, + onTap: () => showDetail('未做'), child: Container( width: 77.w, alignment: Alignment.center, diff --git a/marking_app/lib/pages/homework_correction/review_job.dart b/marking_app/lib/pages/homework_correction/review_job.dart index f03ece9..b38b55a 100644 --- a/marking_app/lib/pages/homework_correction/review_job.dart +++ b/marking_app/lib/pages/homework_correction/review_job.dart @@ -118,11 +118,7 @@ class _ReviewJobState extends State with CommonMixin, SingleTickerPro appBar: PreferredSize( preferredSize: Size.fromHeight(40.h), child: AppBar( - title: quickText( - '回评', - size: 18.sp, - color: Colors.white, - ), + title: quickText('回评', size: 18.sp, color: Colors.white), elevation: 0, // actions: [ // Container( diff --git a/marking_app/lib/routes/RouterManager.dart b/marking_app/lib/routes/RouterManager.dart index 5ee4c23..65926cf 100644 --- a/marking_app/lib/routes/RouterManager.dart +++ b/marking_app/lib/routes/RouterManager.dart @@ -13,6 +13,7 @@ import 'package:fluro/fluro.dart'; import 'package:flutter/material.dart'; import 'package:marking_app/common/model/enum/marking_list_type.dart'; import 'package:marking_app/pages/common/startUpPage.dart'; +import 'package:marking_app/pages/homework_correction/job_report.dart'; import 'package:marking_app/pages/homework_correction/review_job.dart'; import 'package:marking_app/pages/login/index.dart'; @@ -47,6 +48,9 @@ class RouterManager { static const String agreementPath = 'other/agreement_page'; static const String ohterMainPagePath = 'other/index'; + // 作业 + static const String jobReportPagePath = '/job/report/index'; + static const String reportClassTeacherPath = 'report/details/reportClassTeacher'; static const String reportSubjectTeacherPath = 'report/details/reportSubjectTeacher'; static const String reportPersonalSubjectPath = 'report/details/reportPersonalSubject'; @@ -161,7 +165,12 @@ class RouterManager { toPrint(val: '进入跳转报错啦,$e'); } }); - + // 作业报告页面 + static final _jobReportPageHandler = Handler(handlerFunc: (BuildContext? context, Map> params) { + int id = int.parse(params['id']![0]); + String title = params['title']![0]; + return JobReport(id: id, title: title); + }); static final _agreementPageHandler = Handler(handlerFunc: (BuildContext? context, Map> params) { AGREEMENT_KEY key = AGREEMENT_KEY.values.byName(params['type']![0]); return AgreementPage(type: key); @@ -191,10 +200,10 @@ class RouterManager { handlerFunc: (BuildContext? context, Map> params) => TheMine(), ); static final _reportDetailPath = Handler( - handlerFunc: (BuildContext? context, Map> params){ + handlerFunc: (BuildContext? context, Map> params) { int examId = int.parse(params['examId']![0]); bool showGrade = params['showGrade']![0] == 'true'; - return ReportDetail(examId: examId,showGrade:showGrade); + return ReportDetail(examId: examId, showGrade: showGrade); }, ); @@ -248,6 +257,7 @@ class RouterManager { handler: _reportPersonalSubjectPageHandler, transitionType: TransitionType.material); router.define(userMinePath, handler: _userMinePageHandler, transitionType: TransitionType.material); router.define(reportDetailPath, handler: _reportDetailPath, transitionType: TransitionType.material); + router.define(jobReportPagePath, handler: _jobReportPageHandler, transitionType: TransitionType.material); // getTransition() diff --git a/marking_app/pubspec.yaml b/marking_app/pubspec.yaml index 1be5a43..57b548e 100644 --- a/marking_app/pubspec.yaml +++ b/marking_app/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.93 +version: 1.0.95 environment: sdk: ">=2.17.1 <3.0.0" diff --git a/marking_app/windows/runner/CMakeLists.txt b/marking_app/windows/runner/CMakeLists.txt index b9e550f..17411a8 100644 --- a/marking_app/windows/runner/CMakeLists.txt +++ b/marking_app/windows/runner/CMakeLists.txt @@ -20,6 +20,13 @@ add_executable(${BINARY_NAME} WIN32 # 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") diff --git a/marking_app/windows/runner/Runner.rc b/marking_app/windows/runner/Runner.rc index 11f2df6..42f44cc 100644 --- a/marking_app/windows/runner/Runner.rc +++ b/marking_app/windows/runner/Runner.rc @@ -60,14 +60,14 @@ IDI_APP_ICON ICON "resources\\app_icon.ico" // Version // -#ifdef FLUTTER_BUILD_NUMBER -#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER +#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 +#define VERSION_AS_NUMBER 1,0,0,0 #endif -#ifdef FLUTTER_BUILD_NAME -#define VERSION_AS_STRING #FLUTTER_BUILD_NAME +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION #else #define VERSION_AS_STRING "1.0.0" #endif