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

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", "附近的设备": "Nearby Equipment",
"暂无数据": "No Data", "暂无数据": "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", "通过门磁可查询门的开、关状态。每把锁咳添加一个门磁": "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", "开始": "Start",
"全天": "All Day", "全天": "All Day",
@ -257,13 +254,13 @@
"如需修改名字请重新命名,点击确定添加锁": "If you want to change the name, please rename, click OK to add lock", "如需修改名字请重新命名,点击确定添加锁": "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", "添加锁时,手机必须在锁旁边": "When adding a lock, the phone must be next to the lock",
"登录": "Login", "登录": "Login",
"注册": "注册", "注册": "Register",
"我已阅读并同意": "I Have Read And Agree", "我已阅读并同意": "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", "密码必须是8-20位至少包括数字/字母/符号中的2种": "The password must be 8-20 characters, including at least 2 of the numbers/letters/symbols",
"手机": "Iphone", "手机": "Iphone",
"邮箱": "Email", "邮箱": "Email",
"请输入邮箱": "请输入邮箱", "请输入邮箱": "Please enter your email",
"国家/地区": "Country/Region", "国家/地区": "Country/Region",
"你所在的国家/地区": "The country/region you are in", "你所在的国家/地区": "The country/region you are in",
"选择国家/地区": "Select Country/Region", "选择国家/地区": "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?", "删除锁后,所有信息都会一起删除,确定删除锁吗?": "After deleting the lock, all information will be deleted together, are you sure you want to delete the lock?",
"请输入登录密码": "Please enter the login password", "请输入登录密码": "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", "删除设备失败,请确保在设备附近,设备未被连接,设备已打开": "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", "用户无权限": "User has no permission",
"创建公司后,考勤功能才能使用": "After creating the company, the attendance function can be used", "创建公司后,考勤功能才能使用": "After creating the company, the attendance function can be used",
"是否删除钥匙?": "Whether to delete the key?", "是否删除钥匙?": "Whether to delete the key?",
@ -832,5 +828,38 @@
"蓝牙未打开,请到设置里面打开蓝牙": "Bluetooth is not turned on, please turn on Bluetooth in the settings", "蓝牙未打开,请到设置里面打开蓝牙": "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.", "删除用户时,会将用户拥有的钥匙一起删除。": "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) { if (isLogin) {
await privacySDKInitialization(); await privacySDKInitialization();
Future<void>.delayed(const Duration(milliseconds: 500), () async { Future<void>.delayed(const Duration(milliseconds: 500), () async {
AppLog.log('main函数调用了获取App信息接口'); // AppLog.log('main函数调用了获取App信息接口');
final GetAppInfo entity = await ApiRepository.to.getAppInfo(); final GetAppInfo entity = await ApiRepository.to.getAppInfo();
CustomerTool.init(entity.data?.wechatServiceUrl ?? ''); CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
if (entity.data?.appSiteUrl != null) { if (entity.data?.appSiteUrl != null) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,17 +8,15 @@ import '../app_settings/app_colors.dart';
import '../app_settings/app_settings.dart'; import '../app_settings/app_settings.dart';
class KeySearchWidget extends StatelessWidget { class KeySearchWidget extends StatelessWidget {
KeySearchWidget(
{required this.editingController, required this.onSubmittedAction, Key? key,
this.backgroundColor})
: super(key: key);
TextEditingController editingController; TextEditingController editingController;
Function() onSubmittedAction; Function() onSubmittedAction;
Color? backgroundColor; Color? backgroundColor;
KeySearchWidget(
{Key? key,
required this.editingController,
required this.onSubmittedAction,
this.backgroundColor})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -30,7 +28,7 @@ class KeySearchWidget extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(top: 15.h, bottom: 15.h, right: 5.w, left: 10.w), padding: EdgeInsets.only(top: 15.h, bottom: 15.h, right: 5.w, left: 10.w),
child: Image.asset( child: Image.asset(
@ -55,18 +53,18 @@ class KeySearchWidget extends StatelessWidget {
controller: editingController, controller: editingController,
autofocus: false, autofocus: false,
textAlign: TextAlign.start, textAlign: TextAlign.start,
onChanged: (value) { onChanged: (String value) {
AppLog.log("onChanged:$value"); AppLog.log('onChanged:$value');
}, },
onEditingComplete: () { onEditingComplete: () {
AppLog.log("onEditingComplete:"); AppLog.log('onEditingComplete:');
}, },
onSubmitted: (value) { onSubmitted: (String value) {
onSubmittedAction!(); onSubmittedAction!();
}, },
decoration: InputDecoration( decoration: InputDecoration(
// //
hintText:"搜索".tr, hintText:'搜索'.tr,
hintStyle: TextStyle(fontSize: 22.sp), hintStyle: TextStyle(fontSize: 22.sp),
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)), focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
disabledBorder: 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 { class DropDownItem {
DropDownItem(
{required this.itemTitle,
required this.itemValue,
required this.isCheked});
// //
String itemTitle = ''; String itemTitle = '';
// //
dynamic itemValue; dynamic itemValue;
// //
bool isCheked = false; 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/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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/app_settings/app_colors.dart';
import 'package:star_lock/tools/menuItem/dropDownItem.dart'; import 'package:star_lock/tools/menuItem/dropDownItem.dart';
@ -7,6 +8,14 @@ import 'package:star_lock/tools/menuItem/dropDownItem.dart';
/// @2024/4/11 /// @2024/4/11
/// ///
class XSDropDownWidget extends StatefulWidget { class XSDropDownWidget extends StatefulWidget {
XSDropDownWidget(
{Key? key,
required this.items,
this.value,
this.valueChanged,
this.title,
this.tooltip = '点击选择'})
: super(key: key);
// //
List<DropDownItem> items = []; List<DropDownItem> items = [];
// //
@ -14,17 +23,9 @@ class XSDropDownWidget extends StatefulWidget {
// //
final String? title; final String? title;
// //
final String tooltip; String tooltip = '点击选择'.tr;
// //
final ValueChanged<dynamic>? valueChanged; final ValueChanged<dynamic>? valueChanged;
XSDropDownWidget(
{Key? key,
required this.items,
this.value,
this.valueChanged,
this.title,
this.tooltip = "点击选择"})
: super(key: key);
@override @override
State<XSDropDownWidget> createState() => _XSDropDownWidgetState(); State<XSDropDownWidget> createState() => _XSDropDownWidgetState();

View File

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

View File

@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import '../app_settings/app_settings.dart'; import '../app_settings/app_settings.dart';
@ -16,29 +17,29 @@ class PermissionUtil {
PermissionUtil(this._context); PermissionUtil(this._context);
final List<String> _list = [ final List<String> _list = [
"为了更好地应用体验,请确定权限", '为了更好地应用体验,请确定权限'.tr,
"您第一次拒绝权限,请确定权限", '您第一次拒绝权限,请确定权限'.tr,
"您第二次拒绝权限,请去应用设置开启权限" '您第二次拒绝权限,请去应用设置开启权限'.tr
]; ];
final BuildContext _context ; 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_handler: ^5.0.1+1
// //
Permission permission = Permission.location; Permission permission = Permission.location;
status ??= await permission.status; status ??= await permission.status;
AppLog.log("statusstatusstatus:$status"); // AppLog.log('statusstatusstatus:$status');
if (status.isDenied) { if (status.isDenied) {
// //
showPermissionDialog(_list[0], "同意", permission); showPermissionDialog(_list[0], '同意'.tr, permission);
} else if (status.isDenied) { } else if (status.isDenied) {
// //
showPermissionDialog(_list[1], "重试", permission); showPermissionDialog(_list[1], '重试'.tr, permission);
} else if (status.isPermanentlyDenied) { } else if (status.isPermanentlyDenied) {
// //
showPermissionDialog(_list[2], "去应用市场", permission,isUndetermined: true); showPermissionDialog(_list[2], '去应用市场'.tr, permission,isUndetermined: true);
} else if (status.isGranted) { } else if (status.isGranted) {
// //
blockScuessStatus!(); blockScuessStatus!();
@ -61,18 +62,15 @@ class PermissionUtil {
showCupertinoDialog( showCupertinoDialog(
builder: (BuildContext context) { builder: (BuildContext context) {
return CupertinoAlertDialog( return CupertinoAlertDialog(
title: Text("温馨提示"), title: Text('温馨提示'.tr),
content: Container( content: Container(
child: Text(msg), child: Text(msg),
), ),
actions: [ actions: [
// //
CupertinoDialogAction( CupertinoDialogAction(
child: Text("关闭应用"), child: Text('关闭应用'.tr),
onPressed: (){ onPressed: closeAPP,
//
closeAPP();
},
), ),
// //
CupertinoDialogAction( CupertinoDialogAction(
@ -111,7 +109,7 @@ class PermissionUtil {
} }
// //
void closeAPP() { 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 @override
State<StatefulWidget> createState() => _PickerState( State<StatefulWidget> createState() => _PickerState(
this.data, this.selectData, this.pickerStyle, this.columeNum); data, selectData, pickerStyle, columeNum);
} }
class _PickerState extends State<_PickerContentView> { 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; final PickerStyle _pickerStyle;
// //
@ -140,24 +158,6 @@ class _PickerState extends State<_PickerContentView> {
// BUG // BUG
late double pickerItemHeight; 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 @override
void dispose() { void dispose() {
scrollCtrl.forEach((element) { scrollCtrl.forEach((element) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,29 +3,28 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
class SeletKeyCyclicDateState{ class SeletKeyCyclicDateState{
var starDate = "".obs;//
var endDate = "".obs;//
var starTime = "".obs;//
var endTime = "".obs;//
var weekDay = [].obs;
SeletKeyCyclicDateState() { SeletKeyCyclicDateState() {
var map = Get.arguments; final map = Get.arguments;
if ((map["starDate"] != null)) { if (map['starDate'] != null) {
starDate.value = map["starDate"]; starDate.value = map['starDate'];
} }
if ((map["endDate"] != null)) { if (map['endDate'] != null) {
endDate.value = map["endDate"]; endDate.value = map['endDate'];
} }
if ((map["starTime"] != null)) { if (map['starTime'] != null) {
starTime.value = map["starTime"]; starTime.value = map['starTime'];
} }
if ((map["endTime"] != null)) { if (map['endTime'] != null) {
endTime.value = map["endTime"]; endTime.value = map['endTime'];
} }
if ((map["validityValue"] != null)) { if (map['validityValue'] != null) {
weekDay.value = map["validityValue"]; 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:flutter/material.dart';
import 'package:get/get.dart';
class SharePopup extends StatelessWidget { class SharePopup extends StatelessWidget {
List<String> nameItems = <String>[ List<String> nameItems = <String>[
'微信', '微信'.tr,
'朋友圈', '朋友圈'.tr,
'QQ', 'QQ'.tr,
'QQ空间', 'QQ空间'.tr,
'微博', '微博'.tr,
'FaceBook', 'FaceBook'.tr,
'邮件', '邮件'.tr,
'链接' '链接'.tr
]; ];
List<String> urlItems = <String>[ List<String> urlItems = <String>[
'icon_wechat.png', 'icon_wechat.png',
@ -90,12 +91,12 @@ class SharePopup extends StatelessWidget {
height: 0.5, height: 0.5,
color: Colors.blueGrey, color: Colors.blueGrey,
), ),
const Center( Center(
child: Padding( 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( child: Text(
' ', ''.tr,
style: TextStyle(fontSize: 18.0, color: Colors.blueGrey), style: const TextStyle(fontSize: 18.0, color: Colors.blueGrey),
)), )),
) )
], ],

View File

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

View File

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

View File

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

View File

@ -1,15 +1,8 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../translations/trans_lib.dart';
class ShowIosTipView extends StatelessWidget { class ShowIosTipView extends StatelessWidget {
String? title;
String? tipTitle;
Function()? sureClick;
Function()? cancelClick;
ShowIosTipView( ShowIosTipView(
{Key? key, {Key? key,
@ -18,6 +11,10 @@ class ShowIosTipView extends StatelessWidget {
this.sureClick, this.sureClick,
this.cancelClick}) this.cancelClick})
: super(key: key); : super(key: key);
String? title;
String? tipTitle;
Function()? sureClick;
Function()? cancelClick;
@override @override
Widget build(BuildContext context) { 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:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../translations/trans_lib.dart';
typedef DateValueCallback(DateTime dateTime, List<int> selectedIndex); typedef DateValueCallback(DateTime dateTime, List<int> selectedIndex);
@ -13,9 +12,9 @@ class ShowSelectDateTime {
// String MIN_DATETIME = '1900-01-01 00:00'; // String MIN_DATETIME = '1900-01-01 00:00';
// String MAX_DATETIME = '2100-01-01 00:00'; // String MAX_DATETIME = '2100-01-01 00:00';
// String INIT_DATETIME = getNowDate(); // String INIT_DATETIME = getNowDate();
DateTime _dateTime = DateTime.parse(nowDate); final DateTime _dateTime = DateTime.parse(nowDate);
DateTimePickerLocale _locale = DateTimePickerLocale.zh_cn; const DateTimePickerLocale _locale = DateTimePickerLocale.zh_cn;
String _format = formatStr; final String _format = formatStr;
DatePicker.showDatePicker( DatePicker.showDatePicker(
context, context,
@ -42,26 +41,4 @@ class ShowSelectDateTime {
onConfirm: onConfirm, 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:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart'; import 'package:star_lock/app_settings/app_colors.dart';
import '../translations/trans_lib.dart';
class ShowTFView extends StatelessWidget { class ShowTFView extends StatelessWidget {
String? title; String? title;
String? tipTitle; 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/app_settings/app_colors.dart';
import 'package:star_lock/tools/showTFView.dart'; import 'package:star_lock/tools/showTFView.dart';
import '../translations/trans_lib.dart';
import 'showDeleteAdministratorIsHaveAllDataWidget.dart'; import 'showDeleteAdministratorIsHaveAllDataWidget.dart';
typedef BlockIsHaveAllDataCallback = void Function(bool isAllData); 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/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../app_settings/app_colors.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/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -8,19 +8,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
* */ * */
class TFInputHaveBorder extends StatelessWidget { 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( TFInputHaveBorder(
{Key? key, {required this.controller, Key? key,
required this.controller,
this.rightSlot, this.rightSlot,
this.label, this.label,
this.isPwd, this.isPwd,
@ -31,6 +20,16 @@ class TFInputHaveBorder extends StatelessWidget {
this.onChangeAction, this.onChangeAction,
this.leftImg}) this.leftImg})
: super(key: key); : 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

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