修改项目中未国际化的中文

This commit is contained in:
魏少阳 2024-08-19 15:24:14 +08:00
parent 8f25e1bf04
commit 813a09abc0
50 changed files with 4565 additions and 4583 deletions

View File

@ -135,9 +135,6 @@
"附近的设备": "Nearby Equipment",
"暂无数据": "No Data",
"通过门磁可查询门的开、关状态。每把锁咳添加一个门磁": "You can query the open and close status of a door by using the door status sensor. Add a door magnet to each lock",
"delayTime": "Delay Time",
"automaticBlockingTip": "After the time set above, the lock will automatically close. After you enable or modify the Settings, open the lock once for the time to take effect.",
"normallyOpen": "Normally Open",
"开始": "Start",
"全天": "All Day",
@ -257,13 +254,13 @@
"如需修改名字请重新命名,点击确定添加锁": "If you want to change the name, please rename, click OK to add lock",
"添加锁时,手机必须在锁旁边": "When adding a lock, the phone must be next to the lock",
"登录": "Login",
"注册": "注册",
"注册": "Register",
"我已阅读并同意": "I Have Read And Agree",
"验证码": "验证码",
"验证码": "Verification Code",
"密码必须是8-20位至少包括数字/字母/符号中的2种": "The password must be 8-20 characters, including at least 2 of the numbers/letters/symbols",
"手机": "Iphone",
"邮箱": "Email",
"请输入邮箱": "请输入邮箱",
"请输入邮箱": "Please enter your email",
"国家/地区": "Country/Region",
"你所在的国家/地区": "The country/region you are in",
"选择国家/地区": "Select Country/Region",
@ -528,7 +525,6 @@
"删除锁后,所有信息都会一起删除,确定删除锁吗?": "After deleting the lock, all information will be deleted together, are you sure you want to delete the lock?",
"请输入登录密码": "Please enter the login password",
"删除设备失败,请确保在设备附近,设备未被连接,设备已打开": "Failed to delete the device, please make sure that the device is near the device, the device is not connected, and the device is turned on",
"。如果是全自动锁,请使屏幕变亮": ". If it is a fully automatic lock, please make the screen brighter",
"用户无权限": "User has no permission",
"创建公司后,考勤功能才能使用": "After creating the company, the attendance function can be used",
"是否删除钥匙?": "Whether to delete the key?",
@ -832,5 +828,38 @@
"蓝牙未打开,请到设置里面打开蓝牙": "Bluetooth is not turned on, please turn on Bluetooth in the settings",
"删除用户时,会将用户拥有的钥匙一起删除。": "When deleting a user, the keys owned by the user will be deleted together.",
"配置网络": "Configure network"
"配置网络": "Configure network",
"你好": "Hello",
"成功": "Success",
"类型选择": "Type selection",
"请选择要使用哪种类型": "Please select which type to use",
"系统邮件(推荐)": "System email (recommended)",
"系统短信(推荐)": "System SMS (recommended)",
"邮件将从软件平台直接发给用户,请根据需要在软件里购买邮件数量。": "Emails will be sent directly to users from the software platform. Please purchase the number of emails in the software according to your needs.",
"短信将从软件平台直接发给用户,请根据需要在软件里购买短信数量。": "SMS will be sent directly to users from the software platform. Please purchase the number of SMS in the software according to your needs.",
"个人邮件": "Personal email",
"个人短信": "Personal SMS",
"邮件将从你的个人邮箱发给用户": "Emails will be sent to users from your personal mailbox",
"短信将从你的个人手机号发给用户,费用由运营商从你的手机号扣除": "SMS will be sent to users from your personal mobile phone number, and the cost will be deducted from your mobile phone number by the operator",
"为了更好地应用体验,请确定权限": "For a better application experience, please confirm the permissions",
"您第一次拒绝权限,请确定权限": "You refused permission for the first time, please confirm the permission",
"您第二次拒绝权限,请去应用设置开启权限": "You refused permission for the second time, please go to the application settings to enable permission",
"去应用市场": "Go to the app store",
"温馨提示": "Warm prompt",
"关闭应用": "Close the application",
"开启微信接收报警消息需要先关注": "To open WeChat to receive alarm messages, you need to follow",
"微信公众号,请保存二维码并使用微信扫一扫设置": "WeChat public account, save the QR code and use WeChat to scan the settings",
"实名认证为付费功能,请联系锁的管理员购买后再使用": "Real-name authentication is a paid function, please contact the lock administrator to purchase and use",
"位置权限": "Location permission",
"请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作": "Please turn on location permission. The application needs location permission to complete the Bluetooth operation of smart locks and gateways",
"相机/相册权限": "Camera/Album permission",
"请开启本地存储权限,允许应用读写设备上的照片及文件": "Please turn on local storage permission, allow the application to read and write photos and files on the device",
"点击选择": "Click to select",
"微信": "WeChat",
"朋友圈": "Moments",
"QQ": "QQ",
"QQ空间": "QQZone",
"微博": "Weibo",
"FaceBook": "FaceBook",
"链接": "Link"
}

View File

@ -543,7 +543,6 @@
"删除锁后,所有信息都会一起删除,确定删除锁吗?": "删除锁后,所有信息都会一起删除,确定删除锁吗?",
"请输入登录密码": "请输入登录密码",
"删除设备失败,请确保在设备附近,设备未被连接,设备已打开": "删除设备失败,请确保在设备附近,设备未被连接,设备已打开",
"。如果是全自动锁,请使屏幕变亮": "。如果是全自动锁,请使屏幕变亮",
"用户无权限": "用户无权限",
"创建公司后,考勤功能才能使用": "创建公司后,考勤功能才能使用",
"是否删除钥匙?": "是否删除钥匙?",
@ -861,5 +860,38 @@
"蓝牙未打开,请到设置里面打开蓝牙": "蓝牙未打开,请到设置里面打开蓝牙",
"删除用户时,会将用户拥有的钥匙一起删除。": "删除用户时,会将用户拥有的钥匙一起删除。",
"配置网络": "配置网络"
"配置网络": "配置网络",
"你好": "你好",
"成功": "成功",
"类型选择": "类型选择",
"请选择要使用哪种类型": "请选择要使用哪种类型",
"系统邮件(推荐)": "系统邮件(推荐)",
"系统短信(推荐)": "系统短信(推荐)",
"邮件将从软件平台直接发给用户,请根据需要在软件里购买邮件数量。": "邮件将从软件平台直接发给用户,请根据需要在软件里购买邮件数量。",
"短信将从软件平台直接发给用户,请根据需要在软件里购买短信数量。": "短信将从软件平台直接发给用户,请根据需要在软件里购买短信数量。",
"个人邮件": "个人邮件",
"个人短信": "个人短信",
"邮件将从你的个人邮箱发给用户": "邮件将从你的个人邮箱发给用户",
"短信将从你的个人手机号发给用户,费用由运营商从你的手机号扣除": "短信将从你的个人手机号发给用户,费用由运营商从你的手机号扣除",
"为了更好地应用体验,请确定权限": "为了更好地应用体验,请确定权限",
"您第一次拒绝权限,请确定权限": "您第一次拒绝权限,请确定权限",
"您第二次拒绝权限,请去应用设置开启权限": "您第二次拒绝权限,请去应用设置开启权限",
"去应用市场": "去应用市场",
"温馨提示": "温馨提示",
"关闭应用": "关闭应用",
"开启微信接收报警消息需要先关注": "开启微信接收报警消息需要先关注",
"微信公众号,请保存二维码并使用微信扫一扫设置": "微信公众号,请保存二维码并使用微信扫一扫设置",
"实名认证为付费功能,请联系锁的管理员购买后再使用": "实名认证为付费功能,请联系锁的管理员购买后再使用",
"位置权限": "位置权限",
"请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作": "请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作",
"相机/相册权限": "相机/相册权限",
"请开启本地存储权限,允许应用读写设备上的照片及文件": "请开启本地存储权限,允许应用读写设备上的照片及文件",
"点击选择": "点击选择",
"微信": "微信",
"朋友圈": "朋友圈",
"QQ": "QQ",
"QQ空间": "QQ空间",
"微博": "微博",
"FaceBook": "FaceBook",
"链接": "链接"
}

