处理本次BUG
|
|
@ -2,7 +2,8 @@
|
||||||
<application
|
<application
|
||||||
android:label="点智学"
|
android:label="点智学"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:enableOnBackInvokedCallback="true">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 69 B After Width: | Height: | Size: 69 B |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 69 B After Width: | Height: | Size: 69 B |
|
|
@ -6,7 +6,7 @@
|
||||||
<item name="android:windowFullscreen">false</item>
|
<item name="android:windowFullscreen">false</item>
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
||||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||||
<item name="android:windowSplashScreenBackground">#eeeeee</item>
|
<item name="android:windowSplashScreenBackground">#FFFFFF</item>
|
||||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
|
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<item name="android:windowFullscreen">false</item>
|
<item name="android:windowFullscreen">false</item>
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
||||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||||
<item name="android:windowSplashScreenBackground">#eeeeee</item>
|
<item name="android:windowSplashScreenBackground">#FFFFFF</item>
|
||||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
|
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,39 @@
|
||||||
the Flutter tool needs it to communicate with the running application
|
the Flutter tool needs it to communicate with the running application
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
-->
|
-->
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<!-- 访问电话状态 -->
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.READ_PHONE_STATE"/>
|
||||||
|
<!-- 允许全部网络访问 -->
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.INTERNET"/>
|
||||||
|
<!-- 获取网络信息状态 -->
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
|
<!-- 获取当前WiFi接入的状态以及WLAN热点的信息 -->
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||||
|
<!-- 获取当前设备存储权限 -->
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.ACTION_MANAGE_UNKNOWN_APP_SOURCES"/>
|
||||||
|
<!-- 这个权限用于app安装 -->
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
|
||||||
|
<!-- 屏幕常亮权限 -->
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.WAKE_LOCK"/>
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.CAMERA"/>
|
||||||
|
<!-- Permissions options for the `access notification policy` group -->
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>
|
||||||
|
<!-- Permissions options for the `notification` group -->
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 18 KiB |
|
|
@ -5,11 +5,11 @@ flutter_native_splash:
|
||||||
# 如需恢复默认的白屏,执行如下命令
|
# 如需恢复默认的白屏,执行如下命令
|
||||||
# flutter pub run flutter_native_splash:remove
|
# flutter pub run flutter_native_splash:remove
|
||||||
# 设置闪屏页的默认态logo或背景图片路径
|
# 设置闪屏页的默认态logo或背景图片路径
|
||||||
color: "#eeeeee"
|
color: "##FFFFFF"
|
||||||
image_ios: assets/images/splash_native.png
|
image_ios: assets/images/splash_native.png
|
||||||
background_image_android: assets/images/splash_native.png
|
background_image_android: assets/images/splash_native.png
|
||||||
android_12:
|
android_12:
|
||||||
image: assets/images/splash.png
|
image: assets/images/splash2.png
|
||||||
android: true
|
android: true
|
||||||
ios: true
|
ios: true
|
||||||
android_gravity: fill
|
android_gravity: fill
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 69 B After Width: | Height: | Size: 69 B |
|
|
@ -1,9 +1,12 @@
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/app_version.dart';
|
import 'package:making_school_asignment_app/common/job/app_version.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/permission_describe_util.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
import 'UpdateDialog.dart';
|
import 'UpdateDialog.dart';
|
||||||
import 'model/UpdateAppEvent.dart';
|
import 'model/UpdateAppEvent.dart';
|
||||||
|
|
@ -20,7 +23,21 @@ class UpgradeLogic extends GetxController with RequestToolMixin {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
void getAppUpgrade(BuildContext context) async {
|
void getAppUpgrade(BuildContext context) async {
|
||||||
// if (!const bool.fromEnvironment('dart.vm.product')) return;
|
if (!const bool.fromEnvironment('dart.vm.product')) return;
|
||||||
|
DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
|
||||||
|
AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
|
||||||
|
Permission storagePermission;
|
||||||
|
if (androidInfo.version.sdkInt >= 33) {
|
||||||
|
storagePermission = Permission.manageExternalStorage;
|
||||||
|
} else {
|
||||||
|
storagePermission = Permission.storage;
|
||||||
|
}
|
||||||
|
PermissionDescribeUtil.instance.toLaunchPermissionRequest(
|
||||||
|
context,
|
||||||
|
title: '储存权限请求',
|
||||||
|
describe: "为了提供更好的服务,需要获取到存储权限用于保存APP升级文件APK,进行升级",
|
||||||
|
permissions: [storagePermission],
|
||||||
|
);
|
||||||
try {
|
try {
|
||||||
showUpgrade.value = true;
|
showUpgrade.value = true;
|
||||||
// if (['18888888888'].contains(user.loginName)) return;
|
// if (['18888888888'].contains(user.loginName)) return;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,295 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:app_settings/app_settings.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
|
class PermissionDescribePage extends StatefulWidget {
|
||||||
|
final String title;
|
||||||
|
final String describe;
|
||||||
|
final List<Permission> permissions;
|
||||||
|
|
||||||
|
const PermissionDescribePage({required this.title, required this.describe, required this.permissions, super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PermissionDescribePage> createState() => _PermissionDescribePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PermissionDescribePageState extends State<PermissionDescribePage> with WidgetsBindingObserver {
|
||||||
|
Timer? _timerPermission;
|
||||||
|
bool theOpenAppSettings = false;
|
||||||
|
int theExecutionFrequency = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
|
||||||
|
Future.delayed(const Duration(seconds: 3), () {
|
||||||
|
getCheckPermission(context);
|
||||||
|
});
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
|
print("-didChangeAppLifecycleState-" + state.toString());
|
||||||
|
switch (state) {
|
||||||
|
case AppLifecycleState.inactive: // 处于这种状态的应用程序应该假设它们可能在任何时候暂停。
|
||||||
|
break;
|
||||||
|
case AppLifecycleState.resumed: //从后台切换前台,界面可见
|
||||||
|
if (theOpenAppSettings) {
|
||||||
|
getCheckPermission(context);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case AppLifecycleState.paused: // 界面不可见,后台
|
||||||
|
break;
|
||||||
|
case AppLifecycleState.detached: // APP结束时调用
|
||||||
|
break;
|
||||||
|
case AppLifecycleState.hidden:
|
||||||
|
// TODO: Handle this case.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_timerPermission?.cancel();
|
||||||
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
void getCheckPermission(BuildContext context) async {
|
||||||
|
theOpenAppSettings = false;
|
||||||
|
theExecutionFrequency++;
|
||||||
|
|
||||||
|
List<Permission> permissions = []; // 普通拒绝
|
||||||
|
List<Permission> permanentRefusal = []; // 永久拒绝
|
||||||
|
for (var i = 0; i < widget.permissions.length; i++) {
|
||||||
|
var p = widget.permissions[i];
|
||||||
|
var status = await p.status;
|
||||||
|
var shouldShowRequestRationale = await p.shouldShowRequestRationale;
|
||||||
|
if (!status.isGranted) {
|
||||||
|
if (status.isDenied) {
|
||||||
|
if (shouldShowRequestRationale) {
|
||||||
|
/// 说明情况,再次發起权限请求(已经拒绝一次了)
|
||||||
|
await showDialog(
|
||||||
|
context: context,
|
||||||
|
barrierDismissible: false,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: quickText(widget.title, fontWeight: FontWeight.bold),
|
||||||
|
content: quickText(widget.describe, maxLines: 20),
|
||||||
|
actions: [
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () async => Navigator.of(context).pop(),
|
||||||
|
child: const Text('我已知晓'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
permissions.add(p);
|
||||||
|
} else if (await status.isPermanentlyDenied) {
|
||||||
|
permanentRefusal.add(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (permissions.isNotEmpty) {
|
||||||
|
// 普通拒绝
|
||||||
|
permanentRefusal.addAll(await getStoragePermission(context, permissions));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (permanentRefusal.isNotEmpty) {
|
||||||
|
/// 被永久拒绝了 需要弹出对话框说明 使用户自行操作
|
||||||
|
await showDialog(
|
||||||
|
context: context,
|
||||||
|
barrierDismissible: false,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
content: quickText(widget.describe, maxLines: 20),
|
||||||
|
title: quickText(widget.title, fontWeight: FontWeight.bold),
|
||||||
|
actions: [
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () async {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
theOpenAppSettings = true;
|
||||||
|
await AppSettings.openAppSettings(asAnotherTask: true);
|
||||||
|
},
|
||||||
|
child: const Text('前往APP权限设置'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
Navigator.of(Get.context ?? context).pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 权限发起请求
|
||||||
|
/// @param List<Permission> permissions 权限集合
|
||||||
|
Future<List<Permission>> getStoragePermission(BuildContext context, List<Permission> permissions, [int executionFrequency = 0]) async {
|
||||||
|
Map<Permission, PermissionStatus> statusRes = await permissions.request();
|
||||||
|
|
||||||
|
List<Permission> permanentRefusal = []; // 永久拒绝
|
||||||
|
|
||||||
|
List<Permission> keys = statusRes.keys.toList();
|
||||||
|
|
||||||
|
for (var i = 0; i < keys.length; i++) {
|
||||||
|
Permission key = keys[i];
|
||||||
|
PermissionStatus status = statusRes[key]!;
|
||||||
|
if (status.isPermanentlyDenied) {
|
||||||
|
/// 添加永久拒绝的权限集合
|
||||||
|
permanentRefusal.add(key);
|
||||||
|
} else if (status.isDenied) {
|
||||||
|
/// 如果权限被永久拒绝,我们可能需要引导用户到应用设置中手动开启权限,显示一个对话框,解释为什么需要这个权限
|
||||||
|
/// 应用之前已经请求过该权限,并且用户选择了“拒绝”,但没有选择“不再询问”(即没有永久拒绝)。
|
||||||
|
/// 系统认为向用户显示一个权限请求的说明是合适的,以便用户理解为什么应用需要这个权限。
|
||||||
|
if (await key.shouldShowRequestRationale) {
|
||||||
|
/// 说明情况,再次發起权限请求(已经拒绝一次了)
|
||||||
|
/// TODO 对话框 说明情况 再发发起请求
|
||||||
|
await showDialog(
|
||||||
|
context: context,
|
||||||
|
barrierDismissible: false,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: quickText(widget.title, fontWeight: FontWeight.bold),
|
||||||
|
content: quickText(widget.describe, maxLines: 20),
|
||||||
|
actions: [
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () async => Navigator.of(context).pop(),
|
||||||
|
child: const Text('我已知晓'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (permissions.length == 1 && key == permissions[0]) {
|
||||||
|
executionFrequency++;
|
||||||
|
}
|
||||||
|
if (executionFrequency <= 1) {
|
||||||
|
var res = await getStoragePermission(context, [key], executionFrequency);
|
||||||
|
permanentRefusal.addAll(res);
|
||||||
|
} else {
|
||||||
|
permanentRefusal.add(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
// break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return permanentRefusal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return PopScope(
|
||||||
|
canPop: false,
|
||||||
|
child: Container(
|
||||||
|
width: ScreenUtil().screenWidth,
|
||||||
|
height: ScreenUtil().screenHeight,
|
||||||
|
decoration: const BoxDecoration(color: Colors.transparent),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(height: ScreenUtil().screenHeight * 0.1),
|
||||||
|
Container(
|
||||||
|
width: ScreenUtil().screenWidth * 0.9,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 20.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(10.r),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.5), // 阴影颜色
|
||||||
|
spreadRadius: 2, // 水平和垂直方向上扩展范围
|
||||||
|
blurRadius: 4, // 模糊半径
|
||||||
|
offset: Offset(0, 3), // X 和 Y 的偏移量
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
quickText(widget.title, size: 24.sp),
|
||||||
|
quickText(widget.describe, maxLines: 20),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Expanded(child: SizedBox()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PermissionDescribeUtil {
|
||||||
|
static PermissionDescribeUtil? _instance;
|
||||||
|
|
||||||
|
PermissionDescribeUtil._internal();
|
||||||
|
|
||||||
|
static get instance {
|
||||||
|
return _instance ??= PermissionDescribeUtil._internal();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 发起权限请求
|
||||||
|
void toLaunchPermissionRequest(
|
||||||
|
BuildContext context, {
|
||||||
|
required String title,
|
||||||
|
required String describe,
|
||||||
|
required List<Permission> permissions,
|
||||||
|
}) async {
|
||||||
|
var isGranted = false;
|
||||||
|
for (var i = 0; i < permissions.length; i++) {
|
||||||
|
var p = permissions[i];
|
||||||
|
if (!(await p.status.isGranted)) {
|
||||||
|
isGranted = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isGranted) {
|
||||||
|
Navigator.of(Get.context ?? context).push(PageRouteBuilder(
|
||||||
|
opaque: false,
|
||||||
|
pageBuilder: (context, animation, secondaryAnimation) {
|
||||||
|
return PermissionDescribePage(
|
||||||
|
title: title,
|
||||||
|
describe: describe,
|
||||||
|
permissions: permissions,
|
||||||
|
);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
// await Navigator.of(context).push(
|
||||||
|
// transparentRoute<PermissionDescribePage>(
|
||||||
|
// builder: (context) => PermissionDescribePage(
|
||||||
|
// title: title,
|
||||||
|
// describe: describe,
|
||||||
|
// permissions: permissions,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Route transparentRoute<T>({
|
||||||
|
// required WidgetBuilder builder,
|
||||||
|
// RouteSettings? settings,
|
||||||
|
// }) {
|
||||||
|
// return PageRouteBuilder<T>(
|
||||||
|
// pageBuilder: (
|
||||||
|
// BuildContext context,
|
||||||
|
// Animation<double> animation,
|
||||||
|
// Animation<double> secondaryAnimation,
|
||||||
|
// ) {
|
||||||
|
// return builder(context);
|
||||||
|
// },
|
||||||
|
// transitionsBuilder: (_, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
||||||
|
// return child;
|
||||||
|
// },
|
||||||
|
// barrierDismissible: false, // 允许点击返回按钮关闭页面
|
||||||
|
// // barrierColor: Colors.transparent, // 透明屏障颜色
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
@ -72,12 +72,22 @@ class MyApp extends StatelessWidget {
|
||||||
useMaterial3: false,
|
useMaterial3: false,
|
||||||
colorScheme: const ColorScheme.light(
|
colorScheme: const ColorScheme.light(
|
||||||
// 修改亮色主题的主题颜色
|
// 修改亮色主题的主题颜色
|
||||||
primary: Color(0xFF8C68FF),
|
primary: Color(0xFF8C68FF),
|
||||||
)),
|
)),
|
||||||
enableLog: true,
|
enableLog: true,
|
||||||
logWriterCallback: (text, {bool isError = false}) {
|
logWriterCallback: (text, {bool isError = false}) {
|
||||||
// isError ? LoggerUtils.e(text) : LoggerUtils.i(text);
|
// isError ? LoggerUtils.e(text) : LoggerUtils.i(text);
|
||||||
},
|
},
|
||||||
|
routingCallback: (routing) {
|
||||||
|
String? currentRouter = routing?.current;
|
||||||
|
// print("当前路由:${currentRouter}");
|
||||||
|
// if ([Routes.home, Routes.myInfo].contains(currentRouter)) {
|
||||||
|
// SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||||
|
// statusBarIconBrightness: Brightness.light,
|
||||||
|
// systemStatusBarContrastEnforced: false,
|
||||||
|
// ));
|
||||||
|
// }
|
||||||
|
},
|
||||||
// 这里是国际化支持,确保添加flutter_localizations依赖
|
// 这里是国际化支持,确保添加flutter_localizations依赖
|
||||||
supportedLocales: const [
|
supportedLocales: const [
|
||||||
Locale('zh', 'CN'), // 中文简体
|
Locale('zh', 'CN'), // 中文简体
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,21 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:app_settings/app_settings.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_native_splash/flutter_native_splash.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/utils/app_upgrade/upgradeLogic.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/user_info.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/user_info_detail.dart';
|
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||||
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/store/user_store.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/utils/storage.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/my_info.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/home_page/home_logic.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/home_page/home_view.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/work_page/work_logic.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/work_page/work_view.dart';
|
|
||||||
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:making_school_asignment_app/common/job/user_info.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/utils/storage.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/store/user_store.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
||||||
|
import 'package:making_school_asignment_app/page/home_page/home_view.dart';
|
||||||
|
import 'package:making_school_asignment_app/page/home_page/home_logic.dart';
|
||||||
|
import 'package:making_school_asignment_app/page/work_page/work_logic.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/job/user_info_detail.dart';
|
||||||
|
import 'package:making_school_asignment_app/page/home_page/children/my_info.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/utils/app_upgrade/upgradeLogic.dart';
|
||||||
|
|
||||||
class StartPage extends StatefulWidget {
|
class StartPage extends StatefulWidget {
|
||||||
const StartPage({super.key});
|
const StartPage({super.key});
|
||||||
|
|
@ -37,70 +33,16 @@ class _StartPageState extends State<StartPage> with RequestToolMixin {
|
||||||
|
|
||||||
late final List<Widget> _bodyList;
|
late final List<Widget> _bodyList;
|
||||||
|
|
||||||
void getStoragePermission() async {
|
|
||||||
_timerPermission?.cancel();
|
|
||||||
_timerPermission = null;
|
|
||||||
var status = await Permission.storage.request();
|
|
||||||
if (status != PermissionStatus.granted) {
|
|
||||||
print(status);
|
|
||||||
if (status == PermissionStatus.denied) {
|
|
||||||
await showDialog(
|
|
||||||
context: context,
|
|
||||||
barrierDismissible: false,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: const Text("储存权限拒绝"),
|
|
||||||
content: const Text("为了提供更好的服务,需要获取到存储权限用于保存批阅笔记"),
|
|
||||||
actions: [
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () async {
|
|
||||||
await AppSettings.openAppSettings(asAnotherTask: true);
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
_timerPermission = Timer.periodic(const Duration(seconds: 30), (_) => getStoragePermission());
|
|
||||||
},
|
|
||||||
child: const Text('前往APP权限设置'),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await showDialog(
|
|
||||||
context: context,
|
|
||||||
barrierDismissible: false,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text("内存权限"),
|
|
||||||
content: Text("为了提供更好的服务,需要获取到存储权限用于保存批阅笔记"),
|
|
||||||
actions: [
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () async {
|
|
||||||
await Permission.storage.request();
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
getStoragePermission();
|
|
||||||
},
|
|
||||||
child: Text('允许'),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
Future.delayed(const Duration(seconds: 3), () => FlutterNativeSplash.remove());
|
Future.delayed(const Duration(seconds: 3), () => FlutterNativeSplash.remove());
|
||||||
Future.delayed(const Duration(seconds: 4), () => getStoragePermission());
|
|
||||||
|
|
||||||
Get.put(HomeLogic());
|
Get.put(HomeLogic());
|
||||||
Get.put(WorkLogic());
|
Get.put(WorkLogic());
|
||||||
|
// const WorkPage(),
|
||||||
_bodyList = [const HomePage(), const WorkPage(), const MyInfo()];
|
_bodyList = [const HomePage(), const MyInfo()];
|
||||||
// APP 启动后就直接更新
|
// APP 启动后就直接更新
|
||||||
if (!_upgradeLogic.showUpgrade.value) _upgradeLogic.getAppUpgrade(context);
|
if (!_upgradeLogic.showUpgrade.value) _upgradeLogic.getAppUpgrade(context);
|
||||||
_timer?.cancel();
|
_timer?.cancel();
|
||||||
|
|
@ -148,7 +90,6 @@ class _StartPageState extends State<StartPage> with RequestToolMixin {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(statusBarIconBrightness: Brightness.dark));
|
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
body: PageView(
|
body: PageView(
|
||||||
|
|
@ -156,27 +97,28 @@ class _StartPageState extends State<StartPage> with RequestToolMixin {
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
onPageChanged: (index) {
|
onPageChanged: (index) {
|
||||||
_pageController._pageIndexState.pageIndex.value = index;
|
_pageController._pageIndexState.pageIndex.value = index;
|
||||||
if (index == 2) {
|
// if (index == 2) {
|
||||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(statusBarIconBrightness: Brightness.light));
|
// SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(statusBarIconBrightness: Brightness.light));
|
||||||
} else {
|
// } else {
|
||||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(statusBarIconBrightness: Brightness.dark));
|
// SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(statusBarIconBrightness: Brightness.dark));
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
children: _bodyList,
|
children: _bodyList,
|
||||||
),
|
),
|
||||||
bottomNavigationBar: Obx(() {
|
bottomNavigationBar: Obx(() {
|
||||||
return BottomNavigationBar(
|
return BottomNavigationBar(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
items: <BottomNavigationBarItem>[
|
items: <BottomNavigationBarItem>[
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
label: '作业',
|
label: '作业',
|
||||||
icon: getItemIcon('assets/images/ic_home_normal.png'),
|
icon: getItemIcon('assets/images/ic_home_normal.png'),
|
||||||
activeIcon: getItemIcon('assets/images/ic_home_active.png'),
|
activeIcon: getItemIcon('assets/images/ic_home_active.png'),
|
||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
// BottomNavigationBarItem(
|
||||||
label: '考试',
|
// label: '考试',
|
||||||
icon: getItemIcon('assets/images/ic_work_normal.png'),
|
// icon: getItemIcon('assets/images/ic_work_normal.png'),
|
||||||
activeIcon: getItemIcon('assets/images/ic_work_active.png'),
|
// activeIcon: getItemIcon('assets/images/ic_work_active.png'),
|
||||||
),
|
// ),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
label: '我的',
|
label: '我的',
|
||||||
icon: getItemIcon('assets/images/ic_mine_normal.png'),
|
icon: getItemIcon('assets/images/ic_mine_normal.png'),
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
|
@ -5,11 +6,13 @@ import 'package:functional_widget_annotation/functional_widget_annotation.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
|
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
|
||||||
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
|
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/utils/permission_describe_util.dart';
|
||||||
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
||||||
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
||||||
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/homework_review/configuration_files/index.dart';
|
import 'package:making_school_asignment_app/page/home_page/children/homework_review/configuration_files/index.dart';
|
||||||
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
import 'original_manuscript_handwriting/answer_handwriting_view.dart';
|
import 'original_manuscript_handwriting/answer_handwriting_view.dart';
|
||||||
|
|
||||||
|
|
@ -24,9 +27,25 @@ class DropdownSwitchStudentsType extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _DropdownSwitchStudentsTypeState extends State<DropdownSwitchStudentsType> {
|
class _DropdownSwitchStudentsTypeState extends State<DropdownSwitchStudentsType> {
|
||||||
|
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
|
||||||
final logic = Get.find<HomeworkReviewLogic>();
|
final logic = Get.find<HomeworkReviewLogic>();
|
||||||
final sateData = Get.find<HomeworkReviewLogic>().state.data;
|
final sateData = Get.find<HomeworkReviewLogic>().state.data;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
deviceInfoPlugin.androidInfo.then((androidInfo) {
|
||||||
|
Permission storagePermission = androidInfo.version.sdkInt >= 33 ? Permission.manageExternalStorage : Permission.storage;
|
||||||
|
PermissionDescribeUtil.instance.toLaunchPermissionRequest(
|
||||||
|
context,
|
||||||
|
title: '储存权限请求',
|
||||||
|
describe: "为了提供更好的服务,需要获取到存储权限用于保存批阅痕迹并上传",
|
||||||
|
permissions: [storagePermission],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
|
|
|
||||||
|
|
@ -51,18 +51,12 @@ class _HomeworkReviewState extends State<HomeworkReview> {
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
// titleSpacing: 0,
|
// titleSpacing: 0,
|
||||||
leading: IconButton(
|
leading: IconButton(icon: const Icon(Icons.arrow_back_ios), onPressed: () => Get.back()),
|
||||||
icon: const Icon(Icons.arrow_back_ios),
|
|
||||||
onPressed: () => Get.back()),
|
|
||||||
iconTheme: const IconThemeData(color: Colors.black),
|
iconTheme: const IconThemeData(color: Colors.black),
|
||||||
title: quickText(sateData.param.value.homeworkName),
|
title: quickText(sateData.param.value.homeworkName),
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
actions: [
|
actions: [const FavoriteWidget(), SizedBox(width: 5.w), const ReturnToHomepage()],
|
||||||
const FavoriteWidget(),
|
|
||||||
SizedBox(width: 5.w),
|
|
||||||
const ReturnToHomepage()
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,16 @@ class MyInfo extends StatefulWidget {
|
||||||
class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
late Rx<UserInfoDetail?> userInfo = UserStore.to.userDetailInfo;
|
late Rx<UserInfoDetail?> userInfo = UserStore.to.userDetailInfo;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||||
|
statusBarIconBrightness: Brightness.light,
|
||||||
|
statusBarColor: Colors.transparent, //状态栏背景颜色
|
||||||
|
systemStatusBarContrastEnforced: false,
|
||||||
|
));
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
// 确认对话框
|
// 确认对话框
|
||||||
_showAlertDialog(context1) async {
|
_showAlertDialog(context1) async {
|
||||||
await showDialog(
|
await showDialog(
|
||||||
|
|
@ -26,31 +36,27 @@ class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
context: context1,
|
context: context1,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return AlertDialog(
|
return AlertDialog(title: quickText("提示信息"), content: quickText("您确定要退出登录吗?"), actions: <Widget>[
|
||||||
title: quickText("提示信息"),
|
TextButton(
|
||||||
content: quickText("您确定要退出登录吗?"),
|
child: quickText("取消"),
|
||||||
actions: <Widget>[
|
onPressed: () {
|
||||||
TextButton(
|
Navigator.pop(context, 'Cancle');
|
||||||
child: quickText("取消"),
|
},
|
||||||
onPressed: () {
|
),
|
||||||
Navigator.pop(context, 'Cancle');
|
TextButton(
|
||||||
},
|
child: quickText("确定"),
|
||||||
),
|
onPressed: () async {
|
||||||
TextButton(
|
try {
|
||||||
child: quickText("确定"),
|
UserStore.to.erase();
|
||||||
onPressed: () async {
|
await StorageService.to.erase();
|
||||||
try {
|
StorageService.to.write(AppStorageKey.privacyAgreement.value, true);
|
||||||
UserStore.to.erase();
|
Navigator.pop(context, "Ok");
|
||||||
await StorageService.to.erase();
|
Get.offAllNamed(Routes.login);
|
||||||
StorageService.to
|
} catch (e) {
|
||||||
.write(AppStorageKey.privacyAgreement.value, true);
|
print(e);
|
||||||
Navigator.pop(context, "Ok");
|
}
|
||||||
Get.offAllNamed(Routes.login);
|
})
|
||||||
} catch (e) {
|
]);
|
||||||
print(e);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,8 +76,7 @@ class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
fontSize: 13.sp,
|
fontSize: 13.sp,
|
||||||
);
|
);
|
||||||
|
|
||||||
return OrientationBuilder(
|
return OrientationBuilder(builder: (BuildContext context, Orientation orientation) {
|
||||||
builder: (BuildContext context, Orientation orientation) {
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|
@ -103,7 +108,7 @@ class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: 150.h,
|
height: 150.h,
|
||||||
padding: EdgeInsets.only(left: 20.r,right: 20.r),
|
padding: EdgeInsets.only(left: 20.r, right: 20.r),
|
||||||
// alignment: Alignment.center,
|
// alignment: Alignment.center,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
|
@ -124,14 +129,13 @@ class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
margin: EdgeInsets.only(top: 0.h),
|
margin: EdgeInsets.only(top: 0.h),
|
||||||
child: Text(
|
child: Text(
|
||||||
userInfo.value?.name ?? '请前往登录',
|
userInfo.value?.name ?? '请前往登录',
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 16.sp, color: const Color(0xFF332A2A), fontWeight: FontWeight.w500),
|
||||||
fontSize: 16.sp, color: const Color(0xFF332A2A),fontWeight: FontWeight.w500),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: (){
|
onTap: () {
|
||||||
_showAlertDialog(context);
|
_showAlertDialog(context);
|
||||||
},
|
},
|
||||||
child: Image.asset('assets/images/out_icon.png'),
|
child: Image.asset('assets/images/out_icon.png'),
|
||||||
|
|
@ -142,8 +146,7 @@ class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
SizedBox(height: 14.h),
|
SizedBox(height: 14.h),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.symmetric(vertical: 5.h, horizontal: 16.w),
|
margin: EdgeInsets.symmetric(vertical: 5.h, horizontal: 16.w),
|
||||||
padding:
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 16.w),
|
||||||
EdgeInsets.symmetric(vertical: 15.h, horizontal: 16.w),
|
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.w)),
|
borderRadius: BorderRadius.all(Radius.circular(6.w)),
|
||||||
|
|
@ -159,17 +162,12 @@ class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [Text('账号', style: personalInfoTitleStly), Text(userInfo.value?.name ?? '请前往登录', style: personalInfoValStly)],
|
||||||
Text('账号', style: personalInfoTitleStly),
|
|
||||||
Text(userInfo.value?.name ?? '请前往登录',
|
|
||||||
style: personalInfoValStly)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.symmetric(vertical: 5.h, horizontal: 16.w),
|
margin: EdgeInsets.symmetric(vertical: 5.h, horizontal: 16.w),
|
||||||
padding:
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 16.w),
|
||||||
EdgeInsets.symmetric(vertical: 15.h, horizontal: 16.w),
|
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.w)),
|
borderRadius: BorderRadius.all(Radius.circular(6.w)),
|
||||||
|
|
@ -183,19 +181,14 @@ class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child:Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [Text('所在学校', style: personalInfoTitleStly), Text(userInfo.value?.schoolName ?? '', style: personalInfoValStly)],
|
||||||
Text('所在学校', style: personalInfoTitleStly),
|
|
||||||
Text(userInfo.value?.schoolName ?? '',
|
|
||||||
style: personalInfoValStly)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.symmetric(vertical: 5.h, horizontal: 16.w),
|
margin: EdgeInsets.symmetric(vertical: 5.h, horizontal: 16.w),
|
||||||
padding:
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 16.w),
|
||||||
EdgeInsets.symmetric(vertical: 15.h, horizontal: 16.w),
|
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.w)),
|
borderRadius: BorderRadius.all(Radius.circular(6.w)),
|
||||||
|
|
@ -209,7 +202,7 @@ class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child:InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(Routes.otherPage);
|
Get.toNamed(Routes.otherPage);
|
||||||
},
|
},
|
||||||
|
|
@ -226,8 +219,6 @@ class _MyInfoState extends State<MyInfo> with AutomaticKeepAliveClientMixin {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,15 @@
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|
||||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/job/work_student.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/utils/enum_untils.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/read_over/widget/annotate_list.dart';
|
import 'package:making_school_asignment_app/page/home_page/children/read_over/widget/annotate_list.dart';
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/read_over/widget/task_list_item.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart';
|
|
||||||
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
||||||
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
|
||||||
|
|
||||||
import 'read_over_logic.dart';
|
import 'read_over_logic.dart';
|
||||||
|
|
||||||
class ReadOverPage extends StatefulWidget {
|
class ReadOverPage extends StatefulWidget {
|
||||||
const ReadOverPage({Key? key}) : super(key: key);
|
const ReadOverPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ReadOverPage> createState() => _ReadOverPageState();
|
State<ReadOverPage> createState() => _ReadOverPageState();
|
||||||
|
|
@ -29,6 +19,16 @@ class _ReadOverPageState extends State<ReadOverPage> {
|
||||||
final logic = Get.find<ReadOverLogic>();
|
final logic = Get.find<ReadOverLogic>();
|
||||||
final state = Get.find<ReadOverLogic>().state;
|
final state = Get.find<ReadOverLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||||
|
statusBarColor: Colors.transparent, //状态栏背景颜色
|
||||||
|
statusBarIconBrightness: Brightness.light,
|
||||||
|
systemStatusBarContrastEnforced: false,
|
||||||
|
));
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AnnotatedRegion(
|
return AnnotatedRegion(
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,9 @@ class HomePage extends StatefulWidget {
|
||||||
State<HomePage> createState() => _HomePageState();
|
State<HomePage> createState() => _HomePageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _HomePageState extends State<HomePage>
|
class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
|
||||||
with AutomaticKeepAliveClientMixin {
|
|
||||||
final logic = Get.find<HomeLogic>();
|
final logic = Get.find<HomeLogic>();
|
||||||
final state = Get
|
final state = Get.find<HomeLogic>().state;
|
||||||
.find<HomeLogic>()
|
|
||||||
.state;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
@ -38,7 +35,8 @@ class _HomePageState extends State<HomePage>
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||||
statusBarIconBrightness: Brightness.dark,
|
statusBarColor: Colors.transparent, //状态栏背景颜色
|
||||||
|
statusBarIconBrightness: Brightness.light,
|
||||||
systemStatusBarContrastEnforced: false,
|
systemStatusBarContrastEnforced: false,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -54,19 +52,20 @@ class _HomePageState extends State<HomePage>
|
||||||
return EasyRefresh(
|
return EasyRefresh(
|
||||||
firstRefresh: false,
|
firstRefresh: false,
|
||||||
taskIndependence: true,
|
taskIndependence: true,
|
||||||
|
enableControlFinishLoad: true,
|
||||||
controller: logic.refreshController,
|
controller: logic.refreshController,
|
||||||
header: MaterialHeader(),
|
header: MaterialHeader(),
|
||||||
footer: TaurusFooter(),
|
// footer: TaurusFooter(),
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
state.pageNumber = 1;
|
state.pageNumber = 1;
|
||||||
return logic.getList();
|
return logic.getList();
|
||||||
},
|
},
|
||||||
onLoad: () async {
|
// onLoad: () async {
|
||||||
if (state.workList.length < state.totalCount.value) {
|
// if (state.workList.length < state.totalCount.value) {
|
||||||
state.pageNumber++;
|
// state.pageNumber++;
|
||||||
return logic.getList();
|
// return logic.getList();
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
|
|
@ -78,10 +77,7 @@ class _HomePageState extends State<HomePage>
|
||||||
margin: EdgeInsets.only(top: 300.h),
|
margin: EdgeInsets.only(top: 300.h),
|
||||||
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 20.r),
|
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 20.r),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(30.r), topRight: Radius.circular(30.r))),
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(30.r),
|
|
||||||
topRight: Radius.circular(30.r))),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|
@ -89,10 +85,7 @@ class _HomePageState extends State<HomePage>
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'我的作业管理',
|
'我的作业管理',
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 20.sp, color: const Color(0xFF676666), fontWeight: FontWeight.w600),
|
||||||
fontSize: 20.sp,
|
|
||||||
color: const Color(0xFF676666),
|
|
||||||
fontWeight: FontWeight.w600),
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 15.r,
|
height: 15.r,
|
||||||
|
|
@ -102,21 +95,19 @@ class _HomePageState extends State<HomePage>
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
return menuItem(
|
return menuItem(
|
||||||
bgImg: 'assets/images/home_bg_01.png',
|
bgImg: 'assets/images/home_bg_01.png',
|
||||||
name: '作业批阅',
|
name: '作业批阅',
|
||||||
value: state.totalCount.value.toString(),
|
value: state.totalCount.value.toString(),
|
||||||
url: Routes.readOverPage);
|
url: Routes.readOverPage,
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 20.r,
|
width: 20.r,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: menuItem(
|
child:
|
||||||
bgImg: 'assets/images/home_bg_02.png',
|
menuItem(bgImg: 'assets/images/home_bg_02.png', name: '知识点点掌握', url: Routes.studentHistoryWorkPage, page: 'points'),
|
||||||
name: '知识点点掌握',
|
|
||||||
url: Routes.studentHistoryWorkPage,
|
|
||||||
page: 'points'),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -126,20 +117,14 @@ class _HomePageState extends State<HomePage>
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: menuItem(
|
child:
|
||||||
bgImg: 'assets/images/home_bg_03.png',
|
menuItem(bgImg: 'assets/images/home_bg_03.png', name: '学生历史作业', url: Routes.studentHistoryWorkPage, page: 'history'),
|
||||||
name: '学生历史作业',
|
|
||||||
url: Routes.studentHistoryWorkPage,
|
|
||||||
page: 'history'),
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 20.r,
|
width: 20.r,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: menuItem(
|
child: menuItem(bgImg: 'assets/images/home_bg_04.png', name: '答题轨迹', url: Routes.answerTrajectoryPage),
|
||||||
bgImg: 'assets/images/home_bg_04.png',
|
|
||||||
name: '答题轨迹',
|
|
||||||
url: Routes.answerTrajectoryPage),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -149,14 +134,14 @@ class _HomePageState extends State<HomePage>
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
menuItem(
|
menuItem(
|
||||||
bgImg: 'assets/images/home_bg_05.png',
|
bgImg: 'assets/images/home_bg_05.png',
|
||||||
name: '优先批阅设定',
|
name: '优先批阅设定',
|
||||||
url: Routes.studentHistoryWorkPage,
|
url: Routes.studentHistoryWorkPage,
|
||||||
page: 'set',),
|
page: 'set',
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 20.r,
|
width: 20.r,
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 15.h),
|
SizedBox(height: 15.h),
|
||||||
|
|
@ -178,20 +163,18 @@ class _HomePageState extends State<HomePage>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget menuItem({required String bgImg, required String name, String? value,required String url,String? page}) {
|
Widget menuItem({required String bgImg, required String name, String? value, required String url, String? page}) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: (){
|
onTap: () {
|
||||||
Get.toNamed(url, arguments: {'page': page ?? ''});
|
Get.toNamed(url, arguments: {'page': page ?? ''});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: (Get.width - 60.r) / 2,
|
width: (Get.width - 60.r) / 2,
|
||||||
height: (Get.width - 60.r) / 2 * 86 / 164,
|
height: (Get.width - 60.r) / 2 * 86 / 164,
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(vertical: 15.r, horizontal: 15.r),
|
||||||
vertical: 15.r, horizontal: 15.r),
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage(
|
image: AssetImage(bgImg),
|
||||||
bgImg),
|
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -199,33 +182,26 @@ Widget menuItem({required String bgImg, required String name, String? value,requ
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
.spaceBetween,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment
|
|
||||||
.center,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
name,
|
name,
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF4F4F4F), fontWeight: FontWeight.w600),
|
||||||
fontSize: 14.sp,
|
|
||||||
color: const Color(0xFF4F4F4F),
|
|
||||||
fontWeight: FontWeight.w600),
|
|
||||||
),
|
),
|
||||||
if(value != null && value != '')
|
if (value != null && value != '')
|
||||||
Container(
|
Container(
|
||||||
width: 18.r,
|
width: 18.r,
|
||||||
height: 18.r,
|
height: 18.r,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0xFFFF6969),
|
color: const Color(0xFFFF6969),
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(Radius.circular(9.r)),
|
||||||
Radius.circular(9.r)),
|
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
value!,
|
value!,
|
||||||
style: TextStyle(fontSize: 10.sp,
|
style: TextStyle(fontSize: 10.sp, color: Colors.white, fontWeight: FontWeight.w600),
|
||||||
color: Colors.white,
|
),
|
||||||
fontWeight: FontWeight.w600),),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -252,10 +228,7 @@ class EntranceModel extends Object {
|
||||||
String navigationUrl;
|
String navigationUrl;
|
||||||
String? page;
|
String? page;
|
||||||
|
|
||||||
EntranceModel({required this.title,
|
EntranceModel({required this.title, required this.image, required this.navigationUrl, this.page});
|
||||||
required this.image,
|
|
||||||
required this.navigationUrl,
|
|
||||||
this.page});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@swidget
|
@swidget
|
||||||
|
|
@ -264,8 +237,7 @@ Widget $termRow(BuildContext context, List<EntranceModel> items, int? data) {
|
||||||
Widget childWidget;
|
Widget childWidget;
|
||||||
switch (leng) {
|
switch (leng) {
|
||||||
case 1:
|
case 1:
|
||||||
childWidget =
|
childWidget = Row(children: [Expanded(child: $TermItem(items[0], data!))]);
|
||||||
Row(children: [Expanded(child: $TermItem(items[0], data!))]);
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
childWidget = Row(children: [
|
childWidget = Row(children: [
|
||||||
|
|
@ -300,13 +272,11 @@ Widget $termRow(BuildContext context, List<EntranceModel> items, int? data) {
|
||||||
childWidget = Container();
|
childWidget = Container();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(padding: EdgeInsets.symmetric(horizontal: 14.w), child: childWidget);
|
||||||
padding: EdgeInsets.symmetric(horizontal: 14.w), child: childWidget);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@swidget
|
@swidget
|
||||||
Widget $termItem(BuildContext context, EntranceModel e, int data,
|
Widget $termItem(BuildContext context, EntranceModel e, int data, {double? theHeight}) {
|
||||||
{double? theHeight}) {
|
|
||||||
bool isJob = e.title == '作业批阅';
|
bool isJob = e.title == '作业批阅';
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
|
|
@ -335,14 +305,10 @@ Widget $termItem(BuildContext context, EntranceModel e, int data,
|
||||||
badgeStyle: badges.BadgeStyle(
|
badgeStyle: badges.BadgeStyle(
|
||||||
badgeColor: const Color.fromRGBO(255, 105, 105, 1),
|
badgeColor: const Color.fromRGBO(255, 105, 105, 1),
|
||||||
shape: badges.BadgeShape.square,
|
shape: badges.BadgeShape.square,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(10.r), topRight: Radius.circular(8.5.r), bottomRight: Radius.circular(8.5.r)),
|
||||||
topLeft: Radius.circular(10.r),
|
|
||||||
topRight: Radius.circular(8.5.r),
|
|
||||||
bottomRight: Radius.circular(8.5.r)),
|
|
||||||
// borderSide: BorderSide(color: Colors.white, width: 2),
|
// borderSide: BorderSide(color: Colors.white, width: 2),
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(horizontal: Utils.isPad() ? 11.w : 16.w, vertical: 2.h),
|
||||||
horizontal: Utils.isPad() ? 11.w : 16.w, vertical: 2.h),
|
|
||||||
),
|
),
|
||||||
position: badges.BadgePosition.topEnd(top: 10.r, end: 10.r),
|
position: badges.BadgePosition.topEnd(top: 10.r, end: 10.r),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
@ -363,29 +329,21 @@ Widget $termItem(BuildContext context, EntranceModel e, int data,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: isJob
|
child: isJob
|
||||||
? Column(
|
? Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(e.image,
|
Image.asset(e.image, height: 32.r, width: 32.r, fit: BoxFit.cover),
|
||||||
height: 32.r, width: 32.r, fit: BoxFit.cover),
|
SizedBox(height: 6.r),
|
||||||
SizedBox(height: 6.r),
|
quickText(e.title, size: 12.sp, color: const Color.fromRGBO(79, 79, 79, 1), fontWeight: FontWeight.w500),
|
||||||
quickText(e.title,
|
],
|
||||||
size: 12.sp,
|
)
|
||||||
color: const Color.fromRGBO(79, 79, 79, 1),
|
|
||||||
fontWeight: FontWeight.w500),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Row(
|
: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(e.image,
|
Image.asset(e.image, height: 32.r, width: 32.r, fit: BoxFit.cover),
|
||||||
height: 32.r, width: 32.r, fit: BoxFit.cover),
|
SizedBox(width: 6.r),
|
||||||
SizedBox(width: 6.r),
|
quickText(e.title, size: 12.sp, color: const Color.fromRGBO(79, 79, 79, 1), fontWeight: FontWeight.w500),
|
||||||
quickText(e.title,
|
],
|
||||||
size: 12.sp,
|
),
|
||||||
color: const Color.fromRGBO(79, 79, 79, 1),
|
|
||||||
fontWeight: FontWeight.w500),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,10 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||||
const SystemUiOverlayStyle(statusBarIconBrightness: Brightness.light));
|
statusBarIconBrightness: Brightness.light,
|
||||||
|
statusBarColor: Colors.transparent, //状态栏背景颜色
|
||||||
|
));
|
||||||
Future.delayed(Duration.zero, () => upgradeLogic.getAppUpgrade(context));
|
Future.delayed(Duration.zero, () => upgradeLogic.getAppUpgrade(context));
|
||||||
Future.delayed(Duration.zero, () => sysProtocol(context));
|
Future.delayed(Duration.zero, () => sysProtocol(context));
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
@ -40,8 +42,6 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
|
||||||
const SystemUiOverlayStyle(statusBarIconBrightness: Brightness.light));
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
behavior: HitTestBehavior.translucent,
|
behavior: HitTestBehavior.translucent,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|
@ -62,12 +62,18 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
children: [
|
children: [
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
child: Image.asset('assets/images/logo_banner.png',width: Get.width,fit: BoxFit.fill,)),
|
child: Image.asset(
|
||||||
|
'assets/images/logo_banner.png',
|
||||||
|
width: Get.width,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
)),
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 130.r,),
|
SizedBox(
|
||||||
|
height: 130.r,
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
width: 77.w,
|
width: 77.w,
|
||||||
height: 77.w,
|
height: 77.w,
|
||||||
|
|
@ -75,17 +81,15 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 77.w,
|
height: 77.w,
|
||||||
width: 77.w,
|
width: 77.w,
|
||||||
child: Image.asset('assets/images/login_logo_icon.png',
|
child: Image.asset('assets/images/login_logo_icon.png', fit: BoxFit.cover),
|
||||||
fit: BoxFit.cover),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 90.r),
|
margin: EdgeInsets.only(top: 90.r),
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(top: 50.h, bottom: 16.h, left: 40.w, right: 40.w),
|
||||||
top: 50.h, bottom: 16.h, left: 40.w, right: 40.w),
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(30.r),topRight: Radius.circular(30.r)),
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(30.r), topRight: Radius.circular(30.r)),
|
||||||
/*boxShadow: const [
|
/*boxShadow: const [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Color.fromRGBO(46, 91, 255, 0.1),
|
color: Color.fromRGBO(46, 91, 255, 0.1),
|
||||||
|
|
@ -97,13 +101,13 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
),
|
),
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 15.w,),
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 15.w,
|
||||||
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
border: Border.all(
|
border: Border.all(width: 1.w, color: const Color(0xFF434343)),
|
||||||
width: 1.w, color: const Color(0xFF434343)),
|
borderRadius: BorderRadius.all(Radius.circular(17.w)),
|
||||||
borderRadius:
|
|
||||||
BorderRadius.all(Radius.circular(17.w)),
|
|
||||||
),
|
),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: state.userNameController,
|
controller: state.userNameController,
|
||||||
|
|
@ -127,7 +131,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
// labelText: "账号",
|
// labelText: "账号",
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
fontSize: 14.sp,
|
fontSize: 14.sp,
|
||||||
color: const Color(0xFF434343),
|
color: const Color(0xFF434343),
|
||||||
),
|
),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
isDense: true,
|
isDense: true,
|
||||||
|
|
@ -154,10 +158,8 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
padding: EdgeInsets.symmetric(horizontal: 15.w),
|
padding: EdgeInsets.symmetric(horizontal: 15.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
border: Border.all(
|
border: Border.all(width: 1.w, color: const Color(0xFF434343)),
|
||||||
width: 1.w, color: const Color(0xFF434343)),
|
borderRadius: BorderRadius.all(Radius.circular(17.w)),
|
||||||
borderRadius:
|
|
||||||
BorderRadius.all(Radius.circular(17.w)),
|
|
||||||
),
|
),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
focusNode: state.pwdFocus,
|
focusNode: state.pwdFocus,
|
||||||
|
|
@ -169,7 +171,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
// textInputAction: state.isShowPwd.value?TextInputAction.go:TextInputAction.next,
|
// textInputAction: state.isShowPwd.value?TextInputAction.go:TextInputAction.next,
|
||||||
// onSubmitted: (val) => toLogin(),
|
// onSubmitted: (val) => toLogin(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: const Color(0xFF434343),
|
color: const Color(0xFF434343),
|
||||||
fontSize: 14.sp,
|
fontSize: 14.sp,
|
||||||
),
|
),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
|
@ -192,15 +194,12 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
),
|
),
|
||||||
suffixIcon: InkWell(
|
suffixIcon: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
state.isShowPwd.value =
|
state.isShowPwd.value = !state.isShowPwd.value;
|
||||||
!state.isShowPwd.value;
|
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(right: 5.r),
|
padding: EdgeInsets.only(right: 5.r),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
state.isShowPwd.value
|
state.isShowPwd.value ? 'assets/images/eye_default.png' : 'assets/images/eye_active.png',
|
||||||
? 'assets/images/eye_default.png'
|
|
||||||
: 'assets/images/eye_active.png',
|
|
||||||
width: 15.r,
|
width: 15.r,
|
||||||
height: 15.r,
|
height: 15.r,
|
||||||
),
|
),
|
||||||
|
|
@ -208,7 +207,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
),
|
),
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
fontSize: 14.sp,
|
fontSize: 14.sp,
|
||||||
color: const Color(0xFF434343),
|
color: const Color(0xFF434343),
|
||||||
),
|
),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
// labelText: "密码",
|
// labelText: "密码",
|
||||||
|
|
@ -236,34 +235,23 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
child: Checkbox(
|
child: Checkbox(
|
||||||
// activeColor: Colors.transparent, //去掉勾选时背景颜色
|
// activeColor: Colors.transparent, //去掉勾选时背景颜色
|
||||||
|
|
||||||
activeColor:
|
activeColor: Theme.of(context).primaryColor,
|
||||||
Theme.of(context).primaryColor,
|
|
||||||
// checkColor: Colors.white,
|
// checkColor: Colors.white,
|
||||||
value: state.keepPwd.value,
|
value: state.keepPwd.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
// Get.focusScope?.nextFocus();
|
// Get.focusScope?.nextFocus();
|
||||||
FocusScope.of(context)
|
FocusScope.of(context).requestFocus(state.pwdFocus);
|
||||||
.requestFocus(state.pwdFocus);
|
FocusScope.of(context).requestFocus(state.theFocus);
|
||||||
FocusScope.of(context)
|
state.keepPwd.value = value ?? false;
|
||||||
.requestFocus(state.theFocus);
|
|
||||||
state.keepPwd.value =
|
|
||||||
value ?? false;
|
|
||||||
},
|
},
|
||||||
side: WidgetStateBorderSide
|
side: WidgetStateBorderSide.resolveWith(
|
||||||
.resolveWith(
|
|
||||||
(Set<WidgetState> states) {
|
(Set<WidgetState> states) {
|
||||||
if (states.contains(
|
if (states.contains(WidgetState.selected)) {
|
||||||
WidgetState.selected)) {
|
|
||||||
//修改勾选时边框颜色为红色
|
//修改勾选时边框颜色为红色
|
||||||
return BorderSide(
|
return BorderSide(width: 1.5.r, color: Theme.of(context).primaryColor);
|
||||||
width: 1.5.r,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.primaryColor);
|
|
||||||
}
|
}
|
||||||
//修改默认时边框颜色为绿色
|
//修改默认时边框颜色为绿色
|
||||||
return BorderSide(
|
return BorderSide(width: 1.r, color: const Color(0xFF434343));
|
||||||
width: 1.r,
|
|
||||||
color: const Color(0xFF434343));
|
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
|
|
@ -274,18 +262,15 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
Utils.hideKeyboard();
|
Utils.hideKeyboard();
|
||||||
Get.focusScope?.nextFocus();
|
Get.focusScope?.nextFocus();
|
||||||
Get.focusScope?.nextFocus();
|
Get.focusScope?.nextFocus();
|
||||||
FocusScope.of(context)
|
FocusScope.of(context).requestFocus(state.pwdFocus);
|
||||||
.requestFocus(state.pwdFocus);
|
FocusScope.of(context).requestFocus(state.theFocus);
|
||||||
FocusScope.of(context)
|
state.keepPwd.value = !state.keepPwd.value;
|
||||||
.requestFocus(state.theFocus);
|
|
||||||
state.keepPwd.value =
|
|
||||||
!state.keepPwd.value;
|
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'记住密码',
|
'记住密码',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12.sp,
|
fontSize: 12.sp,
|
||||||
color:const Color(0xFF434343),
|
color: const Color(0xFF434343),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -307,9 +292,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.symmetric(vertical: 10.h),
|
margin: EdgeInsets.symmetric(vertical: 10.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: state.canLogin.value
|
color: state.canLogin.value ? const Color(0xFF8C68FF) : const Color(0xFFdddddd),
|
||||||
? const Color(0xFF8C68FF)
|
|
||||||
: const Color(0xFFdddddd),
|
|
||||||
/*boxShadow: [
|
/*boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color:
|
color:
|
||||||
|
|
@ -326,9 +309,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: Text('登 录',
|
child: Text('登 录', style: TextStyle(fontSize: 16.sp, color: Colors.white)),
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16.sp, color: Colors.white)),
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
@ -350,22 +331,16 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
state.pwdFocus);
|
state.pwdFocus);
|
||||||
FocusScope.of(context).requestFocus(
|
FocusScope.of(context).requestFocus(
|
||||||
state.theFocus);*/
|
state.theFocus);*/
|
||||||
state.readAgreement.value =
|
state.readAgreement.value = value ?? false;
|
||||||
value ?? false;
|
|
||||||
},
|
},
|
||||||
side: WidgetStateBorderSide.resolveWith(
|
side: WidgetStateBorderSide.resolveWith(
|
||||||
(Set<WidgetState> states) {
|
(Set<WidgetState> states) {
|
||||||
if (states
|
if (states.contains(WidgetState.selected)) {
|
||||||
.contains(WidgetState.selected)) {
|
|
||||||
//修改勾选时边框颜色为红色
|
//修改勾选时边框颜色为红色
|
||||||
return BorderSide(
|
return BorderSide(width: 1.5.r, color: Theme.of(context).primaryColor);
|
||||||
width: 1.5.r,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.primaryColor);
|
|
||||||
}
|
}
|
||||||
//修改默认时边框颜色为绿色
|
//修改默认时边框颜色为绿色
|
||||||
return BorderSide(
|
return BorderSide(width: 1.r, color: const Color(0xFF434343));
|
||||||
width: 1.r, color: const Color(0xFF434343));
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -374,9 +349,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(Routes.agreementPage, arguments: {
|
Get.toNamed(Routes.agreementPage, arguments: {"type": AGREEMENT_KEY.USER_AGREEMENT.name});
|
||||||
"type": AGREEMENT_KEY.USER_AGREEMENT.name
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
child: quickText(
|
child: quickText(
|
||||||
'请仔细阅读',
|
'请仔细阅读',
|
||||||
|
|
@ -385,15 +358,11 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(Routes.agreementPage, arguments: {
|
Get.toNamed(Routes.agreementPage, arguments: {"type": AGREEMENT_KEY.USER_AGREEMENT.name});
|
||||||
"type": AGREEMENT_KEY.USER_AGREEMENT.name
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'《用户协议》',
|
'《用户协议》',
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 12.r, color: Theme.of(context).primaryColor),
|
||||||
fontSize: 12.r,
|
|
||||||
color: Theme.of(context).primaryColor),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,6 @@ class _WorkPageState extends State<WorkPage> with AutomaticKeepAliveClientMixin
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
|
|
||||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
|
||||||
statusBarIconBrightness: Brightness.dark,
|
|
||||||
systemStatusBarContrastEnforced: false,
|
|
||||||
));
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: const Color.fromRGBO(244, 244, 244, 1),
|
backgroundColor: const Color.fromRGBO(244, 244, 244, 1),
|
||||||
body: OrientationBuilder(
|
body: OrientationBuilder(
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import Foundation
|
||||||
|
|
||||||
import auto_updater_macos
|
import auto_updater_macos
|
||||||
import connectivity_plus
|
import connectivity_plus
|
||||||
|
import device_info_plus
|
||||||
import package_info_plus
|
import package_info_plus
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
import sqflite
|
import sqflite
|
||||||
|
|
@ -15,6 +16,7 @@ import url_launcher_macos
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
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"))
|
||||||
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,8 @@ dependencies:
|
||||||
flutter_native_splash: ^2.4.1
|
flutter_native_splash: ^2.4.1
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,20 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -190,7 +204,7 @@
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
background-color: #eeeeee;
|
background-color: #FFFFFF;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||