Merge branch 'mcy_new' into zoom_pic

# Conflicts:
#	making_school_asignment_app/lib/page/home_page/children/read_over/widget/annotate_list.dart
#	making_school_asignment_app/pubspec.yaml
This commit is contained in:
DESKTOP-I3JPKHK\wy 2025-03-21 10:48:22 +08:00
commit d1fd1fb1bc
33 changed files with 1447 additions and 1053 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 69 B

View File

@ -29,7 +29,7 @@
type="application/octet-stream" /> type="application/octet-stream" />
</item> --> </item> -->
<item> <item>
<title>Version 1.0.1+2</title> <title>Version 1.0.3+4</title>
#发行说明-读取html方式(2选1) #发行说明-读取html方式(2选1)
<!-- <sparkle:releaseNotesLink> <!-- <sparkle:releaseNotesLink>
https://your_domain/your_path/release_notes.html https://your_domain/your_path/release_notes.html
@ -38,18 +38,18 @@
<description> <description>
<![CDATA[ <![CDATA[
<ul> <ul>
<li>1、优化批阅提示</li> <li>1、修复已知BUG</li>
<li>2、优化启动图和展示页面</li> <li>2、优化操作布局</li>
</ul> </ul>
]]> ]]>
</description> </description>
<pubDate>Sun, 16 Feb 2024 12:00:00 +0800</pubDate> <pubDate>Fri, 14 Mar 2025 12:00:00 +0800</pubDate>
#你更新程序的地址 #你更新程序的地址
<enclosure url="https://dpc-job-oss.23544.com/infra-app/making_school_asignment_app/1.0.1/3/making_school_asignment_app-1.0.1+2-windows-setup.exe" <enclosure url="https://dpc-job-oss.23544.com/infra-app/making_school_asignment_app/1.0.3/3/making_school_asignment_app-1.0.3+4-windows-setup.exe"
sparkle:dsaSignature="MEUCIG2O7ZNPeIs/fi2GF/UCRvooqIZMFjLPyfGsIqTnmfHkAiEAuFusRpYjkf05fqBv3nQqfyy8Y8u6ub5X+QWZU7NJ5qU=" sparkle:dsaSignature="MEYCIQCuU0BodcdWrF+WoJrWRpY8P1pfK+dKkvrl3ZJ5KxnDdAIhAIWqp7VBNO9IaKFj2ypQ+s7DWurBUSaf6MTvexMmuvX+"
sparkle:version="1.0.1+2"
sparkle:os="windows"
length="0" length="0"
sparkle:version="1.0.3+4"
sparkle:os="windows"
type="application/octet-stream" /> type="application/octet-stream" />
</item> </item>
</channel> </channel>

View File

@ -495,7 +495,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = Z778GC45N8; DEVELOPMENT_TEAM = Z778GC45N8;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -503,7 +503,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1; MARKETING_VERSION = 3;
PRODUCT_BUNDLE_IDENTIFIER = "com.yuanxuan.makingS--buneng--choolAsignmentApp"; PRODUCT_BUNDLE_IDENTIFIER = "com.yuanxuan.makingS--buneng--choolAsignmentApp";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -689,7 +689,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = Z778GC45N8; DEVELOPMENT_TEAM = Z778GC45N8;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -697,7 +697,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1; MARKETING_VERSION = 3;
PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp; PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -719,7 +719,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = Z778GC45N8; DEVELOPMENT_TEAM = Z778GC45N8;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -727,7 +727,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1; MARKETING_VERSION = 3;
PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp; PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@ -44,10 +44,13 @@ class AppVersion extends Object {
this.appFileUrl, this.appFileUrl,
this.description, this.description,
) { ) {
if (appFileUrl != null) appFileUrl = RequestConfig.imgUrl + appFileUrl!; if (appFileUrl != null && ftuType != 2) {
appFileUrl = RequestConfig.imgUrl + appFileUrl!;
}
} }
factory AppVersion.fromJson(Map<String, dynamic> srcJson) => _$AppVersionFromJson(srcJson); factory AppVersion.fromJson(Map<String, dynamic> srcJson) =>
_$AppVersionFromJson(srcJson);
Map<String, dynamic> toJson() => _$AppVersionToJson(this); Map<String, dynamic> toJson() => _$AppVersionToJson(this);
} }

View File