View File

@ -524,7 +524,6 @@
"删除锁后,所有信息都会一起删除,确定删除锁吗?": "删除锁后,所有信息都会一起删除,确定删除锁吗?",
"请输入登录密码": "请输入登录密码",
"删除设备失败,请确保在设备附近,设备未被连接,设备已打开": "删除设备失败,请确保在设备附近,设备未被连接,设备已打开",
"。如果是全自动锁,请使屏幕变亮": "。如果是全自动锁,请使屏幕变亮",
"用户无权限": "用户无权限",
"创建公司后,考勤功能才能使用": "创建公司后,考勤功能才能使用",
"是否删除钥匙?": "是否删除钥匙?",
@ -827,5 +826,38 @@
"蓝牙未打开,请到设置里面打开蓝牙": "蓝牙未打开,请到设置里面打开蓝牙",
"删除用户时,会将用户拥有的钥匙一起删除。": "删除用户时,会将用户拥有的钥匙一起删除。",
"配置网络": "配置网络"
"配置网络": "配置网络",
"你好": "你好",
"成功": "成功",
"类型选择": "类型选择",
"请选择要使用哪种类型": "请选择要使用哪种类型",
"系统邮件(推荐)": "系统邮件(推荐)",
"系统短信(推荐)": "系统短信(推荐)",
"邮件将从软件平台直接发给用户,请根据需要在软件里购买邮件数量。": "邮件将从软件平台直接发给用户,请根据需要在软件里购买邮件数量。",
"短信将从软件平台直接发给用户,请根据需要在软件里购买短信数量。": "短信将从软件平台直接发给用户,请根据需要在软件里购买短信数量。",
"个人邮件": "个人邮件",
"个人短信": "个人短信",
"邮件将从你的个人邮箱发给用户": "邮件将从你的个人邮箱发给用户",
"短信将从你的个人手机号发给用户,费用由运营商从你的手机号扣除": "短信将从你的个人手机号发给用户,费用由运营商从你的手机号扣除",
"为了更好地应用体验,请确定权限": "为了更好地应用体验,请确定权限",
"您第一次拒绝权限,请确定权限": "您第一次拒绝权限,请确定权限",
"您第二次拒绝权限,请去应用设置开启权限": "您第二次拒绝权限,请去应用设置开启权限",
"去应用市场": "去应用市场",
"温馨提示": "温馨提示",
"关闭应用": "关闭应用",
"开启微信接收报警消息需要先关注": "开启微信接收报警消息需要先关注",
"微信公众号,请保存二维码并使用微信扫一扫设置": "微信公众号,请保存二维码并使用微信扫一扫设置",
"实名认证为付费功能,请联系锁的管理员购买后再使用": "实名认证为付费功能,请联系锁的管理员购买后再使用",
"位置权限": "位置权限",
"请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作": "请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作",
"相机/相册权限": "相机/相册权限",
"请开启本地存储权限,允许应用读写设备上的照片及文件": "请开启本地存储权限,允许应用读写设备上的照片及文件",
"点击选择": "点击选择",
"微信": "微信",
"朋友圈": "朋友圈",
"QQ": "QQ",
"QQ空间": "QQ空间",
"微博": "微博",
"FaceBook": "FaceBook",
"链接": "链接"
}

View File

@ -37,7 +37,7 @@ FutureOr<void> main() async {
if (isLogin) {
await privacySDKInitialization();
Future<void>.delayed(const Duration(milliseconds: 500), () async {
AppLog.log('main函数调用了获取App信息接口');
// AppLog.log('main函数调用了获取App信息接口');
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
if (entity.data?.appSiteUrl != null) {

View File

@ -524,7 +524,7 @@ class LockSetLogic extends BaseGetXController {
void showDeletAlertTipDialog({String? showContent = ''}) {
final String content = showContent!.isEmpty
? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName!.contains("T9A") == true ? "如果是全自动锁,请使屏幕变亮".tr : ""}"
? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName!.contains("T9A") == true ? "如果是全自动锁,请使屏幕变亮".tr : ""}"
: showContent;
state.showTipView.showSureAlertDialog(content);
}

View File

@ -298,7 +298,7 @@ class LockListLogic extends BaseGetXController {
void showDeletAlertTipDialog({String? showContent = ''}) {
// bool isContains = BlueManage().connectDeviceName!.contains("T9A");
final String content = showContent!.isEmpty
? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName.contains("T9A") == true ? "如果是全自动锁,请使屏幕变亮".tr : ""}"
? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName.contains("T9A") == true ? "如果是全自动锁,请使屏幕变亮".tr : ""}"
: showContent;
showCupertinoDialog(
context: Get.context!,

View File

@ -5,6 +5,6 @@ import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.dev;
AppLog.log('dev调用了main函数');
// AppLog.log('dev调用了main函数');
await runner.main();
}

View File

@ -5,6 +5,6 @@ import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.local;
AppLog.log('local调用了main函数');
// AppLog.log('local调用了main函数');
await runner.main();
}

View File

@ -5,6 +5,6 @@ import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.pre;
AppLog.log('pre调用了main函数');
// AppLog.log('pre调用了main函数');
await runner.main();
}

View File

@ -5,6 +5,6 @@ import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.sky;
AppLog.log('sky_full调用了main函数');
// AppLog.log('sky_full调用了main函数');
await runner.main();
}

View File

@ -6,6 +6,6 @@ import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.sky;
F.isLite = true;
AppLog.log('sky_lite调用了main函数');
// AppLog.log('sky_lite调用了main函数');
await runner.main();
}

View File

@ -5,6 +5,6 @@ import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.xhj;
AppLog.log('xhj_full调用了main函数');
// AppLog.log('xhj_full调用了main函数');
await runner.main();
}

View File

@ -6,6 +6,6 @@ import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.xhj;
F.isLite = true;
AppLog.log('xhj_lite调用了main函数');
// AppLog.log('xhj_lite调用了main函数');
await runner.main();
}

View File