@ -154,7 +154,7 @@ class TheError extends Interceptor {
message = '请求发送超时'; message = '请求发送超时';
break; break;
case DioExceptionType.receiveTimeout: case DioExceptionType.receiveTimeout:
message = '接收超时时发生'; message = '接收超时';
break; break;
case DioExceptionType.badResponse: case DioExceptionType.badResponse:
if (error.response == null) { if (error.response == null) {

View File

@ -21,7 +21,8 @@ import 'upgradeLogic.dart';
class DownloadApk { class DownloadApk {
/// ///
static Future<File?> _downloadAndroid(context, UpdateAppEvent event, UpgradeLogic logic) async { static Future<File?> _downloadAndroid(
context, UpdateAppEvent event, UpgradeLogic logic) async {
/// ///
Directory? storageDir = await getExternalStorageDirectory(); Directory? storageDir = await getExternalStorageDirectory();
final storagePath = storageDir?.path ?? '/'; final storagePath = storageDir?.path ?? '/';
@ -47,10 +48,12 @@ class DownloadApk {
print(e); print(e);
// toPrint(val: e); // toPrint(val: e);
} }
return null;
} }
// apk // apk
static Future<bool> installApk(context, UpdateAppEvent event, UpgradeLogic logic) async { static Future<bool> installApk(
context, UpdateAppEvent event, UpgradeLogic logic) async {
try { try {
logic.loadingApk.value = true; logic.loadingApk.value = true;
File? _apkFile = await _downloadAndroid(context, event, logic); File? _apkFile = await _downloadAndroid(context, event, logic);
@ -73,7 +76,9 @@ class DownloadApk {
actions: [ actions: [
MaterialButton( MaterialButton(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
child: const Text("我已知晓", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), child: const Text("我已知晓",
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold)),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
), ),
], ],
@ -87,12 +92,15 @@ class DownloadApk {
// //
// await SystemNavigator.pop(); // 退APP // await SystemNavigator.pop(); // 退APP
var options = ['应用市场更新APP', '浏览器下载并安装APP']; var options = ['应用市场更新APP', '浏览器下载并安装APP'];
var uri = Uri.parse('market://details?id=com.example.marking_app'); // URI var uri =
if (!await canLaunchUrl(uri)) options.removeAt(0); // Uri.parse('market://details?id=${event.packageName}'); // URI
String? option = await UpgradePermission.showCustomModalBottomSheet(context, options); if (!await canLaunchUrl(uri))
options.removeAt(0); //
String? option = await UpgradePermission.showCustomModalBottomSheet(
context, options);
if (option == '应用市场更新APP') await launchUrl(uri); if (option == '应用市场更新APP') await launchUrl(uri);
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(event.link)); if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(event.link));
} catch (e) {} } catch (_) {}
}); });
print('安装执行完成了..............0.0'); print('安装执行完成了..............0.0');
@ -107,7 +115,8 @@ class DownloadApk {
} }
/// ///
static void showDownloadProgress(context, num received, num total, UpgradeLogic logic) { static void showDownloadProgress(
context, num received, num total, UpgradeLogic logic) {
if (total != -1) { if (total != -1) {
double progress = double.parse((received / total).toStringAsFixed(2)); double progress = double.parse((received / total).toStringAsFixed(2));
// debugPrint('下载进度$progress'); // debugPrint('下载进度$progress');
@ -122,7 +131,8 @@ class RestartWidget extends StatefulWidget {
const RestartWidget({super.key, required this.child}); const RestartWidget({super.key, required this.child});
static restartApp(BuildContext context) { static restartApp(BuildContext context) {
final _RestartWidgetState? state = context.findAncestorStateOfType<_RestartWidgetState>(); final _RestartWidgetState? state =
context.findAncestorStateOfType<_RestartWidgetState>();
state?.restartApp(); state?.restartApp();
} }

View File

@ -14,7 +14,6 @@
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-01-12 15:08:43 * @LastEditTime: 2021-01-12 15:08:43
*/ */
import 'package:auto_updater/auto_updater.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart'; import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/utils/app_upgrade/DownloadApk.dart'; import 'package:making_school_asignment_app/common/utils/app_upgrade/DownloadApk.dart';
@ -34,7 +33,8 @@ class UpdateDialog extends Dialog {
final UpdateAppEvent updateAppEvent; final UpdateAppEvent updateAppEvent;
final String deviceInfo; final String deviceInfo;
const UpdateDialog({super.key, required this.updateAppEvent, required this.deviceInfo}); const UpdateDialog(
{super.key, required this.updateAppEvent, required this.deviceInfo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -72,11 +72,17 @@ class UpdateDialog extends Dialog {
HtmlWidget( HtmlWidget(
updateAppEvent.description, updateAppEvent.description,
customStylesBuilder: (element) { customStylesBuilder: (element) {
return {'color': '#666666', 'font-weight': 'normal', 'text-decoration': 'none'}; return {
'color': '#666666',
'font-weight': 'normal',
'text-decoration': 'none'
};
}, },
onLoadingBuilder: (context, element, loadingProgress) => const CircularProgressIndicator(), onLoadingBuilder: (context, element, loadingProgress) =>
const CircularProgressIndicator(),
renderMode: RenderMode.column, renderMode: RenderMode.column,
textStyle: TextStyle(fontSize: 14.sp, color: Colors.black87), textStyle:
TextStyle(fontSize: 14.sp, color: Colors.black87),
) )
], ],
), ),
@ -97,7 +103,9 @@ class UpdateDialog extends Dialog {
builder: (BuildContext context) { builder: (BuildContext context) {
return WillPopScope( return WillPopScope(
onWillPop: () async => false, onWillPop: () async => false,
child: UpdateDialog(updateAppEvent: updateAppEvent, deviceInfo: updateAppEvent.deviceInfo), child: UpdateDialog(
updateAppEvent: updateAppEvent,
deviceInfo: updateAppEvent.deviceInfo),
); );
}, },
); );
@ -136,7 +144,10 @@ class DownloadProgress extends StatelessWidget {
Container( Container(
height: 6.h, height: 6.h,
), ),
quickText('更新中...', size: 12.sp, fontWeight: FontWeight.w500, color: const Color.fromRGBO(90, 90, 90, 1)) quickText('更新中...',
size: 12.sp,
fontWeight: FontWeight.w500,
color: const Color.fromRGBO(90, 90, 90, 1))
], ],
); );
}); });
@ -152,7 +163,7 @@ class DownloadButton extends StatelessWidget {
// //
Future<bool> toLaunch(UpdateAppEvent data) async { Future<bool> toLaunch(UpdateAppEvent data) async {
var uri = Uri.parse('market://details?id=com.yuanxuan.making_school_asignment_app'); var uri = Uri.parse('market://details?id=${updateAppEvent.packageName}');
if (await canLaunchUrl(uri)) { if (await canLaunchUrl(uri)) {
// //
return await launchUrl(uri); return await launchUrl(uri);
@ -181,15 +192,20 @@ class DownloadButton extends StatelessWidget {
width: 245.w, width: 245.w,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(42.h)), borderRadius: BorderRadius.all(Radius.circular(42.h)),
gradient: LinearGradient(colors: [primaryColor, primaryColor.withOpacity(0.7)]), gradient: LinearGradient(
colors: [primaryColor, primaryColor.withOpacity(0.7)]),
), ),
child: MaterialButton( child: MaterialButton(
onPressed: () => easyThrottle('DownloadButton_App_Upgrade', duration: const Duration(milliseconds: 1000), () async { onPressed: () => easyThrottle('DownloadButton_App_Upgrade',
if (deviceInfo == "android" && updateAppEvent.equipment == Equipment.android) { duration: const Duration(milliseconds: 1000), () async {
if (deviceInfo == "android" &&
updateAppEvent.equipment == Equipment.android) {
// //
bool flag = await UpgradePermission(updateAppEvent.deviceInfo).checkPermission(context, updateAppEvent); bool flag = await UpgradePermission(updateAppEvent.deviceInfo)
.checkPermission(context, updateAppEvent);
if (flag) { if (flag) {
flag = await DownloadApk.installApk(context, updateAppEvent, logic); flag = await DownloadApk.installApk(
context, updateAppEvent, logic);
if (!flag) { if (!flag) {
print('执行到了重置更新按钮的地方....'); print('执行到了重置更新按钮的地方....');
logic.downloadRatio.value = 0.0; // logic.downloadRatio.value = 0.0; //
@ -201,8 +217,10 @@ class DownloadButton extends StatelessWidget {
} }
// await FlutterClipboard.copy(updateAppEvent.link); // await FlutterClipboard.copy(updateAppEvent.link);
// setTimeOut(1000, () => ToastUtils.showInfo('下载链接已经复制到设备,可前往浏览器下载安装')); // setTimeOut(1000, () => ToastUtils.showInfo('下载链接已经复制到设备,可前往浏览器下载安装'));
} else if (deviceInfo == "ios" && updateAppEvent.equipment == Equipment.ios) { } else if (deviceInfo == "ios" &&
updateAppEvent.equipment == Equipment.ios) {
try { try {
print(updateAppEvent.link);
await launchUrlString(updateAppEvent.link); await launchUrlString(updateAppEvent.link);
} catch (e) { } catch (e) {
print('进来更新报错$e'); print('进来更新报错$e');
@ -214,7 +232,8 @@ class DownloadButton extends StatelessWidget {
// await autoUpdater.setScheduledCheckInterval(0); // await autoUpdater.setScheduledCheckInterval(0);
// } // }
}), }),
child: quickText(!logic.loadingApk.value ? '立即体验' : '正在下载...', size: 16.sp, color: Colors.white, fontWeight: FontWeight.w500), child: quickText(!logic.loadingApk.value ? '立即体验' : '正在下载...',
size: 16.sp, color: Colors.white, fontWeight: FontWeight.w500),
), ),
); );
}); });

View File

@ -77,14 +77,15 @@ class UpgradePermission {
// //
// await SystemNavigator.pop(); // 退APP // await SystemNavigator.pop(); // 退APP
var options = ['应用市场更新APP', '浏览器下载并安装APP']; var options = ['应用市场更新APP', '浏览器下载并安装APP'];
var uri = Uri.parse('market://details?id=com.example.marking_app'); // URI var uri = Uri.parse('market://details?id=${updateAppEvent.packageName}'); // URI
// if (!await canLaunchUrl(uri)) options.removeAt(0); // // if (!await canLaunchUrl(uri)) options.removeAt(0); //
String? option = await showCustomModalBottomSheet(context, options); String? option = await showCustomModalBottomSheet(context, options);
if (option == '应用市场更新APP') { if (option == '应用市场更新APP') {
if (await canLaunchUrl(uri)) if (await canLaunchUrl(uri)) {
await launchUrl(uri); await launchUrl(uri);
else } else {
await AppInstaller.goStore('com.example.marking_app', 'iOSAppId'); await AppInstaller.goStore(updateAppEvent.packageName, 'iOSAppId');
}
} }
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(updateAppEvent.link)); if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(updateAppEvent.link));
} else } else

View File

@ -44,7 +44,8 @@ class UpgradeLogic extends GetxController with RequestToolMixin {
return; return;
} }
AppVersion? result = await getClient().getLastAppVersion('making_school_asignment_app', deviceType); AppVersion? result = await getClient()
.getLastAppVersion('making_school_asignment_app', deviceType);
if (result != null) { if (result != null) {
// //
PackageInfo packageInfo = await PackageInfo.fromPlatform(); PackageInfo packageInfo = await PackageInfo.fromPlatform();
@ -60,23 +61,31 @@ class UpgradeLogic extends GetxController with RequestToolMixin {
'systemType': deviceType, 'systemType': deviceType,
'description': result.description ?? 'APP新版本更新' 'description': result.description ?? 'APP新版本更新'
}; };
UpdateAppEvent updateAppEvent = UpdateAppEvent.fromJson(json, localVersion, deviceInfo, appName, packageName, typeName: 'systemType'); UpdateAppEvent updateAppEvent = UpdateAppEvent.fromJson(
json, localVersion, deviceInfo, appName, packageName,
typeName: 'systemType');
if (updateAppEvent.upgrade) { if (updateAppEvent.upgrade) {
DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); if (Platform.isAndroid) {
AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo; DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
Permission storagePermission; AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
if (androidInfo.version.sdkInt >= 33) { Permission storagePermission;
storagePermission = Permission.manageExternalStorage; if (androidInfo.version.sdkInt >= 33) {
} else { storagePermission = Permission.manageExternalStorage;
storagePermission = Permission.storage; } else {
storagePermission = Permission.storage;
}
await PermissionDescribeUtil.instance.toLaunchPermissionRequest(
Get.context ?? context,
title: '储存权限请求',
describe: "为了提供更好的服务需要获取到存储权限用于保存APP升级文件APK进行升级",
permissions: [storagePermission],
);
} }
PermissionDescribeUtil.instance.toLaunchPermissionRequest(
context, await UpdateDialog.showUpdateDialog(
title: '储存权限请求', Get.context ?? context,
describe: "为了提供更好的服务需要获取到存储权限用于保存APP升级文件APK进行升级", updateAppEvent,
permissions: [storagePermission],
); );
await UpdateDialog.showUpdateDialog(context, updateAppEvent);
} }
} }
} finally { } finally {

View File

@ -12,13 +12,18 @@ class PermissionDescribePage extends StatefulWidget {
final String describe; final String describe;
final List<Permission> permissions; final List<Permission> permissions;
const PermissionDescribePage({required this.title, required this.describe, required this.permissions, super.key}); const PermissionDescribePage(
{required this.title,
required this.describe,
required this.permissions,
super.key});
@override @override
State<PermissionDescribePage> createState() => _PermissionDescribePageState(); State<PermissionDescribePage> createState() => _PermissionDescribePageState();
} }
class _PermissionDescribePageState extends State<PermissionDescribePage> with WidgetsBindingObserver { class _PermissionDescribePageState extends State<PermissionDescribePage>
with WidgetsBindingObserver {
Timer? _timerPermission; Timer? _timerPermission;
bool theOpenAppSettings = false; bool theOpenAppSettings = false;
int theExecutionFrequency = 0; int theExecutionFrequency = 0;
@ -132,7 +137,9 @@ class _PermissionDescribePageState extends State<PermissionDescribePage> with Wi
/// ///
/// @param List<Permission> permissions /// @param List<Permission> permissions
Future<List<Permission>> getStoragePermission(BuildContext context, List<Permission> permissions, [int executionFrequency = 0]) async { Future<List<Permission>> getStoragePermission(
BuildContext context, List<Permission> permissions,
[int executionFrequency = 0]) async {
Map<Permission, PermissionStatus> statusRes = await permissions.request(); Map<Permission, PermissionStatus> statusRes = await permissions.request();
List<Permission> permanentRefusal = []; // List<Permission> permanentRefusal = []; //
@ -173,7 +180,8 @@ class _PermissionDescribePageState extends State<PermissionDescribePage> with Wi
executionFrequency++; executionFrequency++;
} }
if (executionFrequency <= 1) { if (executionFrequency <= 1) {
var res = await getStoragePermission(context, [key], executionFrequency); var res =
await getStoragePermission(context, [key], executionFrequency);
permanentRefusal.addAll(res); permanentRefusal.addAll(res);
} else { } else {
permanentRefusal.add(key); permanentRefusal.add(key);
@ -231,12 +239,10 @@ class PermissionDescribeUtil {
PermissionDescribeUtil._internal(); PermissionDescribeUtil._internal();
static get instance { static get instance => _instance ??= PermissionDescribeUtil._internal();
return _instance ??= PermissionDescribeUtil._internal();
}
/// ///
void toLaunchPermissionRequest( Future<void> toLaunchPermissionRequest(
BuildContext context, { BuildContext context, {
required String title, required String title,
required String describe, required String describe,

View File

@ -121,13 +121,36 @@ class Utils {
for (var stu in data.students) { for (var stu in data.students) {
stu.kgtStu = kgt.where((w) => w.studentId == stu.studentId).toList(); stu.kgtStu = kgt.where((w) => w.studentId == stu.studentId).toList();
stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); // stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
// stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
stu.kgtStu!.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
stu.kgtOkCount = stu.kgtStu!.where((w) => w.state == 3).length; stu.kgtOkCount = stu.kgtStu!.where((w) => w.state == 3).length;
stu.kgtErrorCount = stu.kgtStu!.where((w) => w.state == 2).length; stu.kgtErrorCount = stu.kgtStu!.where((w) => w.state == 2).length;
stu.kgtAnswerCount = stu.kgtStu!.where((w) => w.state != 0).length; stu.kgtAnswerCount = stu.kgtStu!.where((w) => w.state != 0).length;
stu.zgtStu = zgt.where((w) => w.studentId == stu.studentId).toList(); stu.zgtStu = zgt.where((w) => w.studentId == stu.studentId).toList();
stu.zgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); // stu.zgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
stu.zgtStu!.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
// //
stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length; stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length;
// //

View File

@ -44,205 +44,208 @@ class _ClassStudentPageState extends State<ClassStudentPage> {
actions: const [ actions: const [
ReturnToHomepage(), ReturnToHomepage(),
], ],
elevation: 0,
), ),
body: Padding( body: Obx(() {
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), return EasyRefresh(
child: Obx(() { firstRefresh: false,
return EasyRefresh( taskIndependence: true,
firstRefresh: false, controller: logic.refreshController,
taskIndependence: true, header: MaterialHeader(),
controller: logic.refreshController, footer: TaurusFooter(),
header: MaterialHeader(), onRefresh: () async {
footer: TaurusFooter(), logic.getList();
onRefresh: () async { },
logic.getList(); child: state.studentList.isNotEmpty
}, ? Utils.isPad()
child: state.studentList.isNotEmpty ? GridView(
? Utils.isPad() shrinkWrap: true,
? GridView( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
shrinkWrap: true, crossAxisCount: 2,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( mainAxisSpacing: 0.r,
crossAxisCount: 2, crossAxisSpacing: 0.r,
mainAxisSpacing: 10.r, childAspectRatio: 556 / 90,
crossAxisSpacing: 10.r, ),
childAspectRatio: 556 / 112, children:
), List.generate(state.studentList.length, (index) {
children: StudentItem item = state.studentList[index];
List.generate(state.studentList.length, (index) { return InkWell(
StudentItem item = state.studentList[index]; onTap: () {
return InkWell( // RouterManager.router.navigateTo(context,
onTap: () { // '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
// RouterManager.router.navigateTo(context, Get.toNamed(Routes.studentWorkDetailPage,
// '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); arguments: {
Get.toNamed(Routes.studentWorkDetailPage, 'studentName': item.name,
arguments: { 'studentId': item.id,
'studentName': item.name, 'subject':state.subject,
'studentId': item.id, });
'subject':state.subject, },
}); child: Container(
}, padding: EdgeInsets.symmetric(horizontal: 10.r),
child: Container( decoration: BoxDecoration(
padding: EdgeInsets.symmetric(horizontal: 10.r), borderRadius:
decoration: BoxDecoration( BorderRadius.all(Radius.circular(0.r)),
borderRadius: color: Colors.transparent,
BorderRadius.all(Radius.circular(10.r)), border: Border(left: BorderSide(width:
color: Colors.white, (index + 1)%2 == 0? 1.r:0,color: const Color(0xFFA5A5A5)),bottom: BorderSide(width: 1.r,color: const Color(0xFFA5A5A5)))
), ),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
item.name, item.name,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Theme.of(context).primaryColor), color: Theme.of(context).primaryColor),
)), )),
state.page == 'answerTrajectory' state.page == 'answerTrajectory'
? Container( ? Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
border: Border.all(
width: 1.r,
color: const Color(0xFFB2DA93)),
borderRadius: BorderRadius.all(
Radius.circular(20.r)),
),
child: Center(
child: Text('详情',
style: TextStyle(
fontSize: 10.r,
color: Color(0xFFB2DA93))),
))
: state.page == 'history'
? Container(
height: 20.r, height: 20.r,
width: 70.r, width: 70.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: border: Border.all(
Theme.of(context).primaryColor, width: 1.r,
borderRadius: color: const Color(0xFFB2DA93)),
BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular( Radius.circular(20.r)),
20.r))), ),
child: Center( child: Center(
child: Text( child: Text('详情',
'历史作业',
style: TextStyle( style: TextStyle(
fontSize: 10.r, fontSize: 10.r,
color: Colors.white), color: Color(0xFFB2DA93))),
)), ))
) : state.page == 'history'
: item.priorityAnnotate ? Container(
? InkWell( height: 20.r,
onTap: () { width: 70.r,
logic.setJobReadLevel( decoration: BoxDecoration(
item.id, false); color:
EasyLoading.show( Theme.of(context).primaryColor,
status: 'loading...'); borderRadius:
}, BorderRadius.all(
child: Container( Radius.circular(
height: 20.r, 20.r))),
width: 80.r, child: Center(
decoration: BoxDecoration( child: Text(
borderRadius: '历史作业',
BorderRadius.all( style: TextStyle(
Radius.circular( fontSize: 10.r,
4.r)), color: Colors.white),
color: const Color( )),
0xFFEBE4FF), )
), : item.priorityAnnotate
child: Row( ? InkWell(
crossAxisAlignment: onTap: () {
CrossAxisAlignment logic.setJobReadLevel(
.start, item.id, false);
children: [ EasyLoading.show(
Padding( status: 'loading...');
padding: },
EdgeInsets.only( child: Container(
left: 3.r), height: 20.r,
child: Image.asset( width: 80.r,
'assets/images/youx_icon_active.png', decoration: BoxDecoration(
width: 14.r, borderRadius:
height: 14.r, BorderRadius.all(
), Radius.circular(
), 4.r)),
Padding( color: const Color(
padding: 0xFFEBE4FF),
EdgeInsets.only(
top: 2.r,
left: 4.r),
child: Text(
'优先批阅',
style: TextStyle(
fontSize: 10.sp,
color: Theme.of(context).primaryColor),
),
),
],
),
), ),
) child: Row(
: InkWell( crossAxisAlignment:
onTap: () { CrossAxisAlignment
logic.setJobReadLevel( .start,
item.id, true); children: [
EasyLoading.show( Padding(
status: 'loading...'); padding:
}, EdgeInsets.only(
child: Container( left: 3.r),
height: 20.r, child: Image.asset(
width: 80.r, 'assets/images/youx_icon_active.png',
decoration: BoxDecoration( width: 14.r,
borderRadius: height: 14.r,
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: Padding(
EdgeInsets.only( padding:
top: 2.r, EdgeInsets.only(
left: 4.r), top: 2.r,
child: Text( left: 4.r),
'优先批阅', child: Text(
style: TextStyle( '优先批阅',
fontSize: 10.sp, style: TextStyle(
color: const Color( fontSize: 10.sp,
0xFF8A9691)), color: Theme.of(context).primaryColor),
),
), ),
], ),
), ],
), ),
), ),
], )
), : 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) { : Padding(
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r),
child: ListView.builder(
itemBuilder: (context, index) {
StudentItem item = state.studentList[index]; StudentItem item = state.studentList[index];
return InkWell( return InkWell(
onTap: () { onTap: () {
@ -414,13 +417,13 @@ class _ClassStudentPageState extends State<ClassStudentPage> {
), ),
), ),
); );
}, },
itemCount: state.studentList.length, itemCount: state.studentList.length,
) ),
: const MyEmptyWidget(), )
); : const MyEmptyWidget(),
}), );
), }),
); );
} }
); );

View File

@ -14,7 +14,7 @@ import 'package:making_school_asignment_app/page/home_page/children/quick_data_c
import 'job_report_logic.dart'; import 'job_report_logic.dart';
class JobReportPage extends StatefulWidget { class JobReportPage extends StatefulWidget {
const JobReportPage({Key? key}) : super(key: key); const JobReportPage({super.key});
@override @override
State<JobReportPage> createState() => _JobReportPageState(); State<JobReportPage> createState() => _JobReportPageState();
@ -26,102 +26,100 @@ class _JobReportPageState extends State<JobReportPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return OrientationBuilder( return OrientationBuilder(builder: (BuildContext context, Orientation orientation) {
builder: (BuildContext context, Orientation orientation){ return Scaffold(
return Scaffold( backgroundColor: Color.fromRGBO(245, 245, 245, 1),
backgroundColor: Color.fromRGBO(245, 245, 245, 1), appBar: AppBar(
appBar: AppBar( backgroundColor: Colors.white,
backgroundColor: Colors.white, centerTitle: true,
centerTitle: true, title: Center(child: Obx(() {
title: Center(child: Obx(() { return quickText(
return quickText( '${state.title.value}作业报告',
'${state.title.value}作业报告', size: 14.sp,
size: 14.sp, color: const Color.fromRGBO(51, 51, 51, 1),
color: const Color.fromRGBO(51, 51, 51, 1), );
); })),
})), leading: IconButton(
leading: IconButton( icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
icon: const Icon(Icons.arrow_back_ios, color: Colors.black), onPressed: () => Get.back(),
onPressed: () => Get.back(), ),
), actions: const [
actions: const [ ReturnToHomepage(),
ReturnToHomepage(), ],
], ),
), body: Obx(() {
body: Obx(() { if (state.hasData.value) {
if (state.hasData.value) { return SingleChildScrollView(
return SingleChildScrollView( child: Column(
child: Column( children: [
children: [ //
// Container(
Container( padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w),
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w), decoration: const BoxDecoration(
decoration: const BoxDecoration( color: Colors.white,
color: Colors.white, ),
), child: Row(
child: Row( children: [
children: [ Obx(() {
Obx(() { return DropdownSelection(
return DropdownSelection( involveClasses: state.involveClasses.value,
involveClasses: state.involveClasses.value, classData: state.classData.value,
classData: state.classData.value, call: (AnnotatedClass item) {
call: (AnnotatedClass item) { state.classData.value = item;
state.classData.value = item; if (item.grade == -1) state.classData.value = state.defaultClass;
if (item.grade == -1) state.classData.value = state.defaultClass; logic.getWorkData();
logic.getWorkData(); });
}); }),
}), // Expanded(child: Text('')),
// Expanded(child: Text('')), ],
], ),
), ),
), //
// TopCount(state.dataCount, state.classData == null ? '' : state.classData.value.className, state.homeworkId.value, state.subject),
TopCount( //
state.dataCount, state.classData == null ? '' : state.classData.value.className, state.homeworkId.value,state.subject), KgtZgtTable(
// studentCount: state.dataCount.studentCount!,
KgtZgtTable( homeworkId: state.homeworkId.value,
studentCount: state.dataCount.studentCount!, kgReport: state.kgReport,
homeworkId: state.homeworkId.value, zgReport: state.zgReport,
kgReport: state.kgReport, kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0),
zgReport: state.zgReport, zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0),
kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0), kgtCorrectRate: state.dataCount.kgtCorrectRate!.toStringAsFixed(0),
zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0), zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0),
kgtCorrectRate: state.dataCount.kgtCorrectRate!.toStringAsFixed(0), subject: state.subject),
zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0), //
subject:state.subject), Container(
// margin: EdgeInsets.symmetric(horizontal: 10.r),
Container( child: KnowledgePoint(
margin: EdgeInsets.symmetric(horizontal: 10.r), knowsList: state.knowsList,
child: KnowledgePoint( data: state.homeData,
knowsList: state.knowsList, className: state.classData.value.className,
data: state.homeData, homeworkId: state.homeworkId.value,
className: state.classData.value.className, subject: state.subject,
homeworkId: state.homeworkId.value, )),
subject:state.subject,)), //
// /* Container(
/* Container(
margin: EdgeInsets.symmetric(horizontal: 10.r), margin: EdgeInsets.symmetric(horizontal: 10.r),
child: $OverallPerformance(data.studentCount, data.overallTitles)), child: $OverallPerformance(data.studentCount, data.overallTitles)),
// //
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 10.r), margin: EdgeInsets.symmetric(horizontal: 10.r),
child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)),*/ 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( SizedBox(
height: 30.r, height: 30.r,
),
],
), ),
); ],
} else { ),
return Padding(padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), child: const MyEmptyWidget()); );
} } else {
}), return Padding(padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), child: const MyEmptyWidget());
); }
} }),
); );
});
} }
@override @override

View File

@ -14,7 +14,8 @@ class KnowledgePoint extends StatefulWidget {
final String className; final String className;
final String homeworkId; final String homeworkId;
final int subject; final int subject;
KnowledgePoint({Key? key, required this.knowsList, required this.data, required this.className, required this.homeworkId,required this.subject}) : super(key: key); const KnowledgePoint(
{super.key, required this.knowsList, required this.data, required this.className, required this.homeworkId, required this.subject});
@override @override
State<KnowledgePoint> createState() => _KnowledgePointState(); State<KnowledgePoint> createState() => _KnowledgePointState();
@ -23,7 +24,7 @@ class KnowledgePoint extends StatefulWidget {
class _KnowledgePointState extends State<KnowledgePoint> { class _KnowledgePointState extends State<KnowledgePoint> {
void goQuickCheckPersonalPath(studentId) { void goQuickCheckPersonalPath(studentId) {
if (studentId != null) { if (studentId != null) {
Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': studentId, 'homeworkId': widget.homeworkId,'subject':widget.subject}); Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': studentId, 'homeworkId': widget.homeworkId, 'subject': widget.subject});
} }
} }
@ -208,89 +209,98 @@ class _KnowledgePointState extends State<KnowledgePoint> {
child: quickText('知识点掌握情况', color: const Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), child: quickText('知识点掌握情况', color: const Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold),
), ),
Expanded( Expanded(
child: widget.knowsList.isNotEmpty? ListView( child: widget.knowsList.isNotEmpty
children: widget.knowsList.value.map((item) { ? ListView(
return Container( children: widget.knowsList.value.map((item) {
margin: EdgeInsets.only(bottom: 15.h, left: 15.r, right: 15.r), return Container(
child: Column( margin: EdgeInsets.only(bottom: 15.h, left: 15.r, right: 15.r),
mainAxisSize: MainAxisSize.min, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Row( children: [
children: [ Row(
Expanded( children: [
flex: 10, Expanded(
child: Row( 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, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
quickText(item.knowledgeName, size: 12.sp, color: const Color.fromRGBO(152, 152, 152, 1)), Expanded(
quickText('${item.okRate!.toStringAsFixed(0)}%', size: 12.sp, color: const Color.fromRGBO(64, 64, 64, 1)), flex: 10,
], child: LinearPercentIndicator(
), padding: EdgeInsets.zero,
), animation: true,
SizedBox(width: 10.w), lineHeight: 10.h,
const Expanded(flex: 1, child: SizedBox()), animationDuration: 2500,
], percent: item.okRate! / 100,
), progressColor: Theme.of(context).primaryColor,
SizedBox(height: 3.h), backgroundColor: const Color.fromRGBO(219, 224, 243, 1),
Row( barRadius: Radius.circular(10.r),
mainAxisAlignment: MainAxisAlignment.spaceBetween, )),
children: [ SizedBox(width: 10.w),
Expanded( InkWell(
flex: 10, onTap: () {
child: LinearPercentIndicator( List<Questions> ques = widget.data.questions
padding: EdgeInsets.zero, .where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1)
animation: true, .toList();
lineHeight: 10.h, List<Students> array2 = [...widget.data.students];
animationDuration: 2500, for (var stu in array2) {
percent: item.okRate! / 100, stu.queDtls = widget.data.dtls
progressColor: Theme.of(context).primaryColor, .where((w) =>
backgroundColor: const Color.fromRGBO(219, 224, 243, 1), w.studentId == stu.studentId &&
barRadius: Radius.circular(10.r), ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1)
)), .toList();
SizedBox(width: 10.w), int okCount = stu.queDtls!.where((w) => w.state == 3).length;
InkWell( int ttlCount = stu.queDtls!.length;
onTap: () { stu.okRate = Utils.calcRate(okCount, ttlCount);
List<Questions> ques = stu.queDtls!.sort((a, b) {
widget.data.questions.where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1).toList(); try {
List<Students> array2 = [...widget.data.students]; if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
for (var stu in array2) { return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
stu.queDtls = widget.data.dtls } else {
.where((w) => throw Exception();
w.studentId == stu.studentId && }
ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1) } catch (e) {
.toList(); return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
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) {
num num1 = num.parse(a.questionNo);
num num2 = num.parse(b.questionNo);
return num1.compareTo(num2);
});
}
showPeopleListDialog( showPeopleListDialog(
context: context, context: context,
title: item.knowledgeName, title: item.knowledgeName,
arr: array2, arr: array2,
); );
}, },
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
quickText('查看', size: 12.sp, color: const Color.fromRGBO(239, 135, 20, 1)), 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)), Icon(Icons.arrow_forward_ios, size: 11.sp, color: const Color.fromRGBO(239, 135, 20, 1)),
],
),
),
], ],
), )
), ],
], ),
) );
], }).toList())
), : MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp),
);
}).toList()): MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp),
), ),
], ],
)); ));

View File

@ -4,6 +4,8 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.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/job/knowledge_points_grasp.dart';
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
import 'package:making_school_asignment_app/common/utils/utils.dart';
import 'knowledge_points_grasp_state.dart'; import 'knowledge_points_grasp_state.dart';
@ -27,9 +29,15 @@ class KnowledgePointsGraspLogic extends GetxController with RequestToolMixin, Ge
} }
void getList() async { void getList() async {
List<KnowledgePointsGrasp> data = await getClient().getKnowledgeReport(state.dateStart, state.dateEnd, textController.text,state.classId,state.subject); try {
state.dataList.value = data; ToastUtils.showLoading();
EasyLoading.dismiss(); List<KnowledgePointsGrasp> data =
await getClient().getKnowledgeReport(state.dateStart, state.dateEnd, textController.text, state.classId, state.subject);
state.dataList.value = data;
} catch (_) {
} finally {
ToastUtils.dismiss();
}
} }
@override @override

View File