@ -7,11 +7,7 @@ import 'package:flutter/material.dart';
// CSDN https://blog.csdn.net/qq_42351033
// ------------------------------------------------------
class CustomUnderlineTabIndicator extends Decoration {
final BorderSide? borderSide;
final EdgeInsetsGeometry? insets;
final StrokeCap? strokeCap; //
final double? width; //
class CustomUnderlineTabIndicator extends Decoration { //
const CustomUnderlineTabIndicator({
this.borderSide = const BorderSide(width: 2, color: Colors.white),
@ -20,6 +16,10 @@ class CustomUnderlineTabIndicator extends Decoration {
this.width: 20,
}) : assert(borderSide != null),
assert(insets != null);
final BorderSide? borderSide;
final EdgeInsetsGeometry? insets;
final StrokeCap? strokeCap; //
final double? width;
@override
Decoration? lerpFrom(Decoration? a, double t) {

View File

@ -1,9 +1,9 @@
import 'dart:core';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
class ExpandedListTile extends StatefulWidget {

View File

@ -39,14 +39,13 @@ class NativeInteractionTool {
///
void receiveChannelBlueIsOnEvent(BlockBlueStatus blockBlueStatus) {
receiveChannel.setMethodCallHandler((MethodCall call) async {
AppLog.log(
'收到原生发送的信息call.method: ${call.method} call.arguments:${call.arguments}');
// AppLog.log('收到原生发送的信息call.method: ${call.method} call.arguments:${call.arguments}');
switch (call.method) {
case 'getBlueStatus':
// /
final String message = call.arguments;
blockBlueStatus(message);
AppLog.log('收到原生发送的信息getBlueStatus: $message');
// AppLog.log('收到原生发送的信息getBlueStatus: $message');
break;
default:
throw MissingPluginException();

View File

@ -70,7 +70,7 @@ class AppFirstEnterHandle {
}
Future<void> getAppInfo() async {
AppLog.log('AppFirstEnterHandle调用了获取App信息接口');
// AppLog.log('AppFirstEnterHandle调用了获取App信息接口');
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
WxPayTool.setAssociationUrl(entity.data!.appSiteUrl!);
@ -94,8 +94,8 @@ class AppFirstEnterHandle {
//
Get.toNamed(Routers.webviewShowPage,
arguments: <String, String>{
"url": XSConstantMacro.userAgreementURL,
"title": '用户协议'.tr
'url': XSConstantMacro.userAgreementURL,
'title': '用户协议'.tr
});
},
),
@ -109,13 +109,13 @@ class AppFirstEnterHandle {
//
Get.toNamed(Routers.webviewShowPage,
arguments: <String, String>{
"url": XSConstantMacro.privacyPolicyURL,
"title": '隐私政策'.tr
'url': XSConstantMacro.privacyPolicyURL,
'title': '隐私政策'.tr
});
},
),
TextSpan(
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'.tr
.tr),
],
),
@ -124,14 +124,14 @@ class AppFirstEnterHandle {
CupertinoDialogAction(
child: Text(
'不同意'.tr,
style: TextStyle(color: Colors.black),
style: const TextStyle(color: Colors.black),
),
onPressed: _exitApp,
),
CupertinoDialogAction(
child: Text(
'同意'.tr,
style: TextStyle(color: Colors.blue),
style: const TextStyle(color: Colors.blue),
),
onPressed: () {
Storage.setString(isAgreePrivacy, isAgreePrivacy);
@ -163,8 +163,8 @@ class AppFirstEnterHandle {
//
Get.toNamed(Routers.webviewShowPage,
arguments: <String, String>{
"url": XSConstantMacro.userAgreementURL,
"title": '用户协议'.tr
'url': XSConstantMacro.userAgreementURL,
'title': '用户协议'.tr
});
},
),
@ -179,13 +179,13 @@ class AppFirstEnterHandle {
//
Get.toNamed(Routers.webviewShowPage,
arguments: <String, String>{
"url": XSConstantMacro.privacyPolicyURL,
"title": '隐私政策'.tr
'url': XSConstantMacro.privacyPolicyURL,
'title': '隐私政策'.tr
});
},
),
TextSpan(
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'.tr
.tr),
],
),
@ -194,7 +194,7 @@ class AppFirstEnterHandle {
CupertinoDialogAction(
child: Text(
'不同意'.tr,
style: TextStyle(color: Colors.black),
style: const TextStyle(color: Colors.black),
),
onPressed: _exitApp,
),
@ -221,8 +221,8 @@ class AppFirstEnterHandle {
return PopScope(
canPop: false,
child: CupertinoAlertDialog(
title: const Text('位置权限'),
content: const Text('请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作'),
title: Text('位置权限'.tr),
content: Text('请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作'.tr),
actions: <Widget>[
CupertinoDialogAction(
child: Text('取消'.tr),
@ -251,17 +251,17 @@ class AppFirstEnterHandle {
return PopScope(
canPop: false,
child: CupertinoAlertDialog(
title: const Text('相机/相册权限'),
content: const Text('请开启本地存储权限,允许应用读写设备上的照片及文件'),
title: Text('相机/相册权限'.tr),
content: Text('请开启本地存储权限,允许应用读写设备上的照片及文件'.tr),
actions: <Widget>[
CupertinoDialogAction(
child: const Text('取消'),
child: Text('取消'.tr),
onPressed: () {
Navigator.of(context).pop();
},
),
CupertinoDialogAction(
child: const Text('确定'),
child: Text('确定'.tr),
onPressed: () {
Storage.setString(isAgreeCamera, isAgreeCamera);
Navigator.of(context).pop();

View File

@ -2,20 +2,20 @@
import 'package:flutter/material.dart';
class AppRouteObserver {
factory AppRouteObserver() {
return _appRouteObserver;
}
AppRouteObserver._internal() {}
//
static final RouteObserver<ModalRoute<void>> _routeObserver =
RouteObserver<ModalRoute<void>>();
//
static final AppRouteObserver _appRouteObserver =
AppRouteObserver._internal();
AppRouteObserver._internal() {}
//get方法轻松获取路由监听器
RouteObserver<ModalRoute<void>> get routeObserver {
return _routeObserver;
}
factory AppRouteObserver() {
return _appRouteObserver;
}
}

View File

@ -21,8 +21,8 @@ class BaseGetXController extends GetxController {
int currentTimeSeconds = 0;
bool currentPage = true;
var pageNo = 1;
var pageSize = '20';
int pageNo = 1;
String pageSize = '20';
@override
void onReady() {
@ -31,22 +31,18 @@ class BaseGetXController extends GetxController {
}
@override
// TODO: implement onDelete
InternalFinalCallback<void> get onDelete => super.onDelete;
@override
// TODO: implement onStart
InternalFinalCallback<void> get onStart => super.onStart;
@override
void onInit() {
// TODO: implement onInit
super.onInit();
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
currentPage = false;
}
@ -76,7 +72,7 @@ class BaseGetXController extends GetxController {
_timer!.cancel();
_timer = null;
}
_timer = Timer.periodic(outTimer.seconds, (timer) {
_timer = Timer.periodic(outTimer.seconds, (Timer timer) {
if (action != null) {
action();
}
@ -98,7 +94,7 @@ class BaseGetXController extends GetxController {
void showBlueConnetctToast() {
bool isContains = BlueManage().connectDeviceName.contains('T9A');
showToast(
"${'操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。'.tr}${isContains == true ? "如果是全自动锁,请使屏幕变亮" : ""}");
"${'操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。'.tr}${isContains == true ? "如果是全自动锁,请使屏幕变亮".tr : ""}");
}
void showToast(String status,
@ -126,36 +122,36 @@ class BaseGetXController extends GetxController {
}
void showOperationSuccessful({String? status, Function? something}) =>
showSuccess(status ?? '成功', something: something);
showSuccess(status ?? '成功'.tr, something: something);
void showOperationFailed({String? status, Function? something}) =>
showError(status ?? '失败', something: something);
showError(status ?? '失败'.tr, something: something);
void logOff() async {
await ClientManager().logOff();
Get.offAllNamed(Routers.starLockLoginPage);
}
void checkBlueIsOpen(void Function() action) {
NativeInteractionTool().sendGetBlueStatus();
NativeInteractionTool().receiveChannelBlueIsOnEvent((String status) {
if (status == '1') {
//
AppLog.log('蓝牙已打开');
action();
} else if (status == '0') {
//
AppLog.log('蓝牙未打开');
showIosTipViewDialog();
return;
} else {
//
AppLog.log('设备不支持蓝牙');
showToast('设备不支持蓝牙');
return;
}
});
}
// void checkBlueIsOpen(void Function() action) {
// NativeInteractionTool().sendGetBlueStatus();
// NativeInteractionTool().receiveChannelBlueIsOnEvent((String status) {
// if (status == '1') {
// //
// // AppLog.log('蓝牙已打开');
// action();
// } else if (status == '0') {
// //
// // AppLog.log('蓝牙未打开');
// showIosTipViewDialog();
// return;
// } else {
// //
// // AppLog.log('设备不支持蓝牙');
// showToast('设备不支持蓝牙');
// return;
// }
// });
// }
void showIosTipViewDialog() {
showDialog(

View File

@ -7,21 +7,17 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
* */
class CustomNetworkImage extends StatelessWidget {
const CustomNetworkImage(
{required this.url, required this.defaultUrl, required this.width, required this.height, Key? key,
this.boxFit = BoxFit.cover})
: super(key: key);
final String url;
final String defaultUrl;
final double width;
final double height;
final BoxFit boxFit;
const CustomNetworkImage(
{Key? key,
required this.url,
required this.defaultUrl,
required this.width,
required this.height,
this.boxFit = BoxFit.cover})
: super(key: key);
@override
Widget build(BuildContext context) {
return url.isNotEmpty
@ -30,7 +26,7 @@ class CustomNetworkImage extends StatelessWidget {
height: height,
fit: boxFit,
imageUrl: url,
imageBuilder: (context, imageProvider) => Container(
imageBuilder: (BuildContext context, ImageProvider<Object> imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
@ -39,7 +35,7 @@ class CustomNetworkImage extends StatelessWidget {
Colors.transparent, BlendMode.colorBurn)),
),
),
errorWidget: (context, url, error) => Image.asset(
errorWidget: (BuildContext context, String url, Object error) => Image.asset(
defaultUrl,
width: width,
height: height,

View File

@ -3,8 +3,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import '../translations/trans_lib.dart';
class AlertBottomWidget extends StatelessWidget {
AlertBottomWidget(

View File

@ -19,7 +19,6 @@ class DeviceInfoService extends GetxService {
String dId = "";
if(dId.isNotEmpty){
dId = const Uuid().v1();
AppLog.log('初始化设备ID:$dId');
// StoreService.to.saveDeviceId(dId);
}
_deviceID = dId;

View File

@ -22,7 +22,7 @@ class EmailNotifyTypeSelectAlert extends StatelessWidget {
return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return CupertinoAlertDialog(
title: const Text('类型选择'),
title: Text('类型选择'.tr),
content: Column(
children: <Widget>[
Padding(
@ -31,7 +31,7 @@ class EmailNotifyTypeSelectAlert extends StatelessWidget {
child: Align(
alignment: Alignment.centerLeft,
child:
Text('请选择要使用哪种类型', style: TextStyle(fontSize: 20.sp)),
Text('请选择要使用哪种类型'.tr, style: TextStyle(fontSize: 20.sp)),
),
),
GestureDetector(
@ -54,7 +54,7 @@ class EmailNotifyTypeSelectAlert extends StatelessWidget {
Padding(
padding: EdgeInsets.only(left: 10.w),
child: Text(
isEmail ? '系统邮件(推荐)' : '系统短信(推荐)',
isEmail ? '系统邮件(推荐)'.tr : '系统短信(推荐)'.tr,
style: TextStyle(
fontSize: 22.sp, fontWeight: FontWeight.bold),
),
@ -68,8 +68,8 @@ class EmailNotifyTypeSelectAlert extends StatelessWidget {
alignment: Alignment.centerLeft,
child: Text(
isEmail
? '邮件将从软件平台直接发给用户,请根据需要在软件里购买邮件数量。'
: '短信将从软件平台直接发给用户,请根据需要在软件里购买短信数量。',
? '邮件将从软件平台直接发给用户,请根据需要在软件里购买邮件数量。'.tr
: '短信将从软件平台直接发给用户,请根据需要在软件里购买短信数量。'.tr,
style: TextStyle(fontSize: 18.sp),
textAlign: TextAlign.left,
),
@ -95,7 +95,7 @@ class EmailNotifyTypeSelectAlert extends StatelessWidget {
Padding(
padding: EdgeInsets.only(left: 10.w),
child: Text(
isEmail ? '个人邮件' : '个人短信',
isEmail ? '个人邮件'.tr : '个人短信'.tr,
style: TextStyle(
fontSize: 22.sp, fontWeight: FontWeight.bold),
),
@ -109,8 +109,8 @@ class EmailNotifyTypeSelectAlert extends StatelessWidget {
alignment: Alignment.centerLeft,
child: Text(
isEmail
? '邮件将从你的个人邮箱发给用户'
: '短信将从你的个人手机号发给用户,费用由运营商从你的手机号扣除',
? '邮件将从你的个人邮箱发给用户'.tr
: '短信将从你的个人手机号发给用户,费用由运营商从你的手机号扣除'.tr,
style: TextStyle(fontSize: 18.sp),
textAlign: TextAlign.left,
),

View File

@ -1,11 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'screen_utils.dart';
// List _listData = [
// {'text': '读取记录'},
// {'text': '清空记录'},
// {'text': '导出记录'},
// {'text': '读取记录'.tr},
// {'text': '清空记录'.tr},
// {'text': '导出记录'.tr},
// ];
const Color _bgColor = Color(0xFF2D2D2D);
@ -14,7 +15,7 @@ const double _cellHeight = 50.0;
const double _imgWH = 22.0;
class JhPopMenus {
/// pop
// pop
static void show(
BuildContext context, {
required List<dynamic> listData,
@ -37,10 +38,10 @@ class JhPopMenus {
},
child: Row(
children: <Widget>[
SizedBox(width: 25),
const SizedBox(width: 25),
// Image.asset(dataArr[index]['icon'], width: _imgWH, height: _imgWH, color: Colors.white),
// const SizedBox(width: 15),
Text("你好",
Text('你好'.tr,
style: TextStyle(
color: Colors.white, fontSize: _fontSize.sp)),
],
@ -53,7 +54,7 @@ class JhPopMenus {
Widget menusView(dataArr) {
var cellH = dataArr.length * _cellHeight.h;
var navH = JhScreenUtils.navigationBarHeight;
double navH = JhScreenUtils.navigationBarHeight;
return Positioned(
right: 10,
top: navH - 10,
@ -78,11 +79,10 @@ class JhPopMenus {
.push(DialogRouter(_BasePopMenus(child: menusView(listData))));
}
/// 线 pop
// 线 pop
static void showLinePop(
BuildContext context, {
bool isShowBg = false,
required List<dynamic> listData,
required List<dynamic> listData, bool isShowBg = false,
Function(int selectIndex, String selectText)? clickCallback,
}) {
// 线
@ -119,17 +119,17 @@ class JhPopMenus {
),
);
},
separatorBuilder: (context, index) => Divider(
separatorBuilder: (BuildContext context, int index) => Divider(
height: .1,
indent: 20.w,
endIndent: 20.w,
color: Color(0xFFE6E6E6)),
color: const Color(0xFFE6E6E6)),
);
}
Widget menusView(dataArr) {
var cellH = dataArr.length * _cellHeight.h;
var navH = JhScreenUtils.navigationBarHeight;
final cellH = dataArr.length * _cellHeight.h;
double navH = JhScreenUtils.navigationBarHeight;
if (isShowBg == true) {
navH = navH - JhScreenUtils.topSafeHeight;
} else {
@ -159,7 +159,7 @@ class JhPopMenus {
showDialog(
context: context,
barrierDismissible: false,
builder: (context) {
builder: (BuildContext context) {
return _BasePopMenus(child: menusView(listData));
},
);
@ -171,12 +171,12 @@ class JhPopMenus {
}
class _BasePopMenus extends Dialog {
final child;
const _BasePopMenus({
Key? key,
this.child,
}) : super(key: key);
final child;
@override
Widget build(BuildContext context) {
@ -195,7 +195,6 @@ class _BasePopMenus extends Dialog {
}
class DialogRouter extends PageRouteBuilder {
final Widget page;
DialogRouter(this.page)
: super(
@ -203,21 +202,22 @@ class DialogRouter extends PageRouteBuilder {
//
barrierColor: Colors.white10.withAlpha(1),
transitionDuration: const Duration(milliseconds: 150),
pageBuilder: (context, animation, secondaryAnimation) => page,
transitionsBuilder: (context, animation, secondaryAnimation, child) =>
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) => page,
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) =>
child,
);
final Widget page;
}
class CustomDialog extends Dialog {
final bool clickBgHidden;
final child;
const CustomDialog({
Key? key,
this.child,
this.clickBgHidden = false, //
}) : super(key: key);
final bool clickBgHidden;
final child;
@override
Widget build(BuildContext context) {

View File

@ -8,17 +8,15 @@ import '../app_settings/app_colors.dart';
import '../app_settings/app_settings.dart';
class KeySearchWidget extends StatelessWidget {
KeySearchWidget(
{required this.editingController, required this.onSubmittedAction, Key? key,
this.backgroundColor})
: super(key: key);
TextEditingController editingController;
Function() onSubmittedAction;
Color? backgroundColor;
KeySearchWidget(
{Key? key,
required this.editingController,
required this.onSubmittedAction,
this.backgroundColor})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
@ -30,7 +28,7 @@ class KeySearchWidget extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 15.h, bottom: 15.h, right: 5.w, left: 10.w),
child: Image.asset(
@ -55,18 +53,18 @@ class KeySearchWidget extends StatelessWidget {
controller: editingController,
autofocus: false,
textAlign: TextAlign.start,
onChanged: (value) {
AppLog.log("onChanged:$value");
onChanged: (String value) {
AppLog.log('onChanged:$value');
},
onEditingComplete: () {
AppLog.log("onEditingComplete:");
AppLog.log('onEditingComplete:');
},
onSubmitted: (value) {
onSubmitted: (String value) {
onSubmittedAction!();
},
decoration: InputDecoration(
//
hintText:"搜索".tr,
hintText:'搜索'.tr,
hintStyle: TextStyle(fontSize: 22.sp),
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),

View File

@ -1,14 +1,15 @@
///
class DropDownItem {
DropDownItem(
{required this.itemTitle,
required this.itemValue,
required this.isCheked});
//
String itemTitle = '';
//
dynamic itemValue;
//
bool isCheked = false;
DropDownItem(
{required this.itemTitle,
required this.itemValue,
required this.isCheked});
}

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/tools/menuItem/dropDownItem.dart';
@ -7,6 +8,14 @@ import 'package:star_lock/tools/menuItem/dropDownItem.dart';
/// @2024/4/11
///
class XSDropDownWidget extends StatefulWidget {
XSDropDownWidget(
{Key? key,
required this.items,
this.value,
this.valueChanged,
this.title,
this.tooltip = '点击选择'})
: super(key: key);
//
List<DropDownItem> items = [];
//
@ -14,17 +23,9 @@ class XSDropDownWidget extends StatefulWidget {
//
final String? title;
//
final String tooltip;
String tooltip = '点击选择'.tr;
//
final ValueChanged<dynamic>? valueChanged;
XSDropDownWidget(
{Key? key,
required this.items,
this.value,
this.valueChanged,
this.title,
this.tooltip = "点击选择"})
: super(key: key);
@override
State<XSDropDownWidget> createState() => _XSDropDownWidgetState();

View File

@ -5,8 +5,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import '../translations/trans_lib.dart';
class NoData extends StatelessWidget {
double? noDataHeight;
NoData({Key? key, this.noDataHeight}) : super(key: key);

View File

@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
import '../app_settings/app_settings.dart';
@ -16,29 +17,29 @@ class PermissionUtil {
PermissionUtil(this._context);
final List<String> _list = [
"为了更好地应用体验,请确定权限",
"您第一次拒绝权限,请确定权限",
"您第二次拒绝权限,请去应用设置开启权限"
'为了更好地应用体验,请确定权限'.tr,
'您第一次拒绝权限,请确定权限'.tr,
'您第二次拒绝权限,请去应用设置开启权限'.tr
];
final BuildContext _context ;
void checkPermission({PermissionStatus? status, BlockScuessStatus? blockScuessStatus}) async {
Future<void> checkPermission({PermissionStatus? status, BlockScuessStatus? blockScuessStatus}) async {
// permission_handler: ^5.0.1+1
//
Permission permission = Permission.location;
status ??= await permission.status;
AppLog.log("statusstatusstatus:$status");
// AppLog.log('statusstatusstatus:$status');
if (status.isDenied) {
//
showPermissionDialog(_list[0], "同意", permission);
showPermissionDialog(_list[0], '同意'.tr, permission);
} else if (status.isDenied) {
//
showPermissionDialog(_list[1], "重试", permission);
showPermissionDialog(_list[1], '重试'.tr, permission);
} else if (status.isPermanentlyDenied) {
//
showPermissionDialog(_list[2], "去应用市场", permission,isUndetermined: true);
showPermissionDialog(_list[2], '去应用市场'.tr, permission,isUndetermined: true);
} else if (status.isGranted) {
//
blockScuessStatus!();
@ -61,18 +62,15 @@ class PermissionUtil {
showCupertinoDialog(
builder: (BuildContext context) {
return CupertinoAlertDialog(
title: Text("温馨提示"),
title: Text('温馨提示'.tr),
content: Container(
child: Text(msg),
),
actions: [
//
CupertinoDialogAction(
child: Text("关闭应用"),
onPressed: (){
//
closeAPP();
},
child: Text('关闭应用'.tr),
onPressed: closeAPP,
),
//
CupertinoDialogAction(
@ -111,7 +109,7 @@ class PermissionUtil {
}
//
void closeAPP() {
SystemChannels.platform.invokeMethod("SystemNavigator.pop");
SystemChannels.platform.invokeMethod('SystemNavigator.pop');
}

File diff suppressed because it is too large Load Diff

View File

@ -108,10 +108,28 @@ class _PickerContentView extends StatefulWidget {
@override
State<StatefulWidget> createState() => _PickerState(
this.data, this.selectData, this.pickerStyle, this.columeNum);
data, selectData, pickerStyle, columeNum);
}
class _PickerState extends State<_PickerContentView> {
_PickerState(
this._data, List mSelectData, this._pickerStyle, this._columeNum) {
pickerItemHeight = _pickerStyle.pickerItemHeight;
//
_selectData = [];
_selectDataPosition = [];
for (int i = 0; i < _columeNum; ++i) {
if (i >= mSelectData.length) {
_selectData.add('');
} else {
_selectData.add(mSelectData[i]);
}
_selectDataPosition.add(0);
}
_init(mSelectData);
}
final PickerStyle _pickerStyle;
//
@ -140,24 +158,6 @@ class _PickerState extends State<_PickerContentView> {
// BUG
late double pickerItemHeight;
_PickerState(
this._data, List mSelectData, this._pickerStyle, this._columeNum) {
this.pickerItemHeight = _pickerStyle.pickerItemHeight;
//
this._selectData = [];
this._selectDataPosition = [];
for (int i = 0; i < _columeNum; ++i) {
if (i >= mSelectData.length) {
this._selectData.add('');
} else {
this._selectData.add(mSelectData[i]);
}
this._selectDataPosition.add(0);
}
_init(mSelectData);
}
@override
void dispose() {
scrollCtrl.forEach((element) {

View File

@ -12,14 +12,12 @@ typedef SingleCallback(var data, int position);
class SinglePickerRoute<T> extends PopupRoute<T> {
SinglePickerRoute({
required this.data,
this.selectData,
required this.theme, required this.pickerStyle, this.selectData,
this.suffix,
this.onChanged,
this.onConfirm,
this.onCancel,
required this.theme,
this.barrierLabel,
required this.pickerStyle,
RouteSettings? settings,
}) : super(settings: settings);
@ -95,11 +93,8 @@ class SinglePickerRoute<T> extends PopupRoute<T> {
class _PickerContentView extends StatefulWidget {
_PickerContentView({
Key? key,
required this.data,
required this.data, required this.pickerStyle, required this.route, Key? key,
this.selectData,
required this.pickerStyle,
required this.route,
}) : super(key: key);
final List data;
@ -173,7 +168,7 @@ class _PickerState extends State<_PickerContentView> {
}
_selectPosition = pindex;
scrollCtrl = new FixedExtentScrollController(initialItem: pindex);
scrollCtrl = FixedExtentScrollController(initialItem: pindex);
_laberLeft = _pickerLaberPadding(_data[pindex].toString());
}

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
///
@ -52,23 +53,23 @@ class PickerStyle {
double? textSize,
Widget? itemOverlay,
}) {
this._context = context;
this._showTitleBar = showTitleBar;
this._menu = menu;
_context = context;
_showTitleBar = showTitleBar;
_menu = menu;
this._pickerHeight = pickerHeight;
this._pickerTitleHeight = pickerTitleHeight;
this._pickerItemHeight = pickerItemHeight;
this._menuHeight = menuHeight;
_pickerHeight = pickerHeight;
_pickerTitleHeight = pickerTitleHeight;
_pickerItemHeight = pickerItemHeight;
_menuHeight = menuHeight;
this._cancelButton = cancelButton;
this._commitButton = commitButton;
this._title = title;
this._headDecoration = headDecoration;
this._backgroundColor = backgroundColor;
this._textColor = textColor;
this._textSize = textSize;
this._itemOverlay = itemOverlay;
_cancelButton = cancelButton;
_commitButton = commitButton;
_title = title;
_headDecoration = headDecoration;
_backgroundColor = backgroundColor;
_textColor = textColor;
_textSize = textSize;
_itemOverlay = itemOverlay;
}
set context(BuildContext? value) {
@ -131,54 +132,54 @@ class PickerStyle {
_showTitleBar = value;
}
BuildContext? get context => this._context;
BuildContext? get context => _context;
///
Color get backgroundColor => this._backgroundColor ?? Colors.white;
Color get backgroundColor => _backgroundColor ?? Colors.white;
Decoration get headDecoration =>
this._headDecoration ?? BoxDecoration(color: Colors.white);
_headDecoration ?? const BoxDecoration(color: Colors.white);
Widget? get menu => this._menu;
Widget? get menu => _menu;
double get menuHeight => this._menuHeight ?? 36.0;
double get menuHeight => _menuHeight ?? 36.0;
double get pickerHeight => this._pickerHeight ?? 220.0;
double get pickerHeight => _pickerHeight ?? 220.0;
double get pickerItemHeight => this._pickerItemHeight ?? 40.0;
double get pickerItemHeight => _pickerItemHeight ?? 40.0;
double get pickerTitleHeight => this._pickerTitleHeight ?? 44.0;
double get pickerTitleHeight => _pickerTitleHeight ?? 44.0;
bool get showTitleBar => this._showTitleBar ?? true;
bool get showTitleBar => _showTitleBar ?? true;
Color get textColor => this._textColor ?? Colors.black87;
Color get textColor => _textColor ?? Colors.black87;
double? get textSize => this._textSize;
double? get textSize => _textSize;
Widget get title => this._title ?? SizedBox();
Widget get title => _title ?? const SizedBox();
Widget get commitButton => getCommitButton();
Widget get cancelButton => getCancelButton();
Widget? get itemOverlay => this._itemOverlay;
Widget? get itemOverlay => _itemOverlay;
Widget getCommitButton() {
return this._commitButton ??
return _commitButton ??
Container(
alignment: Alignment.center,
padding: const EdgeInsets.only(left: 12, right: 22),
child: Text('确定',
child: Text('确定'.tr,
style: TextStyle(color: AppColors.mainColor, fontSize: 16.0)),
);
}
Widget getCancelButton() {
return this._cancelButton ??
return _cancelButton ??
Container(
alignment: Alignment.center,
padding: const EdgeInsets.only(left: 22, right: 12),
child: Text('取消',
child: Text('取消'.tr,
style: TextStyle(
color: Theme.of(context!).unselectedWidgetColor,
fontSize: 16.0)),

View File

@ -1,44 +1,60 @@
class PicketUtil {
///
static bool strNoEmpty(String? value) {
if (value == null) return false;
if (value == null) {
return false;
}
return value.trim().isNotEmpty;
}
///
static bool strEmpty(String? value) {
if (value == null) return true;
if (value == null) {
return true;
}
return value.trim().isEmpty;
}
/// MAp不为空
static bool mapNoEmpty(Map? value) {
if (value == null) return false;
if (value == null) {
return false;
}
return value.isNotEmpty;
}
/// MAp为空
static bool mapEmpty(Map? value) {
if (value == null) return true;
if (value == null) {
return true;
}
return value.isEmpty;
}
///List是否为空
static bool listNoEmpty(List? list) {
if (list == null) return false;
if (list == null) {
return false;
}
if (list.length == 0) return false;
if (list.isEmpty) {
return false;
}
return true;
}
///List是否为空
static bool listEmpty(List? list) {
if (list == null) return true;
if (list == null) {
return true;
}
if (list.length == 0) return true;
if (list.isEmpty) {
return true;
}
return false;
}

View File

@ -14,10 +14,10 @@ class MessageManagement {
Map<String, dynamic> extra = <String, dynamic>{};
if (GetPlatform.isAndroid) {
extra = _androidAnalysis(message);
AppLog.log('MessageManagement.shunting GetPlatform.isAndroid: $extra');
// AppLog.log('MessageManagement.shunting GetPlatform.isAndroid: $extra');
} else if (GetPlatform.isIOS) {
extra = _iosAnalysis(message);
AppLog.log('MessageManagement.shunting GetPlatform.isIos: $extra');
// AppLog.log('MessageManagement.shunting GetPlatform.isIos: $extra');
} else {
return;
}

View File

@ -9,22 +9,13 @@ import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class JhScreenUtils {
static init(BuildContext context) {
// 稿iPhone6的尺寸设计的(iPhone6 750*1334)
ScreenUtil.init(context, designSize: const Size(750, 1334));
}
static void init(BuildContext context) => ScreenUtil.init(context, designSize: const Size(750, 1334));
static setWidth(double width) {
ScreenUtil().setWidth(width);
}
static double setWidth(double width) => ScreenUtil().setWidth(width);
static setHeight(double height) {
ScreenUtil().setHeight(height);
}
static double setHeight(double height) => ScreenUtil().setHeight(height);
static setSp(num fontSize) {
ScreenUtil().setSp(fontSize);
}
static double setSp(num fontSize) => ScreenUtil().setSp(fontSize);
// static double get screenWidth => ScreenUtil.screenWidth;
//
@ -41,43 +32,41 @@ class JhScreenUtils {
//
static double get screenWidth {
MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
final MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
return mediaQuery.size.width;
}
static double get screenHeight {
MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
final MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
return mediaQuery.size.height;
}
static double get scale {
MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
final MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
return mediaQuery.devicePixelRatio;
}
static double get textScaleFactor {
MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
final MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
return mediaQuery.textScaleFactor;
}
static double get navigationBarHeight {
MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
final MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
return mediaQuery.padding.top + kToolbarHeight;
}
static double get topSafeHeight {
MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
final MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
return mediaQuery.padding.top;
}
static double get bottomSafeHeight {
MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
final MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window);
return mediaQuery.padding.bottom;
}
static updateStatusBarStyle(SystemUiOverlayStyle style) {
SystemChrome.setSystemUIOverlayStyle(style);
}
static void updateStatusBarStyle(SystemUiOverlayStyle style) => SystemChrome.setSystemUIOverlayStyle(style);
}
/*

View File

@ -8,21 +8,21 @@ class SeletKeyCyclicDateLogic extends BaseGetXController {
SeletKeyCyclicDateState state = SeletKeyCyclicDateState();
void subBtnAction(){
var starDateTimestamp = DateTool().dateToTimestamp(state.starDate.value, 1).toString();
var endDateTimestamp = DateTool().dateToTimestamp(state.endDate.value, 1).toString();
var starTimeTimestamp = DateTool().dateToTimestamp(state.starTime.value, 0).toString();
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0).toString();
final String starDateTimestamp = DateTool().dateToTimestamp(state.starDate.value, 1).toString();
final String endDateTimestamp = DateTool().dateToTimestamp(state.endDate.value, 1).toString();
final String starTimeTimestamp = DateTool().dateToTimestamp(state.starTime.value, 0).toString();
final String endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0).toString();
if (int.parse(starDateTimestamp) > int.parse(endDateTimestamp)) {
showToast("失效日期要大于生效日期".tr);
showToast('失效日期要大于生效日期'.tr);
return;
}
if (int.parse(starTimeTimestamp) >= int.parse(endTimeTimestamp)) {
showToast("失效时间要大于生效时间".tr);
showToast('失效时间要大于生效时间'.tr);
return;
}
Map<String, dynamic> resultMap = {};
final Map<String, dynamic> resultMap = {};
resultMap['starDate'] = state.starDate.value;
resultMap['endDate'] = state.endDate.value;
resultMap['starTime'] = state.starTime.value;

View File

@ -3,9 +3,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/tools/dateTool.dart';
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
import 'package:star_lock/tools/seletKeyCyclicDate/seletKeyCyclicDate_state.dart';
import '../../app_settings/app_colors.dart';
import '../../translations/trans_lib.dart';
import '../commonItem.dart';
import '../pickers/pickers.dart';
import '../pickers/time_picker/model/date_mode.dart';
@ -24,8 +24,8 @@ class SeletKeyCyclicDatePage extends StatefulWidget {
}
class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
final logic = Get.put(SeletKeyCyclicDateLogic());
final state = Get.find<SeletKeyCyclicDateLogic>().state;
final SeletKeyCyclicDateLogic logic = Get.put(SeletKeyCyclicDateLogic());
final SeletKeyCyclicDateState state = Get.find<SeletKeyCyclicDateLogic>().state;
@override
Widget build(BuildContext context) {
@ -36,7 +36,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
haveBack: true,
backgroundColor: AppColors.mainColor),
body: ListView(
children: [
children: <Widget>[
topWidget(),
SizedBox(height: 10.h),
middleWidget(),
@ -64,11 +64,11 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
Widget topWidget() {
return Column(
children: [
children: <Widget>[
Container(
color: Colors.white,
child: Column(
children: [
children: <Widget>[
Obx(() => CommonItem(
leftTitel: '生效日期'.tr,
rightTitle: state.starDate.value,
@ -79,7 +79,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
DateTime.tryParse(state.starDate.value));
Pickers.showDatePicker(context,
selectDate: selectDate,
mode: DateMode.YMD, onConfirm: (p) {
mode: DateMode.YMD, onConfirm: (PDuration p) {
state.starDate.value = DateTool().getYMDHNDateString(p, 2);
});
})),
@ -92,7 +92,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
PDuration.parse(DateTime.tryParse(state.endDate.value));
Pickers.showDatePicker(context,
selectDate: selectDate,
mode: DateMode.YMD, onConfirm: (p) {
mode: DateMode.YMD, onConfirm: (PDuration p) {
state.endDate.value = DateTool().getYMDHNDateString(p, 2);
});
})),
@ -111,7 +111,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
children: <Widget>[
Container(
height: 60.h,
// color: Colors.red,
@ -127,7 +127,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
crossAxisCount: 7, childAspectRatio: 1.0),
itemCount: 7,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
itemBuilder: (BuildContext context, int index) {
index += 1;
return btnItem(index);
})),
@ -201,11 +201,11 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
Widget bottomWidget() {
return Column(
children: [
children: <Widget>[
Container(
color: Colors.white,
child: Column(
children: [
children: <Widget>[
Obx(() => CommonItem(
leftTitel: '生效时间'.tr,
rightTitle: state.starTime.value,
@ -215,7 +215,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
final PDuration selectDate = PDuration.parse(DateTool().dateToDateTime(state.starTime.value, 0));
Pickers.showDatePicker(context,
selectDate: selectDate,
mode: DateMode.HM, onConfirm: (p) {
mode: DateMode.HM, onConfirm: (PDuration p) {
state.starTime.value =
DateTool().getYMDHNDateString(p, 3);
});
@ -228,7 +228,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
final PDuration selectDate = PDuration.parse(DateTool().dateToDateTime(state.endTime.value, 0));
Pickers.showDatePicker(context,
selectDate: selectDate,
mode: DateMode.HM, onConfirm: (p) {
mode: DateMode.HM, onConfirm: (PDuration p) {
state.endTime.value = DateTool().getYMDHNDateString(p, 3);
});
})),

View File

@ -3,29 +3,28 @@
import 'package:get/get.dart';
class SeletKeyCyclicDateState{
var starDate = "".obs;//
var endDate = "".obs;//
var starTime = "".obs;//
var endTime = "".obs;//
var weekDay = [].obs;
SeletKeyCyclicDateState() {
var map = Get.arguments;
if ((map["starDate"] != null)) {
starDate.value = map["starDate"];
final map = Get.arguments;
if (map['starDate'] != null) {
starDate.value = map['starDate'];
}
if ((map["endDate"] != null)) {
endDate.value = map["endDate"];
if (map['endDate'] != null) {
endDate.value = map['endDate'];
}
if ((map["starTime"] != null)) {
starTime.value = map["starTime"];
if (map['starTime'] != null) {
starTime.value = map['starTime'];
}
if ((map["endTime"] != null)) {
endTime.value = map["endTime"];
if (map['endTime'] != null) {
endTime.value = map['endTime'];
}
if ((map["validityValue"] != null)) {
weekDay.value = map["validityValue"];
if (map['validityValue'] != null) {
weekDay.value = map['validityValue'];
}
}
RxString starDate = ''.obs;//
RxString endDate = ''.obs;//
RxString starTime = ''.obs;//
RxString endTime = ''.obs;//
RxList weekDay = [].obs;
}

View File

@ -1,15 +1,16 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class SharePopup extends StatelessWidget {
List<String> nameItems = <String>[
'微信',
'朋友圈',
'QQ',
'QQ空间',
'微博',
'FaceBook',
'邮件',
'链接'
'微信'.tr,
'朋友圈'.tr,
'QQ'.tr,
'QQ空间'.tr,
'微博'.tr,
'FaceBook'.tr,
'邮件'.tr,
'链接'.tr
];
List<String> urlItems = <String>[
'icon_wechat.png',
@ -90,12 +91,12 @@ class SharePopup extends StatelessWidget {
height: 0.5,
color: Colors.blueGrey,
),
const Center(
Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),
padding: const EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),
child: Text(
' ',
style: TextStyle(fontSize: 18.0, color: Colors.blueGrey),
''.tr,
style: const TextStyle(fontSize: 18.0, color: Colors.blueGrey),
)),
)
],

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_picker/flutter_picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
///2023/7/17
///
@ -9,6 +10,14 @@ typedef ArrayClickCallback = void Function(List<int> selecteds, List<dynamic> st
typedef DateClickCallback = void Function(dynamic selectDateStr, dynamic selectDate);
class ShowBottomSheetTool {
ShowBottomSheetTool({
this.pickerHeight = 200.0,
this.itemHeight = 45.0,
this.btnColor = Colors.black,
this.titleColor = const Color.fromRGBO(127, 127, 127, 1.0),
this.textFontSize = 16.0
});
//
double pickerHeight;
//
@ -20,14 +29,6 @@ class ShowBottomSheetTool {
//
double textFontSize;
ShowBottomSheetTool({
this.pickerHeight = 200.0,
this.itemHeight = 45.0,
this.btnColor = Colors.black,
this.titleColor = const Color.fromRGBO(127, 127, 127, 1.0),
this.textFontSize = 16.0
});
///
void showSingleRowPicker<T>(
BuildContext context, {
@ -80,15 +81,15 @@ class ShowBottomSheetTool {
Picker(
adapter: adapter,
title: Text(
title ?? "请选择",
title ?? '请选择'.tr,
style: TextStyle(
color: titleColor,
fontSize: textFontSize,
),
),
selecteds: selecteds,
confirmText: sureTitle??'确定',
cancelText: cancelTitle??'取消',
confirmText: sureTitle??'确定'.tr,
cancelText: cancelTitle??'取消'.tr,
cancelTextStyle: TextStyle(
color: btnColor,
fontSize: textFontSize,
@ -100,7 +101,7 @@ class ShowBottomSheetTool {
textAlign: TextAlign.right,
itemExtent: itemHeight,
height: pickerHeight,
selectedTextStyle: TextStyle(
selectedTextStyle: const TextStyle(
color: Colors.black,
),
onConfirm: clickCallBack,

View File

@ -42,7 +42,7 @@ class ShowCalendar extends StatelessWidget {
onDateChanged:selectAction!,
//
onDisplayedMonthChanged: (dateTime){
AppLog.log("onDisplayedMonthChanged $dateTime");
// AppLog.log("onDisplayedMonthChanged $dateTime");
},
//
selectableDayPredicate: (dayTime){

View File

@ -44,7 +44,7 @@ class ShowCupertinoAlertView {
Padding(
padding: EdgeInsets.only(left: 60.w, right: 60.w),
child: Text(
'开启微信接收报警消息需要先关注$qrCodeText微信公众号,请保存二维码并使用微信扫一扫设置',
'${"开启微信接收报警消息需要先关注".tr}$qrCodeText${"微信公众号,请保存二维码并使用微信扫一扫设置".tr}',
style:
TextStyle(fontSize: 24.sp, color: Colors.black),
)),
@ -86,9 +86,7 @@ class ShowCupertinoAlertView {
'取消'.tr,
style: TextStyle(color: AppColors.mainColor),
),
onPressed: () {
Get.back();
},
onPressed: Get.back,
),
CupertinoDialogAction(
child: Text(
@ -200,9 +198,7 @@ class ShowCupertinoAlertView {
'取消'.tr,
style: TextStyle(color: AppColors.mainColor),
),
onPressed: () {
Get.back();
},
onPressed: Get.back,
),
CupertinoDialogAction(
child: Text(
@ -254,9 +250,7 @@ class ShowCupertinoAlertView {
),
actions: <Widget>[
CupertinoDialogAction(
onPressed: () {
Get.back();
},
onPressed: Get.back,
child: Text(
'取消'.tr,
style: TextStyle(color: AppColors.mainColor),
@ -293,9 +287,7 @@ class ShowCupertinoAlertView {
content: Text('是否要远程开锁?'.tr),
actions: <Widget>[
CupertinoDialogAction(
onPressed: () {
Get.back();
},
onPressed: Get.back,
child: Text(
'取消'.tr,
style: TextStyle(color: AppColors.mainColor),
@ -332,9 +324,7 @@ class ShowCupertinoAlertView {
'取消'.tr,
style: TextStyle(color: AppColors.mainColor),
),
onPressed: () {
Get.back();
},
onPressed: Get.back,
),
CupertinoDialogAction(
child:
@ -356,16 +346,14 @@ class ShowCupertinoAlertView {
context: Get.context!,
builder: (context) {
return CupertinoAlertDialog(
title: const Text('实名认证为付费功能,请联系锁的管理员购买后再使用'),
title: Text('实名认证为付费功能,请联系锁的管理员购买后再使用'.tr),
actions: [
CupertinoDialogAction(
child: Text(
'确定'.tr,
style: TextStyle(color: AppColors.mainColor),
),
onPressed: () {
Get.back();
},
onPressed: Get.back,
),
],
);
@ -387,9 +375,7 @@ class ShowCupertinoAlertView {
'取消'.tr,
style: TextStyle(color: AppColors.mainColor),
),
onPressed: () {
Get.back();
},
onPressed: Get.back,
),
CupertinoDialogAction(
child:

View File

@ -1,15 +1,8 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../translations/trans_lib.dart';
class ShowIosTipView extends StatelessWidget {
String? title;
String? tipTitle;
Function()? sureClick;
Function()? cancelClick;
ShowIosTipView(
{Key? key,
@ -18,6 +11,10 @@ class ShowIosTipView extends StatelessWidget {
this.sureClick,
this.cancelClick})
: super(key: key);
String? title;
String? tipTitle;
Function()? sureClick;
Function()? cancelClick;
@override
Widget build(BuildContext context) {
@ -43,56 +40,5 @@ class ShowIosTipView extends StatelessWidget {
),
],
);
return Card(
color: const Color(0x00FFFFFF),
child: Builder(
builder: (context) {
// return Theme(
// data: ThemeData.light(),
// child: CupertinoAlertDialog(
// title: Text(title!),
// content: Column(
// children: <Widget>[
// const SizedBox(
// height: 10,
// ),
// Column(
// children: [
// Text(tipTitle!, style: TextStyle(fontSize: 24.sp))
// ],
// )
// ],
// ),
// actions: <Widget>[
// CupertinoDialogAction(
// child: Text(
// TranslationLoader.lanKeys!.cancel!.tr,
// style: const TextStyle(color: Colors.black),
// ),
// onPressed: () {
// // Navigator.pop(context);
// if (cancelClick != null) {
// cancelClick!();
// }
// },
// ),
// CupertinoDialogAction(
// child: Text(TranslationLoader.lanKeys!.sure!.tr,
// style: const TextStyle(color: Colors.black)),
// onPressed: () {
// if (sureClick != null) {
// sureClick!();
// }
// // Navigator.pop(context);
// },
// ),
// ],
// ),
// );
}
),
);
}
}

View File

@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';
import 'package:get/get.dart';
import '../translations/trans_lib.dart';
typedef DateValueCallback(DateTime dateTime, List<int> selectedIndex);
@ -13,9 +12,9 @@ class ShowSelectDateTime {
// String MIN_DATETIME = '1900-01-01 00:00';
// String MAX_DATETIME = '2100-01-01 00:00';
// String INIT_DATETIME = getNowDate();
DateTime _dateTime = DateTime.parse(nowDate);
DateTimePickerLocale _locale = DateTimePickerLocale.zh_cn;
String _format = formatStr;
final DateTime _dateTime = DateTime.parse(nowDate);
const DateTimePickerLocale _locale = DateTimePickerLocale.zh_cn;
final String _format = formatStr;
DatePicker.showDatePicker(
context,
@ -42,26 +41,4 @@ class ShowSelectDateTime {
onConfirm: onConfirm,
);
}
// String getNowDate(){
// //
// DateTime today = DateTime.now();
// String dateSlug ="${today.year.toString()}-${today.month.toString().padLeft(2,'0')}-${today.day.toString().padLeft(2,'0')} ${today.hour.toString().padLeft(2,'0')}:${today.minute.toString().padLeft(2,'0')}";
//
// // //
// // int year = now.year;
// // //
// // int month = now.month;
// // //
// // int day = now.day;
// // //
// // int hour = now.hour;
// // //
// // int minute = now.minute;
// // //
// // int millisecond = now.millisecond;
//
// // AppLog.log("组合 $year-$month-$day $hour:$minute:$millisecond");
// return dateSlug;
// }
}

View File

@ -5,8 +5,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import '../translations/trans_lib.dart';
class ShowTFView extends StatelessWidget {
String? title;
String? tipTitle;

View File

@ -6,7 +6,6 @@ import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/tools/showTFView.dart';
import '../translations/trans_lib.dart';
import 'showDeleteAdministratorIsHaveAllDataWidget.dart';
typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);

View File

@ -1,7 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../app_settings/app_colors.dart';

View File

@ -1,4 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -8,19 +8,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
* */
class TFInputHaveBorder extends StatelessWidget {
TextEditingController? controller;
List<TextInputFormatter>? inputFormatters;
TextInputType? keyboardType;
Color? background;
String? hintText;
String? leftImg;
String? label;
bool? isPwd;
Widget? rightSlot;
Function()? onChangeAction;
TFInputHaveBorder(
{Key? key,
required this.controller,
{required this.controller, Key? key,
this.rightSlot,
this.label,
this.isPwd,
@ -31,6 +20,16 @@ class TFInputHaveBorder extends StatelessWidget {
this.onChangeAction,
this.leftImg})
: super(key: key);
TextEditingController? controller;
List<TextInputFormatter>? inputFormatters;
TextInputType? keyboardType;
Color? background;
String? hintText;
String? leftImg;
String? label;
bool? isPwd;
Widget? rightSlot;
Function()? onChangeAction;
@override
Widget build(BuildContext context) {

View File

@ -11,24 +11,23 @@ import 'package:url_launcher/url_launcher.dart';
import '../app_settings/app_settings.dart';
import '../network/api_repository.dart';
import '../translations/trans_lib.dart';
import 'versionUndate_entity.dart';
class VersionUndateTool {
static VersionUndateTool? _manager;
VersionUndateTool._init() {
// _initLoadUpdateVersionData();
}
factory VersionUndateTool() => shareManager()!;
static VersionUndateTool? _manager;
static VersionUndateTool? shareManager() {
_manager ??= VersionUndateTool._init();
_manager!._initLoadUpdateVersionData();
return _manager;
}
factory VersionUndateTool() => shareManager()!;
VersionUndateTool? get manager => shareManager();
void _initLoadUpdateVersionData() {