@ -1,9 +1,11 @@
import 'package:easy_debounce/easy_throttle.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.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/job/knowledge_points_grasp.dart';
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
import 'package:making_school_asignment_app/common/utils/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/MyEmptyWidget.dart';
import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart';
@ -15,7 +17,7 @@ import 'package:syncfusion_flutter_datepicker/datepicker.dart';
import 'knowledge_points_grasp_logic.dart'; import 'knowledge_points_grasp_logic.dart';
class KnowledgePointsGraspPage extends StatefulWidget { class KnowledgePointsGraspPage extends StatefulWidget {
const KnowledgePointsGraspPage({Key? key}) : super(key: key); const KnowledgePointsGraspPage({super.key});
@override @override
State<KnowledgePointsGraspPage> createState() => _KnowledgePointsGraspPageState(); State<KnowledgePointsGraspPage> createState() => _KnowledgePointsGraspPageState();
@ -27,145 +29,141 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return OrientationBuilder( return OrientationBuilder(builder: (BuildContext context, Orientation orientation) {
builder: (BuildContext context, Orientation orientation){ return Scaffold(
return Scaffold( backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
backgroundColor: Color.fromRGBO(245, 245, 245, 1), appBar: AppBar(
appBar: AppBar( backgroundColor: Colors.white,
backgroundColor: Colors.white, title: Text('知识点掌握', style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333))),
title: Text('知识点掌握', style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))), centerTitle: true,
centerTitle: true, leading: IconButton(
leading: IconButton( icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
icon: Icon(Icons.arrow_back_ios, color: Colors.black), onPressed: () => Get.back(),
onPressed: () => Get.back(), ),
), actions: const [
actions: const [ ReturnToHomepage(),
ReturnToHomepage(), ],
], elevation: 0,
elevation: 0, ),
), body: Column(
body: Column( children: [
children: [ Container(
Container( margin: EdgeInsets.all(15.r),
margin: EdgeInsets.all(15.r), // height: 30.r,
// height: 30.r, child: Row(
child: Row( children: [
children: [ Expanded(
Expanded( child: Container(
child: Container( padding: EdgeInsets.only(left: 10.r, right: 10.r),
padding: EdgeInsets.only(left: 10.r, right: 10.r), decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.r),
borderRadius: BorderRadius.circular(6.r), border: Border.all(width: 1.r, color: const Color(0xFFDDDDDD)),
border: Border.all(width: 1.r, color: Color(0xFFDDDDDD)), color: Colors.white,
color: Colors.white, ),
), child: TextField(
child: TextField( controller: logic.textController,
controller: logic.textController, textInputAction: TextInputAction.next,
textInputAction: TextInputAction.next, style: TextStyle(
style: TextStyle( color: const Color.fromRGBO(80, 87, 103, 1),
color: const Color.fromRGBO(80, 87, 103, 1), fontSize: 10.sp,
fontSize: 10.sp, ),
), decoration: InputDecoration(
decoration: InputDecoration( hintText: "请输入知识点名称",
hintText: "请输入知识点名称", hintStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(153, 153, 153, 1)),
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)),
labelStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(148, 163, 182, 1)), border: InputBorder.none,
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: Theme.of(context).primaryColor,
),
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...'); SizedBox(
if (startTime == null && endTime == null) { width: 10.r,
if (logic.tabController.index == 2) { ),
logic.tabController.animateTo(0); InkWell(
} onTap: () => easyThrottle('zshi_shi_dian_cx', () {
state.dateStart = Utils.getWeekStartDate().toString().substring(0, 10); Utils.hideKeyboard();
state.dateEnd = Utils.getWeekEndDate().toString().substring(0, 10); logic.refreshController.callRefresh();
state.customTimeStr.value = '自定义'; }),
child: Container(
width: 50.r,
height: 30.r,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(4.r), color: Theme.of(context).primaryColor),
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 { } else {
state.dateStart = startTime ?? ''; state.customTimeStr.value = '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
state.dateEnd = endTime ?? '';
} }
}
}
},
);
}),
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; state.page = 1;
logic.getList(); logic.getList();
// _refreshController2.callRefresh();
}, },
refreshTime: (value) { onLoad: () async {
if (value != null && value.startDate != null) { if (state.page < state.totalPages) {
state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? ''; state.page += 1;
if (value.endDate != null) { logic.getList();
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)}';
}
}
} }
}, },
); child: state.dataList.isNotEmpty
}), ? ListView.builder(
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, itemCount: state.dataList.value.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
KnowledgePointsGrasp item = state.dataList[index]; KnowledgePointsGrasp item = state.dataList[index];
@ -176,7 +174,7 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
'dateEnd': state.dateEnd, 'dateEnd': state.dateEnd,
'knowledgeId': item.knowledgeId, 'knowledgeId': item.knowledgeId,
'knowledgeName': item.knowledgeName, 'knowledgeName': item.knowledgeName,
'subject':state.subject 'subject': state.subject
}); });
}, },
child: Container( child: Container(
@ -193,9 +191,9 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
item.knowledgeName, item.knowledgeName,
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), style: TextStyle(fontSize: 14.sp, color: const Color(0xFF505050)),
)), )),
Container( Container(
width: 49.r, width: 49.r,
height: 22.r, height: 22.r,
@ -211,11 +209,16 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
'${item.count}', '${item.count}',
style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor), style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor),
), ),
Image.asset( SizedBox(width: 1.w),
'assets/images/job_data_right_icon.png', Padding(
width: 10.r, padding: EdgeInsets.only(top: 2.h),
height: 10.r, child: Icon(Icons.chevron_right, size: 12.r, color: Theme.of(context).primaryColor),
), ),
// Image.asset(
// 'assets/images/job_data_right_icon.png',
// width: 10.r,
// height: 10.r,
// ),
], ],
), ),
), ),
@ -226,7 +229,7 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
), ),
ProgressBar( ProgressBar(
title: '正确率:', title: '正确率:',
color: Color(0xFFB2DA93), color: const Color(0xFFB2DA93),
percent: item.correctRate / 100, percent: item.correctRate / 100,
padingEdg: EdgeInsets.zero, padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)), marginEdg: EdgeInsets.only(top: 8.h)),
@ -235,15 +238,15 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
), ),
); );
}) })
: const MyEmptyWidget(), : const MyEmptyWidget(),
); );
}), }),
), ),
),
],
), ),
); ],
}); ),
);
});
} }
@override @override

View File

@ -15,7 +15,7 @@ import 'package:making_school_asignment_app/page/global_widget/show_student_list
import 'knowledge_points_grasp_detail_logic.dart'; import 'knowledge_points_grasp_detail_logic.dart';
class KnowledgePointsGraspDetailPage extends StatefulWidget { class KnowledgePointsGraspDetailPage extends StatefulWidget {
const KnowledgePointsGraspDetailPage({Key? key}) : super(key: key); const KnowledgePointsGraspDetailPage({super.key});
@override @override
State<KnowledgePointsGraspDetailPage> createState() => _KnowledgePointsGraspDetailPageState(); State<KnowledgePointsGraspDetailPage> createState() => _KnowledgePointsGraspDetailPageState();
@ -70,42 +70,41 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
return OrientationBuilder( return OrientationBuilder(builder: (BuildContext context, Orientation orientation) {
builder: (BuildContext context, Orientation orientation){ return Scaffold(
return Scaffold( backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
backgroundColor: Color.fromRGBO(245, 245, 245, 1), appBar: AppBar(
appBar: AppBar( backgroundColor: Colors.white,
backgroundColor: Colors.white, title: Obx(() {
title: Obx(() { return Text(state.knowledgeName.value, style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333)));
return Text(state.knowledgeName.value, style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))); }),
}), centerTitle: true,
centerTitle: true, leading: IconButton(
leading: IconButton( icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
icon: Icon(Icons.arrow_back_ios, color: Colors.black), onPressed: () => Get.back(),
onPressed: () => Get.back(), ),
), actions: const [
actions: const [ ReturnToHomepage(),
ReturnToHomepage(), ],
], elevation: 0,
elevation: 0, ),
), body: Padding(
body: Padding( padding: EdgeInsets.symmetric(vertical: 10.r),
padding: EdgeInsets.symmetric(vertical: 10.r), child: Obx(() {
child: Obx(() { return EasyRefresh(
return EasyRefresh( firstRefresh: false,
firstRefresh: false, taskIndependence: true,
taskIndependence: true, controller: logic.refreshController,
controller: logic.refreshController, header: MaterialHeader(),
header: MaterialHeader(), footer: TaurusFooter(),
footer: TaurusFooter(), onRefresh: () async {
onRefresh: () async { logic.getList();
logic.getList(); },
}, onLoad: () async {
onLoad: () async { // getList();
// getList(); },
}, child: state.dataList.isNotEmpty
child: state.dataList.isNotEmpty ? ListView.builder(
? ListView.builder(
itemCount: state.dataList.length, itemCount: state.dataList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
KnowledgeReportDetail item = state.dataList[index]; KnowledgeReportDetail item = state.dataList[index];
@ -132,32 +131,32 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
children: [ children: [
Text( Text(
item.publishTime.substring(0, 10), item.publishTime.substring(0, 10),
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), style: TextStyle(fontSize: 14.sp, color: const Color(0xFF505050)),
), ),
SizedBox( SizedBox(
width: 10.r, width: 10.r,
), ),
Expanded( Expanded(
child: Text( child: Text(
item.homeworkName, item.homeworkName,
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), style: TextStyle(fontSize: 14.sp, color: const Color(0xFF505050)),
)), )),
InkWell( InkWell(
onTap: () { onTap: () {
EasyLoading.show(status: 'loading...'); EasyLoading.show(status: 'loading...');
showImg(item.questionPicture, context); showImg(item.questionPicture, context);
}, },
child: Container( child: Container(
width: 49.r,
height: 22.r, height: 22.r,
padding: EdgeInsets.symmetric(horizontal: 4.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)), borderRadius: BorderRadius.all(Radius.circular(20.r)),
border: Border.all(width: 1.r, color: Color(0xFF8B8B8B)), border: Border.all(width: 1.r, color: const Color(0xFF8B8B8B)),
), ),
child: Center( child: Center(
child: Text( child: Text(
'${item.questionNo}', '${item.questionNo}',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)), style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)),
), ),
), ),
), ),
@ -184,13 +183,13 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
width: 56.r, width: 56.r,
height: 20.r, height: 20.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFE9FFD9), color: const Color(0xFFE9FFD9),
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
quickText('正确率', color: Color(0xFF313131), size: 10.sp), quickText('正确率', color: const Color(0xFF313131), size: 10.sp),
Image.asset( Image.asset(
'assets/images/job_data_right_icon.png', 'assets/images/job_data_right_icon.png',
width: 8.r, width: 8.r,
@ -243,12 +242,12 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
), ),
); );
}) })
: const MyEmptyWidget(), : const MyEmptyWidget(),
); );
}), }),
), ),
); );
}); });
} }
@override @override

View File

@ -57,11 +57,9 @@ class _KgtZgtTableState extends State<KgtZgtTable> {
children: [ children: [
Text( Text(
'客观题', '客观题',
style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600), style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600),
),
SizedBox(
height: 20.r,
), ),
SizedBox(height: 20.r),
ProgressBar( ProgressBar(
color: const Color.fromRGBO(76, 199, 147, 1), color: const Color.fromRGBO(76, 199, 147, 1),
percent: double.parse(widget.kgtCorrectRate) / 100, percent: double.parse(widget.kgtCorrectRate) / 100,
@ -80,19 +78,17 @@ class _KgtZgtTableState extends State<KgtZgtTable> {
lineHeight: 10.h, lineHeight: 10.h,
marginEdg: EdgeInsets.only(top: 5.h), marginEdg: EdgeInsets.only(top: 5.h),
), ),
SizedBox( SizedBox(height: 10.r),
height: 10.r,
),
SizedBox( 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( child: ReportTable(
headList: const ['', '作答率', '作答人数', '作答正确率', '全班正确率','标准答案', '优先批阅概况'], headList: const ['', '作答率', '作答人数', '作答正确率', '全班正确率', '标准答案', '优先批阅概况'],
bodyList: widget.kgReport, bodyList: widget.kgReport,
fixedCols: 1, fixedCols: 1,
fixedRows: 1, fixedRows: 1,
jobId: widget.homeworkId, jobId: widget.homeworkId,
studentCount: widget.studentCount, studentCount: widget.studentCount,
subject:widget.subject, subject: widget.subject,
), ),
), ),
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),
@ -135,12 +131,12 @@ class _KgtZgtTableState extends State<KgtZgtTable> {
marginEdg: EdgeInsets.only(top: 5.h), marginEdg: EdgeInsets.only(top: 5.h),
), ),
SizedBox( SizedBox(
height:10.r, height: 10.r,
), ),
SizedBox( 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( child: ReportTable(
headList: const ['', '作答率', '作答人数', '作答正确率', '全班正确率', '查看原题', '优先批阅概况','作答效率'], headList: const ['', '作答率', '作答人数', '作答正确率', '全班正确率', '查看原题', '优先批阅概况', '作答效率'],
bodyList: widget.zgReport, bodyList: widget.zgReport,
fixedCols: 1, fixedCols: 1,
fixedRows: 1, fixedRows: 1,

View File

@ -56,8 +56,7 @@ class _ReportTableState extends State<ReportTable> {
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertDialog( return AlertDialog(
contentPadding: EdgeInsets.all(20.r), contentPadding: EdgeInsets.all(20.r),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))),
borderRadius: BorderRadius.all(Radius.circular(15.r))),
content: SizedBox( content: SizedBox(
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
height: MediaQuery.of(context).size.height * 0.4, height: MediaQuery.of(context).size.height * 0.4,
@ -65,49 +64,52 @@ class _ReportTableState extends State<ReportTable> {
children: [ children: [
Text( Text(
'作答效率', '作答效率',
style: TextStyle( style: TextStyle(fontSize: 15.sp, color: const Color(0xFF3C3C3C), fontWeight: FontWeight.w500),
fontSize: 15.sp,
color: const Color(0xFF3C3C3C),
fontWeight: FontWeight.w500),
), ),
Padding( Padding(
padding: EdgeInsets.symmetric(vertical:20.r,horizontal: 10.r), padding: EdgeInsets.symmetric(vertical: 20.r, horizontal: 10.r),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
mapIcon(const Color(0xFFB8A1FF)), mapIcon(const Color(0xFFB8A1FF)),
SizedBox(width: 5.r,), SizedBox(
width: 5.r,
),
mapTxt(''), mapTxt(''),
const Spacer(), const Spacer(),
mapIcon(const Color(0xFF4CC793)), mapIcon(const Color(0xFF4CC793)),
SizedBox(width: 5.r,), SizedBox(
width: 5.r,
),
mapTxt(''), mapTxt(''),
const Spacer(), const Spacer(),
mapIcon(const Color(0xFF90E0BE)), mapIcon(const Color(0xFF90E0BE)),
SizedBox(width: 5.r,), SizedBox(
width: 5.r,
),
mapTxt(''), mapTxt(''),
const Spacer(), const Spacer(),
mapIcon(const Color(0xFFFF6B6B)), mapIcon(const Color(0xFFFF6B6B)),
SizedBox(width: 5.r,), SizedBox(
width: 5.r,
),
mapTxt(''), mapTxt(''),
], ],
), ),
), ),
Expanded( Expanded(
child: child: PieChart(
PieChart(
PieChartData( PieChartData(
borderData: FlBorderData(show: true), borderData: FlBorderData(show: true),
sectionsSpace: 0, sectionsSpace: 0,
centerSpaceRadius: 0, centerSpaceRadius: 0,
sections: List.generate(overallTitles.length,(index) { sections: List.generate(overallTitles.length, (index) {
var e = overallTitles[index]; var e = overallTitles[index];
return PieChartSectionData( return PieChartSectionData(
color: colorMap[index], color: colorMap[index],
value: e.count / widget.studentCount * 100, value: e.count / widget.studentCount * 100,
radius: 110, radius: 110,
// borderSide:BorderSide(color: const Color(0xFF273366),width: 0.5.r), // borderSide:BorderSide(color: const Color(0xFF273366),width: 0.5.r),
// title: e.title + (Utils.doubleToStringAsFixed(e.count / widget.studentCount * 100) + '%'), // title: e.title + (Utils.doubleToStringAsFixed(e.count / widget.studentCount * 100) + '%'),
title: e.title + e.count.toString(), title: e.title + e.count.toString(),
titleStyle: TextStyle(fontSize: 12.sp, color: Color(0xFFFFFFFF)), titleStyle: TextStyle(fontSize: 12.sp, color: Color(0xFFFFFFFF)),
@ -151,20 +153,14 @@ class _ReportTableState extends State<ReportTable> {
}); });
} }
void showPeopleListDialog( void showPeopleListDialog({required BuildContext context, required String title, required String questionNo, required List arr, List? dcList}) {
{required BuildContext context,
required String title,
required String questionNo,
required List arr,
List? dcList}) {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertDialog( return AlertDialog(
// insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r), // insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r),
contentPadding: EdgeInsets.all(20.r), contentPadding: EdgeInsets.all(20.r),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))),
borderRadius: BorderRadius.all(Radius.circular(15.r))),
content: SizedBox( content: SizedBox(
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery.of(context).size.width * 0.7,
height: MediaQuery.of(context).size.height * 0.7, height: MediaQuery.of(context).size.height * 0.7,
@ -174,10 +170,7 @@ class _ReportTableState extends State<ReportTable> {
Center( Center(
child: Text( child: Text(
title, title,
style: TextStyle( style: TextStyle(fontSize: 15.sp, color: const Color(0xFF3C3C3C), fontWeight: FontWeight.w500),
fontSize: 15.sp,
color: const Color(0xFF3C3C3C),
fontWeight: FontWeight.w500),
), ),
), ),
SizedBox( SizedBox(
@ -187,18 +180,15 @@ class _ReportTableState extends State<ReportTable> {
children: [ children: [
Text( Text(
widget.isZG == true ? '主观题' : '客观题', widget.isZG == true ? '主观题' : '客观题',
style: TextStyle( style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor),
fontSize: 14.sp, color: Theme.of(context).primaryColor),
), ),
Text( Text(
'', '',
style: TextStyle( style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor),
fontSize: 14.sp, color: Theme.of(context).primaryColor),
), ),
Text( Text(
'$questionNo题', '$questionNo题',
style: TextStyle( style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor),
fontSize: 14.sp, color: Theme.of(context).primaryColor),
), ),
], ],
), ),
@ -213,27 +203,21 @@ class _ReportTableState extends State<ReportTable> {
child: Center( child: Center(
child: Text( child: Text(
'未作答人', '未作答人',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)),
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))), ))),
Expanded( Expanded(
flex: 1, flex: 1,
child: Center( child: Center(
child: Text( child: Text(
'答对人数', '答对人数',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)),
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))), ))),
Expanded( Expanded(
flex: 1, flex: 1,
child: Center( child: Center(
child: Text( child: Text(
'答错人', '答错人',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)),
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))), ))),
], ],
) )
@ -241,8 +225,7 @@ class _ReportTableState extends State<ReportTable> {
padding: EdgeInsets.only(left: 15.r), padding: EdgeInsets.only(left: 15.r),
child: Text( child: Text(
title, title,
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)),
fontSize: 12.sp, color: Color(0xFF6A6A6A)),
), ),
), ),
SizedBox( SizedBox(
@ -256,60 +239,41 @@ class _ReportTableState extends State<ReportTable> {
var item = arr[index]; var item = arr[index];
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 5.r), padding: EdgeInsets.symmetric(vertical: 5.r),
color: color: index.isOdd ? Colors.white : Color(0xFFF0F0F0),
index.isOdd ? Colors.white : Color(0xFFF0F0F0),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
goQuickCheckPersonalPath( goQuickCheckPersonalPath(item['noAnswerStudents'].studentId);
item['noAnswerStudents']
.studentId);
}, },
child: Center( child: Center(
child: Text( child: Text(
item['noAnswerStudents'] item['noAnswerStudents']?.studentName ?? '--',
?.studentName ?? style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
'--',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))), )))),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
goQuickCheckPersonalPath( goQuickCheckPersonalPath(item['answerOkStudents'].studentId);
item['answerOkStudents']
.studentId);
}, },
child: Center( child: Center(
child: Text( child: Text(
item['answerOkStudents'] item['answerOkStudents']?.studentName ?? '--',
?.studentName ?? style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
'--',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))), )))),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
goQuickCheckPersonalPath( goQuickCheckPersonalPath(item['answerNgStudents'].studentId);
item['answerNgStudents']
.studentId);
}, },
child: Center( child: Center(
child: Text( child: Text(
item['answerNgStudents'] item['answerNgStudents']?.studentName ?? '--',
?.studentName ?? style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
'--',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))), )))),
], ],
), ),
@ -330,16 +294,11 @@ class _ReportTableState extends State<ReportTable> {
goQuickCheckPersonalPath(item.studentId); goQuickCheckPersonalPath(item.studentId);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 15.r),
vertical: 5.r, horizontal: 15.r), color: index.isOdd ? Colors.white : Color(0xFFF0F0F0),
color: index.isOdd
? Colors.white
: Color(0xFFF0F0F0),
child: Text( child: Text(
item.studentName! ?? '--', item.studentName! ?? '--',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
fontSize: 12.sp,
color: Color(0xFF323232)),
), ),
), ),
); );
@ -357,65 +316,56 @@ class _ReportTableState extends State<ReportTable> {
void goQuickCheckPersonalPath(id) { void goQuickCheckPersonalPath(id) {
if (id != null) { if (id != null) {
Get.toNamed(Routes.studentPersonalPage, Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': id, 'homeworkId': widget.jobId, 'subject': widget.subject});
arguments: {'studentId': id, 'homeworkId': widget.jobId,'subject':widget.subject});
} }
} }
void zdHandle(BuildContext context, String title, String questionNo, void zdHandle(BuildContext context, String title, String questionNo, List noAnswerStudents, List answerNgStudents, List answerOkStudents) {
List noAnswerStudents, List answerNgStudents, List answerOkStudents) {
List list = []; List list = [];
// Questions student = Questions('','',-1,-1,'',-1,'','',[],-1,-1,[] as double?); // Questions student = Questions('','',-1,-1,'',-1,'','',[],-1,-1,[] as double?);
if (noAnswerStudents.length > answerNgStudents.length && if (noAnswerStudents.length > answerNgStudents.length && noAnswerStudents.length > answerOkStudents.length) {
noAnswerStudents.length > answerOkStudents.length) {
for (int i = 0; i < noAnswerStudents.length; i++) { for (int i = 0; i < noAnswerStudents.length; i++) {
var obj = { var obj = {
'noAnswerStudents': noAnswerStudents[i], 'noAnswerStudents': noAnswerStudents[i],
'answerNgStudents': 'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null,
answerNgStudents.length > i ? answerNgStudents[i] : null, 'answerOkStudents': answerOkStudents.length > i ? answerOkStudents[i] : null
'answerOkStudents':
answerOkStudents.length > i ? answerOkStudents[i] : null
}; };
list.add(obj); list.add(obj);
} }
} else if (answerNgStudents.length > noAnswerStudents.length && } else if (answerNgStudents.length > noAnswerStudents.length && answerNgStudents.length > answerOkStudents.length) {
answerNgStudents.length > answerOkStudents.length) {
for (int i = 0; i < answerNgStudents.length; i++) { for (int i = 0; i < answerNgStudents.length; i++) {
var obj = { var obj = {
'noAnswerStudents': 'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null,
noAnswerStudents.length > i ? noAnswerStudents[i] : null,
'answerNgStudents': answerNgStudents[i], 'answerNgStudents': answerNgStudents[i],
'answerOkStudents': 'answerOkStudents': answerOkStudents.length > i ? answerOkStudents[i] : null
answerOkStudents.length > i ? answerOkStudents[i] : null
}; };
list.add(obj); list.add(obj);
} }
} else if (answerOkStudents.length > noAnswerStudents.length && } else if (answerOkStudents.length > noAnswerStudents.length && answerOkStudents.length > answerNgStudents.length) {
answerOkStudents.length > answerNgStudents.length) {
for (int i = 0; i < answerOkStudents.length; i++) { for (int i = 0; i < answerOkStudents.length; i++) {
var obj = { var obj = {
'noAnswerStudents': 'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null,
noAnswerStudents.length > i ? noAnswerStudents[i] : null, 'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null,
'answerNgStudents': 'answerOkStudents': answerOkStudents[i]
answerNgStudents.length > i ? answerNgStudents[i] : null, };
list.add(obj);
}
} else {
for (int i = 0; i < answerOkStudents.length; i++) {
var obj = {
'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null,
'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null,
'answerOkStudents': answerOkStudents[i] 'answerOkStudents': answerOkStudents[i]
}; };
list.add(obj); list.add(obj);
} }
} }
showPeopleListDialog( showPeopleListDialog(context: context, title: title, questionNo: questionNo, arr: list, dcList: []);
context: context,
title: title,
questionNo: questionNo,
arr: list,
dcList: []);
} }
void dcHandle( void dcHandle(BuildContext context, String title, String questionNo, List arr) {
BuildContext context, String title, String questionNo, List arr) { showPeopleListDialog(context: context, title: title, questionNo: questionNo, arr: arr);
showPeopleListDialog(
context: context, title: title, questionNo: questionNo, arr: arr);
} }
DataRow _getRow(int index, [Color? color]) { DataRow _getRow(int index, [Color? color]) {
@ -428,28 +378,18 @@ class _ReportTableState extends State<ReportTable> {
DataCell(Center( DataCell(Center(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r), padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text(item.questionNo.toString(), child: Text(item.questionNo.toString(), style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))),
style:
TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))),
), ),
)), )),
DataCell(Center( DataCell(Center(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r), padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text('${item.answerRate.toStringAsFixed(0)}%', child: Text('${item.answerRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))),
style:
TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))),
), ),
)), )),
DataCell(InkWell( DataCell(InkWell(
onTap: () { onTap: () {
zdHandle( zdHandle(context, '作答人数', item.questionNo.toString(), item.noAnswerStudents, item.answerNgStudents, item.answerOkStudents);
context,
'作答人数',
item.questionNo.toString(),
item.noAnswerStudents,
item.answerNgStudents,
item.answerOkStudents);
}, },
child: Center( child: Center(
child: Padding( child: Padding(
@ -457,9 +397,7 @@ class _ReportTableState extends State<ReportTable> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text('${item.answerCount}/${widget.studentCount}', Text('${item.answerCount}/${widget.studentCount}', style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor)),
style: TextStyle(
fontSize: 10.sp, color: Theme.of(context).primaryColor)),
Image.asset( Image.asset(
'assets/images/green_right_icon.png', 'assets/images/green_right_icon.png',
width: 12.r, width: 12.r,
@ -470,19 +408,16 @@ class _ReportTableState extends State<ReportTable> {
), ),
), ),
)), )),
DataCell(Center( DataCell(Center(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r), padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text('${item.correctRate.toStringAsFixed(0)}%', child: Text('${item.correctRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))),
style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))),
), ),
)), )),
DataCell(Center( DataCell(Center(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r), padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text('${item.okRate.toStringAsFixed(0)}%', child: Text('${item.okRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))),
style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))),
), ),
)), )),
DataCell(Center( DataCell(Center(
@ -494,30 +429,20 @@ class _ReportTableState extends State<ReportTable> {
if (item.questionPicture == null) { if (item.questionPicture == null) {
ToastUtils.showInfo('当前试题没有原题'); ToastUtils.showInfo('当前试题没有原题');
} else { } else {
ImageDialog.showImgDialog( ImageDialog.showImgDialog(context, item.questionPicture);
context, item.questionPicture);
} }
}, },
child: Text('原题', child: Text('原题',
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)),
fontSize: 10.sp,
color: widget.isZG == true
? const Color(0xFFFF8A00)
: Theme.of(context).primaryColor)),
) )
: Text(item.answer, : Text(item.answer,
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)),
fontSize: 10.sp,
color: widget.isZG == true
? const Color(0xFFFF8A00)
: Theme.of(context).primaryColor)),
), ),
)), )),
DataCell(InkWell( DataCell(InkWell(
onTap: () { onTap: () {
// List<String> parts = item.priorityGeneral.split(''); // List<String> parts = item.priorityGeneral.split('');
dcHandle(context, '优先批阅答错人', item.questionNo.toString(), dcHandle(context, '优先批阅答错人', item.questionNo.toString(), item.priorityInfo);
item.priorityInfo);
}, },
child: Center( child: Center(
child: Padding( child: Padding(
@ -525,9 +450,7 @@ class _ReportTableState extends State<ReportTable> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text('${item.priorityInfo.length}人答错', Text('${item.priorityInfo.length}人答错', style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor)),
style: TextStyle(
fontSize: 10.sp, color: Theme.of(context).primaryColor)),
Image.asset( Image.asset(
'assets/images/green_right_icon.png', 'assets/images/green_right_icon.png',
width: 12.r, width: 12.r,
@ -548,18 +471,10 @@ class _ReportTableState extends State<ReportTable> {
showAnswerEfficiency(item.overallTitles); showAnswerEfficiency(item.overallTitles);
}, },
child: Text('查看', child: Text('查看',
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)),
fontSize: 10.sp,
color: widget.isZG == true
? const Color(0xFFFF8A00)
: Theme.of(context).primaryColor)),
) )
: Text(item.answer, : Text(item.answer,
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)),
fontSize: 10.sp,
color: widget.isZG == true
? const Color(0xFFFF8A00)
: Theme.of(context).primaryColor)),
), ),
)), )),
], ],
@ -577,16 +492,12 @@ class _ReportTableState extends State<ReportTable> {
dataRowHeight: 40.r, dataRowHeight: 40.r,
bottomMargin: 0, bottomMargin: 0,
border: const TableBorder( border: const TableBorder(
horizontalInside: BorderSide( horizontalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid),
width: 1, color: Colors.white, style: BorderStyle.solid), bottom: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid),
bottom: BorderSide( verticalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid)),
width: 1, color: Colors.white, style: BorderStyle.solid), headingRowColor: MaterialStateProperty.resolveWith((states) => widget.fixedCols! > 0 ? Colors.white : Colors.transparent),
verticalInside: BorderSide( headingRowDecoration: const BoxDecoration(color: Color(0xFFE6E6E6)),
width: 1, color: Colors.white, style: BorderStyle.solid)), fixedColumnsColor: const Color(0xFFE6E6E6),
headingRowColor: MaterialStateProperty.resolveWith((states) =>
widget.fixedCols! > 0 ? Colors.white : Colors.transparent),
headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)),
fixedColumnsColor: Color(0xFFE6E6E6),
fixedCornerColor: Colors.grey[400], fixedCornerColor: Colors.grey[400],
minWidth: widget.headList.length > 6 minWidth: widget.headList.length > 6
? 80.r * widget.headList.length ? 80.r * widget.headList.length
@ -601,65 +512,75 @@ class _ReportTableState extends State<ReportTable> {
columns: List.generate(widget.headList.length, (index) { columns: List.generate(widget.headList.length, (index) {
var item = widget.headList[index]; var item = widget.headList[index];
return DataColumn2( return DataColumn2(
label: index == 3 ? label: index == 3
Row( ? Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text(item, Text(item, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF505767))),
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), SizedBox(
SizedBox(width: 2.r,), width: 2.r,
const Tooltip( ),
message: '答对人数/作答人数', const Tooltip(
triggerMode: TooltipTriggerMode.tap, message: '答对人数/作答人数',
preferBelow:false, triggerMode: TooltipTriggerMode.tap,
child: Icon(Icons.info_outline_rounded,color: Colors.grey,)), preferBelow: false,
], child: Icon(
): Icons.info_outline_rounded,
index == 4 ?Row( color: Colors.grey,
mainAxisAlignment: MainAxisAlignment.center, )),
crossAxisAlignment: CrossAxisAlignment.center, ],
children: [ )
Text(item, : index == 4
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), ? Row(
SizedBox(width: 2.r,), mainAxisAlignment: MainAxisAlignment.center,
const Tooltip( crossAxisAlignment: CrossAxisAlignment.center,
message: '答对人数/总人数', children: [
triggerMode: TooltipTriggerMode.tap, Text(item, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF505767))),
preferBelow:false, SizedBox(
child: Icon(Icons.info_outline_rounded,color: Colors.grey,)), width: 2.r,
], ),
): const Tooltip(
Center( message: '答对人数/总人数',
child: Text(item, triggerMode: TooltipTriggerMode.tap,
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), preferBelow: false,
), child: Icon(
Icons.info_outline_rounded,
color: Colors.grey,
)),
],
)
: Center(
child: Text(item, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF505767))),
),
// size: ColumnSize.S, // size: ColumnSize.S,
fixedWidth: index == 0 fixedWidth: index == 0
? 40.r ? 40.r
: widget.headList.length > 6 : widget.headList.length > 6
? 80.r ? 80.r
: isPadFlag : isPadFlag
? (MediaQuery.of(context).size.width - 8.r) / ? (MediaQuery.of(context).size.width - 8.r) / widget.headList.length
widget.headList.length
: 85.r, : 85.r,
); );
}), }),
rows: List<DataRow>.generate(widget.bodyList.length, rows: List<DataRow>.generate(widget.bodyList.length, (index) => _getRow(index, const Color(0xFFF5F5F5))));
(index) => _getRow(index, Color(0xFFF5F5F5))));
} }
} }
Widget mapIcon(Color bgColor){ Widget mapIcon(Color bgColor) {
return Container( return Container(
width: 12.r, width: 12.r,
height: 12.r, height: 12.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: bgColor, color: bgColor,
borderRadius: BorderRadius.all(Radius.circular(6.r)), borderRadius: BorderRadius.all(Radius.circular(6.r)),
), ),
); );
} }
Widget mapTxt(String title){
return Text(title,style: TextStyle(fontSize: 12.sp,color: Color(0xFF525252),fontWeight: FontWeight.w400),); Widget mapTxt(String title) {
return Text(
title,
style: TextStyle(fontSize: 12.sp, color: const Color(0xFF525252), fontWeight: FontWeight.w400),
);
} }

View File

@ -22,26 +22,38 @@ part 'annotate_list.g.dart';
class AnnotateList extends StatefulWidget { class AnnotateList extends StatefulWidget {
final int tabIndex; final int tabIndex;
final int assessType; final int assessType;
const AnnotateList({super.key, required this.tabIndex, required this.assessType});
const AnnotateList(
{Key? key, required this.tabIndex, required this.assessType})
: super(key: key);
@override @override
State<AnnotateList> createState() => _AnnotateListState(); State<AnnotateList> createState() => _AnnotateListState();
} }
class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, SingleTickerProviderStateMixin { class _AnnotateListState extends State<AnnotateList>
with RequestToolMixin, SingleTickerProviderStateMixin {
late RxString customTimeStr = '自定义'.obs; late RxString customTimeStr = '自定义'.obs;
int active = 1; int active = 1;
late RxList<Items> unAnnotateList = RxList(); late RxList<Items> unAnnotateList = RxList();
late RxList<Items> annotateList = RxList(); late RxList<Items> annotateList = RxList();
late int page = 1; late int page = 1;
late TabController tabController2;
late TabController tabController2;
/* 待阅卷 */ /* 待阅卷 */
late final EasyRefreshController refreshController1; late final EasyRefreshController refreshController1;
late final EasyRefreshController refreshController2; late final EasyRefreshController refreshController2;
WorkStudentParams params = WorkStudentParams(assessType: 0, pageSize: 10); WorkStudentParams params = WorkStudentParams(
WorkStudentParams params2 = WorkStudentParams(assessType: 0, pageSize: 10); assessType: 0,
pageSize: 10,
);
WorkStudentParams params2 = WorkStudentParams(
assessType: 0,
pageSize: 10,
startDate: Utils.getWeekStartDate().toString().substring(0, 10),
endDate: Utils.getWeekEndDate().toString().substring(0, 10),
);
@override @override
void initState() { void initState() {
@ -55,6 +67,7 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
EasyLoading.show(status: 'loading...'); EasyLoading.show(status: 'loading...');
getUnAnnotateList(); getUnAnnotateList();
getAnnotateList(); getAnnotateList();
} }
// //
@ -68,7 +81,6 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
EasyLoading.dismiss(); EasyLoading.dismiss();
print('state.unAnnotateList.length=${unAnnotateList.length}'); print('state.unAnnotateList.length=${unAnnotateList.length}');
} }
// //
void getAnnotateList() async { void getAnnotateList() async {
WorkStudent data = WorkStudent([], 0); WorkStudent data = WorkStudent([], 0);
@ -81,7 +93,6 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
EasyLoading.dismiss(); EasyLoading.dismiss();
print('state.annotateList.length=${annotateList.length}'); print('state.annotateList.length=${annotateList.length}');
} }
/// ///
Future<void> onMyRefresh(EasyRefreshController controller, int tab) async { Future<void> onMyRefresh(EasyRefreshController controller, int tab) async {
/* params.page = RequestConfig.basePage.page; /* params.page = RequestConfig.basePage.page;
@ -116,51 +127,70 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
}*/ }*/
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: [ children: [
if (widget.tabIndex == 1) if(widget.tabIndex == 1)
JobConditionFilter( Obx(() {
customTimeStr: customTimeStr.value, return JobConditionFilter(
controller: tabController2, customTimeStr: customTimeStr.value,
hasAll: true, controller: tabController2,
jobType: 1, hasAll: true,
customTime: tabController2.index != 3 || (params2.startDate == null && params2.endDate == null) jobType: 1,
? null customTime: tabController2.index != 2 ||
: PickerDateRange( (params2.startDate == null && params2.endDate == null)
params2.startDate == null ? null : DateTime.parse(params2.startDate!), ? null
params2.endDate == null ? null : DateTime.parse(params2.endDate!), : PickerDateRange(
), params2.startDate == null ? null : DateTime.parse(
onTimeFilter: (String? startTime, String? endTime) { params2.startDate!),
if (startTime == null && endTime == null && tabController2.index == 3) { params2.endDate == null ? null : DateTime.parse(
tabController2.animateTo(0); params2.endDate!),
} ),
params2.endDate = endTime; onTimeFilter: (String? startTime, String? endTime) {
params2.startDate = startTime; if (startTime == null && endTime == null &&
page = 1; tabController2.index == 2) {
if (widget.tabIndex == 0) { tabController2.animateTo(0);
getUnAnnotateList(); params2.endDate =
} else { Utils.getWeekEndDate().toString().substring(0, 10);
getAnnotateList(); params2.startDate =
} Utils.getWeekStartDate().toString().substring(0, 10);
// refreshController2.callRefresh(); customTimeStr.value = '自定义';
}, } else {
refreshTime: (value) { params2.endDate = endTime;
if (value != null && value.startDate != null) { params2.startDate = startTime;
customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? ''; }
page = 1;
EasyLoading.show(status: 'loading...');
if (widget.tabIndex == 0) {
getUnAnnotateList();
} else {
getAnnotateList();
}
// refreshController2.callRefresh();
},
refreshTime: (value) {
if (value != null && value.startDate != null) {
customTimeStr.value =
value.startDate?.toString().substring(0, 10) ?? '';
if (value.endDate != null) { if (value.endDate != null) {
if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) { if (!Utils.isPad() &&
customTimeStr.value = '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}'; value.startDate!.year == value.endDate!.year) {
} else { customTimeStr.value =
customTimeStr.value = '${customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}'; '${value.startDate.toString().substring(5, 10)}~${value
.endDate.toString().substring(5, 10)}';
} else {
customTimeStr.value =
'${customTimeStr.value}~${value.endDate?.toString()
.substring(0, 10)}';
}
} }
} }
} });
}), }),
Expanded( Expanded(child: IndexedStack(
child: IndexedStack(
index: widget.tabIndex, index: widget.tabIndex,
children: <Widget>[ children: <Widget>[
$EasyRefresh( $EasyRefresh(
@ -192,8 +222,10 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
@swidget @swidget
Widget $easyRefresh({ Widget $easyRefresh({
required EasyRefreshController controller, required EasyRefreshController controller,
required Future<void> Function(EasyRefreshController controller, int tab) onRefresh, required Future<
required Future<void> Function(EasyRefreshController controller, int tab) onLoad, void> Function(EasyRefreshController controller, int tab) onRefresh,
required Future<
void> Function(EasyRefreshController controller, int tab) onLoad,
required List<Items> data, required List<Items> data,
required int tab, required int tab,
required int type, required int type,
@ -213,27 +245,39 @@ Widget $easyRefresh({
footer: TaurusFooter(), footer: TaurusFooter(),
child: completed && isPadFlag child: completed && isPadFlag
? GridView( ? GridView(
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), padding: EdgeInsets.only(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
crossAxisCount: 2, //widget gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
mainAxisSpacing: 10.h, crossAxisCount: 2, //widget
crossAxisSpacing: 6.w, mainAxisSpacing: 10.h,
childAspectRatio: 1.81 //1widget crossAxisSpacing: 6.w,
), childAspectRatio: 1.81 //1widget
children: List.generate(data.length, (index) { ),
Items item = data[index]; children: List.generate(data.length, (index) {
String subjectName = EnumUtils.formatSubject(item.subject); Items item = data[index];
return $reviewedItem(jobTaskItem: item, type: type, subjectName: subjectName, collectFun: collectFun, tabIndex: tab - 1); String subjectName = EnumUtils.formatSubject(item.subject);
}), return $reviewedItem(jobTaskItem: item,
) type: type,
subjectName: subjectName,
collectFun: collectFun,
tabIndex: tab - 1);
}),
)
: ListView.builder( : ListView.builder(
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), padding: EdgeInsets.only(
itemBuilder: (context, index) { top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
Items item = data[index]; itemBuilder: (context, index) {
return TaskListItem(completed: completed, jobTaskItem: item, type: type, collectFun: collectFun, tabIndex: tab - 1); Items item = data[index];
}, return TaskListItem(
itemCount: data.length, completed: completed,
), jobTaskItem: item,
type: type,
collectFun: collectFun,
tabIndex: tab - 1
);
},
itemCount: data.length,
),
onRefresh: () => onRefresh(controller, tab), onRefresh: () => onRefresh(controller, tab),
onLoad: () => onLoad(controller, tab), onLoad: () => onLoad(controller, tab),
); );
@ -252,17 +296,18 @@ Widget $reviewedItem({
return InkWell( return InkWell(
onTap: () { onTap: () {
Get.toNamed(Routes.annotateClassPage, arguments: { Get.toNamed(Routes.annotateClassPage,
'id': jobTaskItem.id, arguments: {
'name': jobTaskItem.name, 'id': jobTaskItem.id,
'grade': jobTaskItem.grade, 'name': jobTaskItem.name,
'subject': jobTaskItem.subject, 'grade': jobTaskItem.grade,
'completed': true, 'subject': jobTaskItem.subject,
'tabIndex': tabIndex 'completed': true,
}); 'tabIndex': tabIndex
});
}, },
child: Container( child: Container(
padding: EdgeInsets.only(right: 5.w), padding: EdgeInsets.only(top: 10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r), borderRadius: BorderRadius.circular(6.r),
color: Colors.white, color: Colors.white,
@ -279,38 +324,47 @@ Widget $reviewedItem({
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
// //
Row( Padding(
crossAxisAlignment: CrossAxisAlignment.start, padding: padEdg,
children: [ child: Row(
Container( crossAxisAlignment: CrossAxisAlignment.start,
width: 32.w,
height: 18.h, children: [
alignment: Alignment.center, Container(
padding: EdgeInsets.only(left: 2.w), width: 32.w,
decoration: BoxDecoration( height: 18.h,
color: type == 1 ? const Color(0xFFB2DA93) : const Color(0xFFEF8714), alignment: Alignment.center,
borderRadius: BorderRadius.only( padding: EdgeInsets.only(left: 2.w),
topLeft: Radius.circular(6.r), decoration: BoxDecoration(
topRight: Radius.circular(0.r), color: type == 1 ? const Color(0xFF4CC793) : const Color
bottomLeft: Radius.circular(0.r), .fromRGBO(255, 175, 56, 1),
bottomRight: Radius.circular(12.r), 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(top: 3.h, right: 4.w),
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white,
size: 10.sp),
), ),
margin: EdgeInsets.only(top: 0.h, right: 4.w), Expanded(
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp), child: quickText(jobTaskItem.name, size: 14.sp,
), color: const Color.fromRGBO(70, 70, 70, 1),
Expanded( maxLines: 2),
child: quickText(jobTaskItem.name, size: 14.sp, color: const Color.fromRGBO(70, 70, 70, 1), maxLines: 2), ),
), if (jobTaskItem.isFixed!)
if (jobTaskItem.isFixed!) Padding(
Padding( padding: EdgeInsets.only(top: 3.r),
padding: EdgeInsets.only(top: 3.r), child: Text(
child: Text( '已订正',
'已订正', style: TextStyle(
style: TextStyle(fontSize: 10.sp, color: const Color(0xFFF16262)), fontSize: 10.sp, color: const Color(0xFFF16262)),
),
), ),
), ],
], ),
), ),
Padding( Padding(
@ -319,26 +373,31 @@ Widget $reviewedItem({
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
quickText( 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), color: const Color.fromRGBO(97, 97, 97, 1),
size: 10.sp, size: 10.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
quickText(' / ', color: const Color(0xFF8C68FF), size: 10.sp, fontWeight: FontWeight.w500), quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1),
size: 10.sp,
fontWeight: FontWeight.w500),
quickText( quickText(
'参与班级:', '参与班级:',
color: const Color(0xFF8C68FF), color: const Color.fromRGBO(76, 199, 147, 1),
size: 9.sp, size: 9.sp,
), ),
quickText( quickText(
'${jobTaskItem.classCount}', '${jobTaskItem.classCount}',
color: const Color(0xFF8C68FF), color: const Color.fromRGBO(76, 199, 147, 1),
size: 10.sp, size: 10.sp,
), ),
quickText(' / ', color: const Color(0xFF8C68FF), size: 10.sp, fontWeight: FontWeight.w500), quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1),
size: 10.sp,
fontWeight: FontWeight.w500),
quickText( quickText(
'科目:$subjectName', '科目:$subjectName',
color: const Color(0xFF8C68FF), color: const Color.fromRGBO(116, 145, 253, 1),
size: 9.sp, size: 9.sp,
), ),
], ],
@ -355,7 +414,8 @@ Widget $reviewedItem({
Container( Container(
padding: EdgeInsets.symmetric(vertical: 6.h), padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration( 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, color: Colors.white,
boxShadow: const [ boxShadow: const [
BoxShadow( BoxShadow(
@ -367,7 +427,7 @@ Widget $reviewedItem({
], ],
), ),
child: Row(children: [ child: Row(children: [
/*if (!jobTaskItem.isFixed!) if (!jobTaskItem.isFixed!)
Expanded( Expanded(
flex: 1, flex: 1,
child: GestureDetector( child: GestureDetector(
@ -381,23 +441,31 @@ Widget $reviewedItem({
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( 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(0xFF8C68FF), size: 11.sp), child: quickText(
'收集订正', color: const Color(0xFF4CC793), size: 11.sp),
), ),
), ),
),*/ ),
Expanded( Expanded(
flex: 1, flex: 1,
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
Get.toNamed(Routes.jobReportPage, Get.toNamed(Routes.jobReportPage,
arguments: {'title': jobTaskItem.name, 'homeworkId': jobTaskItem.id, 'grade': jobTaskItem.grade}); arguments: {
'title': jobTaskItem.name,
'homeworkId': jobTaskItem.id,
'grade': jobTaskItem.grade
});
}, },
child: Container( child: Container(
alignment: Alignment.center, 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),
), ),
), ),
), ),

View File

@ -11,13 +11,35 @@ class StudentPersonalLogic extends GetxController with RequestToolMixin {
void onInit() { void onInit() {
super.onInit(); super.onInit();
state.studentId = Get.arguments['studentId']; state.studentId = Get.arguments['studentId'];
state.subject = Get.arguments['subject']??-1; state.subject = Get.arguments['subject'] ?? -1;
state.homeworkId = Get.arguments['homeworkId']; state.homeworkId = Get.arguments['homeworkId'];
getInfo(); getInfo();
} }
void getInfo() async { void getInfo() async {
StudentPersonalInfo data = await getClient().getStudentHomework(state.homeworkId, state.studentId); StudentPersonalInfo data = await getClient().getStudentHomework(state.homeworkId, state.studentId);
data.kgtList.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
data.zgtList.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
state.studentInfo.value = data; state.studentInfo.value = data;
} }
} }

View File

@ -11,7 +11,7 @@ import 'package:making_school_asignment_app/routes/app_pages.dart';
import 'student_personal_logic.dart'; import 'student_personal_logic.dart';
class StudentPersonalPage extends StatefulWidget { class StudentPersonalPage extends StatefulWidget {
const StudentPersonalPage({Key? key}) : super(key: key); const StudentPersonalPage({super.key});
@override @override
State<StudentPersonalPage> createState() => _StudentPersonalPageState(); State<StudentPersonalPage> createState() => _StudentPersonalPageState();
@ -54,8 +54,11 @@ class _StudentPersonalPageState extends State<StudentPersonalPage> {
onTap: () { onTap: () {
// RouterManager.router.navigateTo(context, // RouterManager.router.navigateTo(context,
// '${RouterManager.jobPersonalDetailPath}?studentId=${widget.studentId}&studentName=${Uri.encodeComponent(state.studentInfo.studentName!)}'); // '${RouterManager.jobPersonalDetailPath}?studentId=${widget.studentId}&studentName=${Uri.encodeComponent(state.studentInfo.studentName!)}');
Get.toNamed(Routes.studentWorkDetailPage, Get.toNamed(Routes.studentWorkDetailPage, arguments: {
arguments: {'studentId': state.studentInfo.value.studentId, 'studentName': state.studentInfo.value.studentName,'subject':state.subject}); 'studentId': state.studentInfo.value.studentId,
'studentName': state.studentInfo.value.studentName,
'subject': state.subject
});
}, },
child: Container( child: Container(
width: 93.r, width: 93.r,

View File

@ -31,13 +31,44 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi
studentId: state.studentId, studentId: state.studentId,
dateStart: state.dateStart, dateStart: state.dateStart,
dateEnd: state.dateEnd, dateEnd: state.dateEnd,
subject:state.subject, subject: state.subject,
pageNumber: state.page, pageNumber: state.page,
pageSize: 10, pageSize: 10,
); );
StudentHistory data = await getClient().getStudentHistory(params); StudentHistory data = await getClient().getStudentHistory(params);
data.items.items.forEach((e) {
e.kgtList.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
e.zgtList.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
});
state.studentData.value = data; state.studentData.value = data;
for (var element in state.studentData.value.items.items) { /* state.kgtLine.value = [{'id':0,'rate':0}];
state.zgtLine.value = [{'id':0,'rate':0}];
state.allLine.value = [{'id':0,'rate':0}];*/
state.kgtLine.value = [];
state.zgtLine.value = [];
state.allLine.value = [];
for (var i = 0; i < state.studentData.value.items.items.length; i++) {
var element = state.studentData.value.items.items[i];
int num = 0; int num = 0;
for (var item in element.kgtList) { for (var item in element.kgtList) {
if (item.state == 0) { if (item.state == 0) {
@ -52,7 +83,12 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi
if (num == (element.kgtList.length + element.zgtList.length)) { if (num == (element.kgtList.length + element.zgtList.length)) {
element.allNotDone = true; element.allNotDone = true;
} }
state.kgtLine.add({'id': i + 1, 'rate': (element.kgtCorrectRate / 100 * 5).toStringAsFixed(2)});
state.zgtLine.add({'id': i + 1, 'rate': (element.zgtCorrectRate / 100 * 5).toStringAsFixed(2)});
state.allLine.add({'id': i + 1, 'rate': (element.correctRate / 100 * 5).toStringAsFixed(2)});
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
} }

View File

@ -17,4 +17,7 @@ class StudentWorkDetailState {
late RxString customTimeStr = '自定义'.obs; late RxString customTimeStr = '自定义'.obs;
late Rx<StudentHistory> studentData = Rx(StudentHistory(0, 0, Items([], 0), 0)); late Rx<StudentHistory> studentData = Rx(StudentHistory(0, 0, Items([], 0), 0));
late final int subject; late final int subject;
late RxList kgtLine = [].obs;
late RxList zgtLine = [].obs;
late RxList allLine = [].obs;
} }

View File

@ -1,3 +1,4 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -9,6 +10,7 @@ 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/MyEmptyWidget.dart';
import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.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/children/student_work_detail/widget/job_condition_filter.dart';
import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/line_chart.dart';
import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.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:making_school_asignment_app/routes/app_pages.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart'; import 'package:syncfusion_flutter_datepicker/datepicker.dart';
@ -124,16 +126,22 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( /* Text(
'总览:', '总览:',
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w600), fontWeight: FontWeight.w600),
),*/
SizedBox(height: 10.r,),
SizedBox(
height: 200.r,
child: LineChartCon(isShowingMainData: true,lineNum: 3,line1:state.kgtLine.value,line2: state.zgtLine.value,line3: state.allLine.value,),
), ),
SizedBox(height: 20.r,),
ProgressBar( ProgressBar(
title: '客观题正确率:', title: '客观题正确率:',
color:Theme.of(context).primaryColor, color:const Color(0xFF4DE6BF),
percent: state.studentData.value.kgtCorrectRate / 100, percent: state.studentData.value.kgtCorrectRate / 100,
padingEdg: EdgeInsets.zero, padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)), marginEdg: EdgeInsets.only(top: 8.h)),
@ -145,7 +153,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
marginEdg: EdgeInsets.only(top: 8.h)), marginEdg: EdgeInsets.only(top: 8.h)),
ProgressBar( ProgressBar(
title: '总正确率:', title: '总正确率:',
color: Theme.of(context).primaryColor, color: const Color(0xFF1890FF),
percent: state.studentData.value.correctRate / 100, percent: state.studentData.value.correctRate / 100,
padingEdg: EdgeInsets.zero, padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)), marginEdg: EdgeInsets.only(top: 8.h)),
@ -153,6 +161,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
), ),
); );
}), }),
Obx(() { Obx(() {
return JobConditionFilter( return JobConditionFilter(
controller: logic.tabController, controller: logic.tabController,
@ -221,8 +230,8 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
height: 10.r, height: 10.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.r)), borderRadius: BorderRadius.all(Radius.circular(5.r)),
// color: Color(0xFF4CC793), color: const Color(0xFF00B386),
border: Border.all(width: 1.r, color: Theme.of(context).primaryColor), border: Border.all(width: 1.r, color: const Color(0xFF00B386)),
), ),
), ),
SizedBox( SizedBox(
@ -240,8 +249,8 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
height: 10.r, height: 10.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.r)), borderRadius: BorderRadius.all(Radius.circular(5.r)),
// color: Color(0xFFFF7474), color: const Color(0xFFCB191B),
border: Border.all(width: 1.r, color: Color(0xFFFF7474)), border: Border.all(width: 1.r, color: const Color(0xFFCB191B)),
), ),
), ),
SizedBox( SizedBox(
@ -422,7 +431,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
'客:', '客:',
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF5B5B5B)), color: const Color(0xFF5B5B5B)),
), ),
SizedBox( SizedBox(
width: 5.r, width: 5.r,
@ -444,16 +453,18 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
width: 25.r, width: 25.r,
height: 25.r, height: 25.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.transparent, color: subjective.state == 3
?const Color(0xFF00B386):subjective.state == 2
? const Color(0xFFCB191B):Colors.transparent,
border: Border.all( border: Border.all(
width: 1.r, width: 1.r,
color: subjective.state == 0 color: subjective.state == 0
? Color(0xFFDDDDDD) ? const Color(0xFFDDDDDD)
: subjective.state == 3 : subjective.state == 3
?Theme.of(context).primaryColor ?const Color(0xFF00B386)
: subjective.state == 2 : subjective.state == 2
? Color(0xFFFF7474) ? const Color(0xFFCB191B)
: Color(0xFF666666)), : const Color(0xFF666666)),
borderRadius: BorderRadius.all(Radius.circular(12.5.r))), borderRadius: BorderRadius.all(Radius.circular(12.5.r))),
child: Center( child: Center(
child: Text( child: Text(
@ -464,16 +475,15 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
color: subjective color: subjective
.state == .state ==
0 0
? Color( ? const Color(
0xFFDDDDDD) 0xFFDDDDDD)
: subjective.state == : subjective.state ==
3 3
? Theme.of(context).primaryColor ? Colors.white
: subjective.state == : subjective.state ==
2 2
? Color( ?Colors.white
0xFFFF7474) : const Color(
: Color(
0xFF666666)), 0xFF666666)),
)), )),
); );
@ -484,7 +494,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
'', '',
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF5B5B5B)), color: const Color(0xFF5B5B5B)),
), ),
], ],
), ),
@ -499,7 +509,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
'主:', '主:',
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF5B5B5B)), color: const Color(0xFF5B5B5B)),
), ),
SizedBox( SizedBox(
width: 5.r, width: 5.r,
@ -521,16 +531,18 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
width: 25.r, width: 25.r,
height: 25.r, height: 25.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.transparent, color: subjective.state == 3
? const Color(0xFF00B386):subjective.state == 2
? const Color(0xFFCB191B):Colors.transparent,
border: Border.all( border: Border.all(
width: 1.r, width: 1.r,
color: subjective.state == 0 color: subjective.state == 0
? Color(0xFFDDDDDD) ? const Color(0xFFDDDDDD)
: subjective.state == 3 : subjective.state == 3
? Theme.of(context).primaryColor ? const Color(0xFF00B386)
: subjective.state == 2 : subjective.state == 2
? Color(0xFFFF7474) ? const Color(0xFFCB191B)
: Color(0xFF666666)), : const Color(0xFF666666)),
borderRadius: BorderRadius.all(Radius.circular(12.5.r))), borderRadius: BorderRadius.all(Radius.circular(12.5.r))),
child: Center( child: Center(
child: Text( child: Text(
@ -541,16 +553,15 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
color: subjective color: subjective
.state == .state ==
0 0
? Color( ? const Color(
0xFFDDDDDD) 0xFFDDDDDD)
: subjective.state == : subjective.state ==
3 3
? Theme.of(context).primaryColor ? Colors.white
: subjective.state == : subjective.state ==
2 2
? Color( ? Colors.white
0xFFFF7474) : const Color(
: Color(
0xFF666666)), 0xFF666666)),
)), )),
); );
@ -561,25 +572,25 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
'', '',
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF5B5B5B)), color: const Color(0xFF5B5B5B)),
), ),
], ],
), ),
ProgressBar( ProgressBar(
title: '客观题正确率:', title: '客观题正确率:',
color: Color(0xFFB2DA93), color: const Color(0xFFB2DA93),
percent: item.kgtCorrectRate / 100, percent: item.kgtCorrectRate / 100,
padingEdg: EdgeInsets.zero, padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)), marginEdg: EdgeInsets.only(top: 8.h)),
ProgressBar( ProgressBar(
title: '主观题正确率:', title: '主观题正确率:',
color: Color(0xFFB2DA93), color: const Color(0xFFB2DA93),
percent: item.zgtCorrectRate / 100, percent: item.zgtCorrectRate / 100,
padingEdg: EdgeInsets.zero, padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)), marginEdg: EdgeInsets.only(top: 8.h)),
ProgressBar( ProgressBar(
title: '总正确率:', title: '总正确率:',
color: Color(0xFFB2DA93), color: const Color(0xFFB2DA93),
percent: item.correctRate / 100, percent: item.correctRate / 100,
padingEdg: EdgeInsets.zero, padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)), marginEdg: EdgeInsets.only(top: 8.h)),

View File

@ -70,14 +70,14 @@ class _JobConditionFilterState extends State<JobConditionFilter> {
customTimeStr: widget.customTimeStr, customTimeStr: widget.customTimeStr,
hasAll: widget.hasAll, hasAll: widget.hasAll,
onTap: (int val) async { onTap: (int val) async {
if (val == 0 && widget.hasAll == true) { if (val == 3 && widget.hasAll == true) {
widget.onTimeFilter(null, null); widget.onTimeFilter(null, null);
} else if ((val == 1 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)) { } else if ((val == 0 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)) {
widget.onTimeFilter( widget.onTimeFilter(
Utils.getWeekStartDate().toString().substring(0, 10), Utils.getWeekStartDate().toString().substring(0, 10),
Utils.getWeekEndDate().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 == 1 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)) {
widget.onTimeFilter( widget.onTimeFilter(
getMonthStartDate().toString().substring(0, 10), getMonthStartDate().toString().substring(0, 10),
getMonthEndDate().toString().substring(0, 10), getMonthEndDate().toString().substring(0, 10),

View File

@ -0,0 +1,237 @@
import 'dart:math';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class LineChartCon extends StatefulWidget {
final bool isShowingMainData;
final int lineNum;
final List? line1;
final List? line2;
final List? line3;
LineChartCon(
{required this.isShowingMainData,
required this.lineNum,
this.line1,
this.line2,
this.line3});
@override
State<LineChartCon> createState() => _LineChartConState();
}
class _LineChartConState extends State<LineChartCon> {
double maxX = 0.0;
@override
void initState() {
super.initState();
}
getMaxX(){
if (widget.lineNum > 2) {
if (widget.line3!.length > widget.line2!.length &&
widget.line3!.length > widget.line1!.length) {
maxX = double.parse(widget.line3!.length.toString());
} else if (widget.line2!.length > widget.line3!.length &&
widget.line2!.length > widget.line1!.length) {
maxX = double.parse(widget.line2!.length.toString());
} else {
maxX = double.parse(widget.line1!.length.toString());
}
} else if (widget.lineNum > 1) {
}
print('maxx=======$maxX');
return maxX;
}
@override
Widget build(BuildContext context) {
return LineChart(
LineChartData(
lineTouchData: const LineTouchData(enabled: false),
gridData: gridData,
titlesData: titlesData1,
borderData: borderData,
lineBarsData: lineBarsData1,
minX: 1,
maxX: getMaxX()>0? getMaxX():3,
maxY: 6,
minY: 0,
),
duration: const Duration(milliseconds: 250),
);
}
FlTitlesData get titlesData1 => FlTitlesData(
bottomTitles: AxisTitles(
sideTitles: bottomTitles,
),
rightTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
topTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
leftTitles: AxisTitles(
sideTitles: leftTitles(),
),
);
List<LineChartBarData> get lineBarsData1 => [
lineChartBarData1_1,
lineChartBarData1_2,
lineChartBarData1_3,
];
Widget leftTitleWidgets(double value, TitleMeta meta) {
String text;
switch (value.toInt()) {
case 0:
text = '0';
break;
case 1:
text = '20%';
break;
case 2:
text = '40%';
break;
case 3:
text = '60%';
break;
case 4:
text = '80%';
break;
case 5:
text = '100%';
break;
default:
return Container();
}
return Text(text, style: TextStyle(fontSize: 12.sp, color: const Color(0xFF070707)), textAlign: TextAlign.left);
/* return SideTitleWidget(
axisSide: meta.axisSide,
child: Text(
'${value}',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF070707)),
),
);*/
}
SideTitles leftTitles() => SideTitles(
getTitlesWidget: leftTitleWidgets,
showTitles: true,
interval: 1,
reservedSize: 50,
);
Widget bottomTitleWidgets(double value, TitleMeta meta) {
return SideTitleWidget(
axisSide: meta.axisSide,
space: 10,
child: Text(
value.toString() == '0.0' ? '' : value.toStringAsFixed(0),
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12.sp,
color: const Color.fromRGBO(39, 39, 39, 0.5),
),
),
);
}
SideTitles get bottomTitles => SideTitles(
showTitles: true,
reservedSize: 32,
interval: 1,
getTitlesWidget: bottomTitleWidgets,
);
FlGridData get gridData => const FlGridData(
show: true, drawVerticalLine: false, horizontalInterval: 1.0);
FlBorderData get borderData => FlBorderData(
show: true,
border: const Border(
bottom: BorderSide(color: Colors.transparent, width: 1),
left: BorderSide(color: Colors.transparent),
right: BorderSide(color: Colors.transparent),
top: BorderSide(color: Colors.transparent),
),
);
LineChartBarData get lineChartBarData1_1 => LineChartBarData(
isCurved: true,
curveSmoothness: 0,
color: const Color(0xFF4DE6BF),
barWidth: 2,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(show: false),
spots: List.generate(widget.line1!.length, (index){
var element = widget.line1![index];
return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString()));
})
/* const [
FlSpot(1, 0),
FlSpot(3, 1.5),
FlSpot(5, 1.4),
FlSpot(7, 3.4),
FlSpot(10, 2),
FlSpot(12, 2.2),
FlSpot(13, 1.8),
],*/
);
LineChartBarData get lineChartBarData1_2 => LineChartBarData(
isCurved: true,
curveSmoothness: 0,
color: Theme.of(context).primaryColor,
barWidth: 2,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(
show: false,
color: Colors.yellow,
),
spots: List.generate(widget.line2!.length, (index){
var element = widget.line2![index];
return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString()));
})
/* const [
FlSpot(1, 1),
FlSpot(3, 2.8),
FlSpot(7, 1.2),
FlSpot(10, 2.8),
FlSpot(12, 2.6),
FlSpot(13, 3.9),
],*/
);
LineChartBarData get lineChartBarData1_3 => LineChartBarData(
isCurved: true,
curveSmoothness: 0,
color: const Color(0xFF1890FF),
barWidth: 2,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(show: false),
spots: List.generate(widget.line3!.length, (index){
var element = widget.line3![index];
return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString()));
})
/* const [
FlSpot(1, 2.8),
FlSpot(3, 1.9),
FlSpot(6, 3),
FlSpot(10, 1.3),
FlSpot(13, 2.5),
],*/
);
}

View File

@ -13,10 +13,10 @@ class PersonalDetailTopBar extends StatefulWidget {
} }
class _PersonalDetailTopBarState extends State<PersonalDetailTopBar> { class _PersonalDetailTopBarState extends State<PersonalDetailTopBar> {
@override @override
void initState(){ void initState(){
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -33,26 +33,26 @@ class _PersonalDetailTopBarState extends State<PersonalDetailTopBar> {
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: const Color(0xFF8C68FF), color: const Color(0xFF4CC793),
), ),
isScrollable: true, isScrollable: true,
labelColor:const Color(0xFF8C68FF), labelColor: const Color(0xFF4CC793),
unselectedLabelColor: const Color(0xFF505E6E), unselectedLabelColor: const Color(0xFF505E6E),
padding: EdgeInsets.symmetric(horizontal: 14.r), padding: EdgeInsets.symmetric(horizontal: 14.r),
// indicatorSize: TabBarIndicatorSize.label, // // indicatorSize: TabBarIndicatorSize.label, //
onTap: widget.onTap, onTap: widget.onTap,
indicator: UnderlineTabIndicator( indicator: UnderlineTabIndicator(
borderSide: BorderSide( borderSide: BorderSide(
width: 2.r, width: 2.r,
color:const Color(0xFF8C68FF) color:const Color(0xFF4CC793)
), ),
), ),
tabs: <Widget>[ tabs: <Widget>[
if(widget.hasAll == true)
const Tab(text: '全部'),
const Tab(text: '近一周'), const Tab(text: '近一周'),
const Tab(text: '近一月'), const Tab(text: '近一月'),
Tab(text: widget.customTimeStr), Tab(text: widget.customTimeStr),
if(widget.hasAll == true)
const Tab(text: '全部'),
], ],
), ),
); );

View File

@ -106,8 +106,7 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
width: 20.r, width: 20.r,
), ),
Expanded( Expanded(
child: child: menuItem(bgImg: 'assets/images/home_bg_02.png', name: '知识点掌握', url: Routes.studentHistoryWorkPage, page: 'points'),
menuItem(bgImg: 'assets/images/home_bg_02.png', name: '知识点点掌握', url: Routes.studentHistoryWorkPage, page: 'points'),
), ),
], ],
), ),

View File

@ -5,6 +5,8 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import app_installer
import app_settings
import auto_updater_macos import auto_updater_macos
import connectivity_plus import connectivity_plus
import device_info_plus import device_info_plus
@ -14,6 +16,8 @@ import sqflite
import url_launcher_macos import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppInstallerPlugin.register(with: registry.registrar(forPlugin: "AppInstallerPlugin"))
AppSettingsPlugin.register(with: registry.registrar(forPlugin: "AppSettingsPlugin"))
AutoUpdaterMacosPlugin.register(with: registry.registrar(forPlugin: "AutoUpdaterMacosPlugin")) AutoUpdaterMacosPlugin.register(with: registry.registrar(forPlugin: "AutoUpdaterMacosPlugin"))
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1 version: 1.0.4+5
environment: environment:
sdk: '>=3.4.1 <4.0.0' sdk: '>=3.4.1 <4.0.0'
@ -48,7 +48,7 @@ dependencies:
# http请求插件 # http请求插件
dio: ^5.4.2+1 dio: ^5.4.2+1
# 网络缓存图片 # 网络缓存图片
cached_network_image: ^3.3.1 cached_network_image: ^3.2.1
# 上拉加载和下拉刷新的组件 # 上拉加载和下拉刷新的组件
flutter_easyrefresh: ^2.2.2 flutter_easyrefresh: ^2.2.2
photo_view: ^0.15.0 photo_view: ^0.15.0
@ -75,7 +75,7 @@ dependencies:
badges: ^3.1.2 badges: ^3.1.2
# 图表 # 图表
fl_chart: ^0.68.0 fl_chart: ^0.68.0
data_table_2: ^2.5.10 data_table_2: 2.5.10
flutter_staggered_grid_view: ^0.7.0 flutter_staggered_grid_view: ^0.7.0
dropdown_button2: ^2.3.9 dropdown_button2: ^2.3.9
syncfusion_flutter_datepicker: ^25.2.5 syncfusion_flutter_datepicker: ^25.2.5
@ -97,28 +97,28 @@ dependencies:
icons_launcher: ^2.1.7 icons_launcher: ^2.1.7
app_settings: ^5.1.1 app_settings: ^5.1.1
device_info_plus: ^11.1.0 device_info_plus: ^11.1.0
zoom_widget: ^2.0.1
zoom_pinch_overlay: ^1.4.3
flutter_html_2: ^0.1.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^4.0.0 retrofit_generator: ^8.1.0
retrofit_generator: ^9.0.0
build_runner: ^2.4.10 build_runner: ^2.4.10
json_serializable: ^6.6.2 json_serializable: ^6.6.2
# 分离样式 # 分离样式
functional_widget: ^0.10.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: ^3.0.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages. # The following section is specific to Flutter packages.
# dependency_overrides:
# collection: ^1.19.0
flutter: flutter:
# The following line ensures that the Material Icons font is # The following line ensures that the Material Icons font is

View File

@ -197,6 +197,8 @@

View File

@ -28,7 +28,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
Win32Window::Point origin(10, 10); Win32Window::Point origin(10, 10);
// Win32Window::Size size(1280, 720); // Win32Window::Size size(1280, 720);
Win32Window::Size size(700, 900); Win32Window::Size size(700, 900);
if (!window.Create(L"making_school_asignment_app", origin, size)) { if (!window.Create(L"", origin, size)) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
window.SetQuitOnClose(true); window.SetQuitOnClose(true);