添加网关UI
This commit is contained in:
parent
915be9fb52
commit
8f25e1bf04
@ -830,5 +830,7 @@
|
|||||||
"掌静脉详情": "Palm vein details",
|
"掌静脉详情": "Palm vein details",
|
||||||
"掌静脉号": "Palm vein number",
|
"掌静脉号": "Palm vein number",
|
||||||
"蓝牙未打开,请到设置里面打开蓝牙": "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"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -859,5 +859,7 @@
|
|||||||
"掌静脉详情": "掌静脉详情",
|
"掌静脉详情": "掌静脉详情",
|
||||||
"掌静脉号": "掌静脉号",
|
"掌静脉号": "掌静脉号",
|
||||||
"蓝牙未打开,请到设置里面打开蓝牙": "蓝牙未打开,请到设置里面打开蓝牙",
|
"蓝牙未打开,请到设置里面打开蓝牙": "蓝牙未打开,请到设置里面打开蓝牙",
|
||||||
"删除用户时,会将用户拥有的钥匙一起删除。": "删除用户时,会将用户拥有的钥匙一起删除。"
|
"删除用户时,会将用户拥有的钥匙一起删除。": "删除用户时,会将用户拥有的钥匙一起删除。",
|
||||||
|
|
||||||
|
"配置网络": "配置网络"
|
||||||
}
|
}
|
||||||
|
|||||||
173
lan/lan_zh.json
173
lan/lan_zh.json
@ -104,7 +104,6 @@
|
|||||||
"未打卡": "未打卡",
|
"未打卡": "未打卡",
|
||||||
"假日信息": "假日信息",
|
"假日信息": "假日信息",
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
"基本信息": "基本信息",
|
"基本信息": "基本信息",
|
||||||
"无线键盘": "无线键盘",
|
"无线键盘": "无线键盘",
|
||||||
"选择无线键盘": "选择无线键盘",
|
"选择无线键盘": "选择无线键盘",
|
||||||
@ -202,174 +201,7 @@
|
|||||||
"请输入昵称": "请输入昵称",
|
"请输入昵称": "请输入昵称",
|
||||||
"修改昵称": "修改昵称",
|
"修改昵称": "修改昵称",
|
||||||
"修改账号": "修改账号",
|
"修改账号": "修改账号",
|
||||||
=======
|
|
||||||
"accountNumber": "账号",
|
|
||||||
"volumeAuthorizationLock": "批量授权锁",
|
|
||||||
"authorizedAdminTip": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人",
|
|
||||||
"lockOperatingRecordTip": "如果您需要保留历史记录,可以在右上角导出",
|
|
||||||
"rankingList": "排列榜",
|
|
||||||
"earlyArrivalList": "早到榜",
|
|
||||||
"lateList": "迟到榜",
|
|
||||||
"hardWorkingList": "勤奋榜",
|
|
||||||
"company": "公司",
|
|
||||||
"staff": "员工",
|
|
||||||
"work": "工作",
|
|
||||||
"workday": "工作日",
|
|
||||||
"holidays": "节假日",
|
|
||||||
"punchingMode": "打卡方式",
|
|
||||||
"whetherTheEmployeeHasAKey": "员工是否有钥匙",
|
|
||||||
"selectKey": "选择钥匙",
|
|
||||||
"officeHours": "上班时间",
|
|
||||||
"closingTime": "下班时间",
|
|
||||||
"thisWeek": "本周",
|
|
||||||
"singleDayWeekend": "单休",
|
|
||||||
"twoDaysOff": "双休",
|
|
||||||
"oddOrEvenDaysOff": "单双休",
|
|
||||||
"year": "年",
|
|
||||||
"month": "月",
|
|
||||||
"libertyDay": "放假日期",
|
|
||||||
"coverDate": "补班日期",
|
|
||||||
"addedHoliday": "添加假日",
|
|
||||||
"startDate": "开始日期",
|
|
||||||
"accessDate": "接入日期",
|
|
||||||
"mustFillIn": "必填",
|
|
||||||
"endDate": "结束日期",
|
|
||||||
"dailyCharts": "日榜",
|
|
||||||
"monthlyLeaderboard": "月榜",
|
|
||||||
"noAttendanceRecord": "无考勤记录",
|
|
||||||
"attendanceRecord": "考勤记录",
|
|
||||||
"everyoneIsVeryMotivated": "大家干劲十足",
|
|
||||||
"workingHoursWereNotReleased": "工作时长未出炉",
|
|
||||||
"beLate": "迟到",
|
|
||||||
"leaveEarly": "早退",
|
|
||||||
"noCardPunched": "未打卡",
|
|
||||||
"holidayInfo": "假日信息",
|
|
||||||
"basicInformation": "基本信息",
|
|
||||||
"wirelessKeyboard": "无线键盘",
|
|
||||||
"doorMagnetic": "门磁",
|
|
||||||
"remoteUnlocking": "远程开锁",
|
|
||||||
"automaticBlocking": "自动闭锁",
|
|
||||||
"normallyOpenMode": "常开模式",
|
|
||||||
"automaticUnLock": "自动开锁",
|
|
||||||
"automaticUnLockTip": "开启后锁将在常开模式开始时自动打开",
|
|
||||||
"lockSound": "锁声音",
|
|
||||||
"burglarAlarm": "防撬报警",
|
|
||||||
"resetButton": "重置键",
|
|
||||||
"lockTime": "锁时间",
|
|
||||||
"diagnose": "诊断",
|
|
||||||
"uploadData": "上传数据",
|
|
||||||
"importOtherLockData": "导入其他锁数据",
|
|
||||||
"lockEscalation": "锁升级",
|
|
||||||
"markedHouseState": "标记房态",
|
|
||||||
"unlockReminder": "开锁提醒",
|
|
||||||
"unlockQRCode": "微信二维码",
|
|
||||||
"lockNumber": "锁编号",
|
|
||||||
"electricQuantity": "电量",
|
|
||||||
"lockName": "名称",
|
|
||||||
"lockGrouping": "锁分组",
|
|
||||||
"selectGroup": "选择分组",
|
|
||||||
"createNewGroup": "创建新分组",
|
|
||||||
"adminOpenLockPassword": "管理员开锁密码",
|
|
||||||
"update": "更新",
|
|
||||||
"updateElectricQuantityTip": "电量信息可以通过网关远程更新,或通过手机蓝牙在锁旁边更新",
|
|
||||||
"adminOpenLockPasswordTip": "如果你在锁上修改过密码,锁内实际有效密码与这里显示的可能不同",
|
|
||||||
"updateLockAdminPassword": "上传锁内管理员密码",
|
|
||||||
"whenScreenFlashesClickNext": "当屏幕闪烁时,点击下一步",
|
|
||||||
"theScreenNeverFlickered": "屏幕一直没有闪烁",
|
|
||||||
"enterNumberOrPressSet": "输入*529#或按设置键",
|
|
||||||
"theLocationOfTheSetKeyWillBeDifferent": "设置键的位置会有差异",
|
|
||||||
"pressAndHoldTheResetButtonTwoSeconds": "长按重置键2秒",
|
|
||||||
"nearbyEquipment": "附近的设备",
|
|
||||||
"noData": "暂无数据",
|
|
||||||
"doorMagneticListTopTip": "通过门磁可查询门的开、关状态。每把锁咳添加一个门磁",
|
|
||||||
"remoteUnlockingPageTip": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。",
|
|
||||||
"currentMode": "当前模式",
|
|
||||||
"delayTime": "延迟时间",
|
|
||||||
"automaticBlockingTip": "经过以上设定的时间,锁会自动关闭。开启或修改设置后,请先开一次锁,使时间生效。",
|
|
||||||
"time": "时间",
|
|
||||||
"normallyOpen": "常开",
|
|
||||||
"date": "日期",
|
|
||||||
"begin": "开始",
|
|
||||||
"end": "结束",
|
|
||||||
"allDay": "全天",
|
|
||||||
"save": "保存",
|
|
||||||
"normallyOpenModeTip": "在设置的常开时间内,锁被打开后将一直处于打开的状态,直到被手动关闭",
|
|
||||||
"pleaseSelectLockVolume": "请选择锁音量",
|
|
||||||
"lockSoundTip": "功能开启后,你将可以听到智能锁的提示音。包括电量过低,密码错误等提示。",
|
|
||||||
"low": "低",
|
|
||||||
"lower": "较低",
|
|
||||||
"medium": "中",
|
|
||||||
"higher": "较高",
|
|
||||||
"high": "高",
|
|
||||||
"burglarAlarmTip": "开启后,锁被撬动时,会发出报警声",
|
|
||||||
"resetButtonTip1": "开启后,可通过长按锁上的重置键来用APP重新添加",
|
|
||||||
"resetButtonTip2": "关闭后,重置键无效,锁要通过app删除后才能重新添加",
|
|
||||||
"calibrationTime": "校准时间",
|
|
||||||
"setTheDSTMode": "夏令时模式设置",
|
|
||||||
"diagnoseTip": "诊断是读取锁内的配置信息并上传,以便工作人员分析故障的原因",
|
|
||||||
"uploading": "上传",
|
|
||||||
"uploadDataTip": "本操作将上传锁内数据到服务器,过程可能需要几分钟,请耐心等待",
|
|
||||||
"importOtherLockDataTip": "请选择要从哪把锁导入",
|
|
||||||
"haveNewVersion": "有新版本",
|
|
||||||
"currentVersion": "当前版本",
|
|
||||||
"newVersion": "新版本",
|
|
||||||
"upgrade": "升级",
|
|
||||||
"leisure": "空闲",
|
|
||||||
"checkedIn": "已入住",
|
|
||||||
"lanEnglish": "英文",
|
|
||||||
"lanChinese": "中文",
|
|
||||||
"multilingual": "多语言",
|
|
||||||
"addLock": "添加锁",
|
|
||||||
"lockAddress": "锁地址",
|
|
||||||
"selectLockType": "选择锁类型",
|
|
||||||
"videoIntercomDoorLock": "可视对讲门锁",
|
|
||||||
"NFCPassiveLock": "NFC无源锁",
|
|
||||||
"addDevice": "添加设备",
|
|
||||||
"gateway": "网关",
|
|
||||||
"message": "消息",
|
|
||||||
"supportStaff": "客服",
|
|
||||||
"set": "设置",
|
|
||||||
"moreServices": "更多服务",
|
|
||||||
"moreSet": "更多设置",
|
|
||||||
"prompTone": "提示音",
|
|
||||||
"touchUnlock": "触摸开锁",
|
|
||||||
"pushNotification": "消息推送",
|
|
||||||
"lockUserManagement": "锁用户管理",
|
|
||||||
"ownedKey": "拥有的钥匙",
|
|
||||||
"authorityManagement": "批量授权",
|
|
||||||
"associatedDevice": "关联设备",
|
|
||||||
"associatedName": "关联姓名",
|
|
||||||
"device": "设备",
|
|
||||||
"authorizedAdmin": "授权管理员",
|
|
||||||
"addAuthorizedAdmin": "添加授权管理员",
|
|
||||||
"lockGroup": "锁分组",
|
|
||||||
"transferSmartLock": "转移智能锁",
|
|
||||||
"selectiveLock": "选择锁",
|
|
||||||
"recipientInformation": "接收人信息",
|
|
||||||
"transferGateway": "转移网关",
|
|
||||||
"multiLanguage": "多语言",
|
|
||||||
"lockScreen": "锁屏",
|
|
||||||
"closed": "已关闭",
|
|
||||||
"opened": "已开启",
|
|
||||||
"close": "关闭",
|
|
||||||
"open": "开启",
|
|
||||||
"hideInvalidUnlockPermissions": "隐藏无效开锁权限",
|
|
||||||
"appUnlockRequiresMobilePhoneAccessToTheLock": "APP开锁时需手机连网的锁",
|
|
||||||
"valueAddedServices": "增值服务",
|
|
||||||
"about": "关于",
|
|
||||||
"userAgreement": "用户协议",
|
|
||||||
"privacyPolicy": "隐私政策",
|
|
||||||
"personalInformationCollectionList": "个人信息收集清单",
|
|
||||||
"applicationPermissionDescription": "应用权限说明",
|
|
||||||
"thirdPartyInformationSharingList": "第三方信息共享清单",
|
|
||||||
"logout": "退出",
|
|
||||||
"deleteAccount": "删除账号",
|
|
||||||
"personalInformation": "个人信息",
|
|
||||||
"avatar": "头像",
|
|
||||||
"nickName": "昵称",
|
|
||||||
"changeNickName": "修改昵称",
|
|
||||||
"modifyAccount": "修改账号",
|
|
||||||
>>>>>>> release
|
|
||||||
"重置密码": "重置密码",
|
"重置密码": "重置密码",
|
||||||
"安全问题": "安全问题",
|
"安全问题": "安全问题",
|
||||||
"为了你的账号安全,修改账号前请先使用验证码验证": "为了你的账号安全,修改账号前请先使用验证码验证",
|
"为了你的账号安全,修改账号前请先使用验证码验证": "为了你的账号安全,修改账号前请先使用验证码验证",
|
||||||
@ -993,6 +825,7 @@
|
|||||||
"掌静脉详情": "掌静脉详情",
|
"掌静脉详情": "掌静脉详情",
|
||||||
"掌静脉号": "掌静脉号",
|
"掌静脉号": "掌静脉号",
|
||||||
"蓝牙未打开,请到设置里面打开蓝牙": "蓝牙未打开,请到设置里面打开蓝牙",
|
"蓝牙未打开,请到设置里面打开蓝牙": "蓝牙未打开,请到设置里面打开蓝牙",
|
||||||
"删除用户时,会将用户拥有的钥匙一起删除。": "删除用户时,会将用户拥有的钥匙一起删除。"
|
"删除用户时,会将用户拥有的钥匙一起删除。": "删除用户时,会将用户拥有的钥匙一起删除。",
|
||||||
|
|
||||||
|
"配置网络": "配置网络"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@ -20,6 +22,7 @@ import 'package:star_lock/translations/trans_lib.dart';
|
|||||||
import 'app.dart';
|
import 'app.dart';
|
||||||
import 'app_settings/app_settings.dart';
|
import 'app_settings/app_settings.dart';
|
||||||
import 'tools/store_service.dart';
|
import 'tools/store_service.dart';
|
||||||
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
// 该文件不可作为编译入口,请查看 flavorizr.yaml 中的说明
|
// 该文件不可作为编译入口,请查看 flavorizr.yaml 中的说明
|
||||||
FutureOr<void> main() async {
|
FutureOr<void> main() async {
|
||||||
@ -57,6 +60,8 @@ FutureOr<void> main() async {
|
|||||||
SystemUiOverlayStyle(statusBarColor: Colors.transparent);
|
SystemUiOverlayStyle(statusBarColor: Colors.transparent);
|
||||||
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
|
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// checkChinese();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置国际化信息
|
// 设置国际化信息
|
||||||
@ -87,3 +92,27 @@ Future<void> privacySDKInitialization() async {
|
|||||||
final XSJPushProvider jpushProvider = XSJPushProvider();
|
final XSJPushProvider jpushProvider = XSJPushProvider();
|
||||||
await jpushProvider.initJPushService();
|
await jpushProvider.initJPushService();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void checkChinese(){
|
||||||
|
// 获取当前脚本的目录
|
||||||
|
final String scriptDir = path.dirname(Platform.script.path);
|
||||||
|
|
||||||
|
// 遍历这个目录下的所有 .dart 文件
|
||||||
|
findChineseCharacters(Directory(scriptDir));
|
||||||
|
}
|
||||||
|
|
||||||
|
void findChineseCharacters(Directory directory) {
|
||||||
|
final List<FileSystemEntity> files = directory.listSync(recursive: true);
|
||||||
|
for (FileSystemEntity file in files) {
|
||||||
|
if (file is File && file.path.endsWith('.dart')) {
|
||||||
|
final String content = file.readAsStringSync(encoding: utf8);
|
||||||
|
if (hasChineseCharacters(content)) {
|
||||||
|
print('Found Chinese characters in ${file.path}');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool hasChineseCharacters(String input) {
|
||||||
|
return RegExp(r'[\u4e00-\u9fa5]').hasMatch(input);
|
||||||
|
}
|
||||||
@ -6,6 +6,8 @@ import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:network_info_plus/network_info_plus.dart';
|
import 'package:network_info_plus/network_info_plus.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifiEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
import '../../../../../blue/blue_manage.dart';
|
import '../../../../../blue/blue_manage.dart';
|
||||||
@ -23,19 +25,19 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
final ConfiguringWifiState state = ConfiguringWifiState();
|
final ConfiguringWifiState state = ConfiguringWifiState();
|
||||||
|
|
||||||
Future<void> getWifiLockServiceIpAndPort() async {
|
Future<void> getWifiLockServiceIpAndPort() async {
|
||||||
var entity = await ApiRepository.to.getWifiLockServiceIpAndPort();
|
final ConfiguringWifiEntity entity = await ApiRepository.to.getWifiLockServiceIpAndPort();
|
||||||
if(entity.errorCode! == 0){
|
if(entity.errorCode! == 0){
|
||||||
state.configuringWifiEntity.value = entity;
|
state.configuringWifiEntity.value = entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateNetworkInfo() async{
|
Future<void> updateNetworkInfo() async{
|
||||||
var entity = await ApiRepository.to.updateNetworkInfo(
|
final LoginEntity entity = await ApiRepository.to.updateNetworkInfo(
|
||||||
lockId: state.lockSetInfoData.value.lockId!,
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
network:state.wifiNameController.text,
|
network:state.wifiNameController.text,
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
showToast("配网成功", something:(){
|
showToast('配网成功', something:(){
|
||||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||||
Get.close(2);
|
Get.close(2);
|
||||||
});
|
});
|
||||||
@ -45,7 +47,7 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
// 监听设备返回的数据
|
// 监听设备返回的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||||
// WIFI配网结果
|
// WIFI配网结果
|
||||||
if(reply is SenderConfiguringWifiReply) {
|
if(reply is SenderConfiguringWifiReply) {
|
||||||
_replySenderConfiguringWifi(reply);
|
_replySenderConfiguringWifi(reply);
|
||||||
@ -55,7 +57,7 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// WIFI配网结果
|
// WIFI配网结果
|
||||||
Future<void> _replySenderConfiguringWifi(Reply reply) async {
|
Future<void> _replySenderConfiguringWifi(Reply reply) async {
|
||||||
int status = reply.data[5];
|
final int status = reply.data[5];
|
||||||
|
|
||||||
switch(status){
|
switch(status){
|
||||||
case 0x00:
|
case 0x00:
|
||||||
@ -67,32 +69,32 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
final List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
var tokenData = reply.data.sublist(7, 10);
|
final List<int> tokenData = reply.data.sublist(7, 10);
|
||||||
var saveStrList = changeIntListToStringList(tokenData);
|
final List<String> saveStrList = changeIntListToStringList(tokenData);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
|
|
||||||
var serversList = <int>[];
|
final List<int> serversList = <int>[];
|
||||||
for(int i = 0; i<state.configuringWifiEntity.value.data!.serviceList!.length; i++){
|
for(int i = 0; i<state.configuringWifiEntity.value.data!.serviceList!.length; i++){
|
||||||
var item = state.configuringWifiEntity.value.data!.serviceList![i];
|
final ServiceList item = state.configuringWifiEntity.value.data!.serviceList![i];
|
||||||
var itemList = item.serviceIp!.split(".");
|
final List<String> itemList = item.serviceIp!.split('.');
|
||||||
for (var element in itemList) {
|
for (String element in itemList) {
|
||||||
serversList.add(int.parse(element));
|
serversList.add(int.parse(element));
|
||||||
}
|
}
|
||||||
|
|
||||||
double typeDouble = int.parse(item.port!) / 256;
|
final double typeDouble = int.parse(item.port!) / 256;
|
||||||
int type1 = typeDouble.toInt();
|
final int type1 = typeDouble.toInt();
|
||||||
int type2 = int.parse(item.port!) % 256;
|
final int type2 = int.parse(item.port!) % 256;
|
||||||
serversList.add(type1);
|
serversList.add(type1);
|
||||||
serversList.add(type2);
|
serversList.add(type2);
|
||||||
}
|
}
|
||||||
|
|
||||||
var uidList = [Storage.getUid().toString()];
|
final List<String> uidList = <String>[Storage.getUid().toString()];
|
||||||
IoSenderManage.senderConfiguringWifiCommand(
|
IoSenderManage.senderConfiguringWifiCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
@ -111,7 +113,7 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
break;
|
break;
|
||||||
case 0xff:
|
case 0xff:
|
||||||
//成功
|
//成功
|
||||||
showToast("配网失败");
|
showToast('配网失败');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
@ -122,7 +124,7 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
// 点击配置wifi
|
// 点击配置wifi
|
||||||
Future<void> senderConfiguringWifiAction() async {
|
Future<void> senderConfiguringWifiAction() async {
|
||||||
if(state.wifiNameController.text.isEmpty){
|
if(state.wifiNameController.text.isEmpty){
|
||||||
showToast("请输入wifi名称");
|
showToast('请输入wifi名称');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,40 +140,40 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected){
|
if (connectionState == BluetoothConnectionState.connected){
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
final List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
var serversList = <int>[];
|
final List<int> serversList = <int>[];
|
||||||
for(int i = 0; i<state.configuringWifiEntity.value.data!.serviceList!.length; i++){
|
for(int i = 0; i<state.configuringWifiEntity.value.data!.serviceList!.length; i++){
|
||||||
var item = state.configuringWifiEntity.value.data!.serviceList![i];
|
final ServiceList item = state.configuringWifiEntity.value.data!.serviceList![i];
|
||||||
if(item.serviceIp!.contains("192")){
|
if(item.serviceIp!.contains('192')){
|
||||||
var itemList = item.serviceIp!.split(".");
|
final List<String> itemList = item.serviceIp!.split('.');
|
||||||
for (var element in itemList) {
|
for (String element in itemList) {
|
||||||
serversList.add(int.parse(element));
|
serversList.add(int.parse(element));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
List<InternetAddress> addresses = await InternetAddress.lookup(item.serviceIp!);
|
final List<InternetAddress> addresses = await InternetAddress.lookup(item.serviceIp!);
|
||||||
var itemList = addresses.first.address.split(".");
|
final List<String> itemList = addresses.first.address.split('.');
|
||||||
for (var element in itemList) {
|
for (String element in itemList) {
|
||||||
serversList.add(int.parse(element));
|
serversList.add(int.parse(element));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double typeDouble = int.parse(item.port!) / 256;
|
final double typeDouble = int.parse(item.port!) / 256;
|
||||||
int type1 = typeDouble.toInt();
|
final int type1 = typeDouble.toInt();
|
||||||
int type2 = int.parse(item.port!) % 256;
|
final int type2 = int.parse(item.port!) % 256;
|
||||||
serversList.add(type1);
|
serversList.add(type1);
|
||||||
serversList.add(type2);
|
serversList.add(type2);
|
||||||
}
|
}
|
||||||
|
|
||||||
var uidStr = await Storage.getUid();
|
final String? uidStr = await Storage.getUid();
|
||||||
var uidList = [uidStr.toString()];
|
final List<String> uidList = <String>[uidStr.toString()];
|
||||||
IoSenderManage.senderConfiguringWifiCommand(
|
IoSenderManage.senderConfiguringWifiCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
@ -197,9 +199,9 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
final _networkInfo = NetworkInfo();
|
final NetworkInfo _networkInfo = NetworkInfo();
|
||||||
Future<String> getWifiName() async {
|
Future<String> getWifiName() async {
|
||||||
var ssid = '';
|
String ssid = '';
|
||||||
ssid = (await _networkInfo.getWifiName())!;
|
ssid = (await _networkInfo.getWifiName())!;
|
||||||
ssid = ssid ?? '';
|
ssid = ssid ?? '';
|
||||||
ssid = ssid.replaceAll(r'"', '');
|
ssid = ssid.replaceAll(r'"', '');
|
||||||
@ -208,8 +210,8 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
|
|
||||||
///定位权限
|
///定位权限
|
||||||
Future<bool> checkLocationPermission() async {
|
Future<bool> checkLocationPermission() async {
|
||||||
PermissionStatus value = await locationPermission();
|
final PermissionStatus value = await locationPermission();
|
||||||
bool allow = value != PermissionStatus.permanentlyDenied && value != PermissionStatus.denied;
|
final bool allow = value != PermissionStatus.permanentlyDenied && value != PermissionStatus.denied;
|
||||||
return allow;
|
return allow;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,11 +219,10 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|
||||||
if(state.wifiName.value.isEmpty){
|
if(state.wifiName.value.isEmpty){
|
||||||
getWifiName().then((value) {
|
getWifiName().then((String value) {
|
||||||
state.wifiNameController.text = value;
|
state.wifiNameController.text = value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -232,13 +233,11 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
// TODO: implement onInit
|
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
// TODO: implement onClose
|
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
super.onClose();
|
super.onClose();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,24 +6,24 @@ import '../../lockSet/lockSetInfo_entity.dart';
|
|||||||
import 'configuringWifiEntity.dart';
|
import 'configuringWifiEntity.dart';
|
||||||
|
|
||||||
class ConfiguringWifiState{
|
class ConfiguringWifiState{
|
||||||
var configuringWifiEntity = ConfiguringWifiEntity().obs;
|
|
||||||
var lockSetInfoData = LockSetInfoData().obs;
|
|
||||||
var lockBasicInfo = LockBasicInfo().obs;
|
|
||||||
|
|
||||||
var wifiName = "".obs;
|
|
||||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
|
||||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
|
||||||
|
|
||||||
TextEditingController wifiNameController = TextEditingController();
|
|
||||||
TextEditingController wifiPWDController = TextEditingController();
|
|
||||||
ConfiguringWifiState() {
|
ConfiguringWifiState() {
|
||||||
var map = Get.arguments;
|
var map = Get.arguments;
|
||||||
lockSetInfoData.value = map["lockSetInfoData"];
|
lockSetInfoData.value = map['lockSetInfoData'];
|
||||||
lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!;
|
lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!;
|
||||||
if ((map["wifiName"] != null)) {
|
if (map['wifiName'] != null) {
|
||||||
wifiName.value = map["wifiName"];
|
wifiName.value = map['wifiName'];
|
||||||
wifiNameController.text = wifiName.value;
|
wifiNameController.text = wifiName.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Rx<ConfiguringWifiEntity> configuringWifiEntity = ConfiguringWifiEntity().obs;
|
||||||
|
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
|
||||||
|
Rx<LockBasicInfo> lockBasicInfo = LockBasicInfo().obs;
|
||||||
|
|
||||||
|
RxString wifiName = ''.obs;
|
||||||
|
RxBool ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||||
|
RxInt sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
||||||
|
|
||||||
|
TextEditingController wifiNameController = TextEditingController();
|
||||||
|
TextEditingController wifiPWDController = TextEditingController();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -20,7 +20,7 @@ class WifiListLogic extends BaseGetXController {
|
|||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
|
||||||
if(reply is SenderGetWifiReply) {
|
if(reply is SenderGetWifiReply) {
|
||||||
_replySendGetWifiParameters(reply);
|
_replySendGetWifiParameters(reply);
|
||||||
}
|
}
|
||||||
@ -33,15 +33,13 @@ class WifiListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 发送获取wifi列表数据解析
|
// 发送获取wifi列表数据解析
|
||||||
Future<void> _replySendGetWifiParameters(Reply reply) async {
|
Future<void> _replySendGetWifiParameters(Reply reply) async {
|
||||||
int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch(status){
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
Future.delayed(5.seconds, (){
|
Future.delayed(5.seconds, dismissEasyLoading);
|
||||||
dismissEasyLoading();
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
// 需要鉴权
|
// 需要鉴权
|
||||||
@ -71,7 +69,7 @@ class WifiListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 设置自动落锁数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replyGetWifiListParameters(Reply reply) async {
|
Future<void> _replyGetWifiListParameters(Reply reply) async {
|
||||||
int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch(status){
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
@ -82,14 +80,14 @@ class WifiListLogic extends BaseGetXController {
|
|||||||
if (reply.data[6] > 0) {
|
if (reply.data[6] > 0) {
|
||||||
reply.data.removeRange(0, 7);
|
reply.data.removeRange(0, 7);
|
||||||
// 把得到的数据按33位分割成数组 然后塞进一个新的数组里面
|
// 把得到的数据按33位分割成数组 然后塞进一个新的数组里面
|
||||||
var getList = splitList(reply.data, 33);
|
final List<List<int>> getList = splitList(reply.data, 33);
|
||||||
var uploadList = <Map<String, String>>[];
|
final List<Map<String, String>> uploadList = <Map<String, String>>[];
|
||||||
for (int i = 0; i < getList.length; i++) {
|
for (int i = 0; i < getList.length; i++) {
|
||||||
var indexList = getList[i];
|
final List<int> indexList = getList[i];
|
||||||
var indexMap = <String, String>{};
|
final Map<String, String> indexMap = <String, String>{};
|
||||||
var wifiName = indexList.sublist(0, 32);
|
final List<int> wifiName = indexList.sublist(0, 32);
|
||||||
indexMap["wifiName"] = utf8String(wifiName);
|
indexMap['wifiName'] = utf8String(wifiName);
|
||||||
indexMap["rssi"] = (indexList.last - 255).toString();
|
indexMap['rssi'] = (indexList.last - 255).toString();
|
||||||
uploadList.add(indexMap);
|
uploadList.add(indexMap);
|
||||||
state.wifiNameDataList.value = uploadList;
|
state.wifiNameDataList.value = uploadList;
|
||||||
}
|
}
|
||||||
@ -115,14 +113,14 @@ class WifiListLogic extends BaseGetXController {
|
|||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected){
|
if (connectionState == BluetoothConnectionState.connected){
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
final List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
IoSenderManage.getWifiListCommand(
|
IoSenderManage.getWifiListCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
@ -145,7 +143,6 @@ class WifiListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|
||||||
_initReplySubscription();
|
_initReplySubscription();
|
||||||
@ -153,7 +150,6 @@ class WifiListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
// TODO: implement onInit
|
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
senderGetWifiListWifiAction();
|
senderGetWifiListWifiAction();
|
||||||
@ -161,7 +157,6 @@ class WifiListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
// TODO: implement onClose
|
|
||||||
super.onClose();
|
super.onClose();
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,16 +3,16 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
import '../../lockSet/lockSetInfo_entity.dart';
|
import '../../lockSet/lockSetInfo_entity.dart';
|
||||||
|
|
||||||
class WifiListState{
|
class WifiListState{// 0普通状态(可用) 1连接中(不可用)
|
||||||
final wifiNameDataList = <Map<String, String>>[].obs;
|
|
||||||
var lockSetInfoData = LockSetInfoData().obs;
|
|
||||||
var lockBasicInfo = LockBasicInfo().obs;
|
|
||||||
|
|
||||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
|
||||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
|
||||||
WifiListState() {
|
WifiListState() {
|
||||||
var map = Get.arguments;
|
final map = Get.arguments;
|
||||||
lockSetInfoData.value = map["lockSetInfoData"];
|
lockSetInfoData.value = map['lockSetInfoData'];
|
||||||
lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!;
|
lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!;
|
||||||
}
|
}
|
||||||
|
final RxList<Map<String, String>> wifiNameDataList = <Map<String, String>>[].obs;
|
||||||
|
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
|
||||||
|
Rx<LockBasicInfo> lockBasicInfo = LockBasicInfo().obs;
|
||||||
|
|
||||||
|
RxBool ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||||
|
RxInt sureBtnState = 0.obs;
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ class _SelectLockTypePageState extends State<SelectLockTypePage> with BaseWidget
|
|||||||
lockTypeItem('images/lockType/lockType_gatewayLock.png',
|
lockTypeItem('images/lockType/lockType_gatewayLock.png',
|
||||||
'网关'.tr, () {
|
'网关'.tr, () {
|
||||||
CommonDataManage().seletLockType = 7;
|
CommonDataManage().seletLockType = 7;
|
||||||
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
Get.toNamed(Routers.selectGatewayTypeNextTipPage);
|
||||||
}),
|
}),
|
||||||
if (!F.isLite)
|
if (!F.isLite)
|
||||||
lockTypeItem('images/lockType/lockType_camera.png', '网络摄像头'.tr, () {
|
lockTypeItem('images/lockType/lockType_camera.png', '网络摄像头'.tr, () {
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'gatewayConfigurationWifi_state.dart';
|
||||||
|
|
||||||
|
class GatewayConfigurationWifiLogic extends BaseGetXController {
|
||||||
|
GatewayConfigurationWifiState state = GatewayConfigurationWifiState();
|
||||||
|
|
||||||
|
}
|
||||||
@ -8,6 +8,8 @@ import '../../../../tools/commonItem.dart';
|
|||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'gatewayConfigurationWifi_logic.dart';
|
||||||
|
import 'gatewayConfigurationWifi_state.dart';
|
||||||
|
|
||||||
class GatewayConfigurationWifiPage extends StatefulWidget {
|
class GatewayConfigurationWifiPage extends StatefulWidget {
|
||||||
const GatewayConfigurationWifiPage({Key? key}) : super(key: key);
|
const GatewayConfigurationWifiPage({Key? key}) : super(key: key);
|
||||||
@ -18,28 +20,28 @@ class GatewayConfigurationWifiPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _GatewayConfigurationWifiPageState extends State<GatewayConfigurationWifiPage> {
|
class _GatewayConfigurationWifiPageState extends State<GatewayConfigurationWifiPage> {
|
||||||
final TextEditingController _wifiPassward = TextEditingController();
|
final GatewayConfigurationWifiLogic logic = Get.put(GatewayConfigurationWifiLogic());
|
||||||
final TextEditingController _gatewayNamePassward = TextEditingController();
|
final GatewayConfigurationWifiState state = Get.find<GatewayConfigurationWifiLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: '网关'.tr,
|
barTitle: '配置网络'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
// Container(
|
||||||
width: 1.sw,
|
// width: 1.sw,
|
||||||
color: const Color(0xFFF2F6F9),
|
// color: const Color(0xFFF2F6F9),
|
||||||
padding: EdgeInsets.all(15.h),
|
// padding: EdgeInsets.all(15.h),
|
||||||
child: Text(
|
// child: Text(
|
||||||
'不支持5G WiFi网络,请选择2.4G WiFi网络进行配置'.tr,
|
// '不支持5G WiFi网络,请选择2.4G WiFi网络进行配置'.tr,
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
// color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||||
)),
|
// )),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -57,7 +59,7 @@ class _GatewayConfigurationWifiPageState extends State<GatewayConfigurationWifiP
|
|||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(
|
rightWidget: getTFWidget(
|
||||||
_wifiPassward,
|
state.wifiPasswardTF,
|
||||||
'请输入WiFi密码'.tr)),
|
'请输入WiFi密码'.tr)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
@ -66,7 +68,7 @@ class _GatewayConfigurationWifiPageState extends State<GatewayConfigurationWifiP
|
|||||||
leftTitel: '网关名称'.tr,
|
leftTitel: '网关名称'.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(_gatewayNamePassward,
|
rightWidget: getTFWidget(state.gatewayNamePasswardTF,
|
||||||
'请输入网关名称'.tr)),
|
'请输入网关名称'.tr)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
@ -74,42 +76,45 @@ class _GatewayConfigurationWifiPageState extends State<GatewayConfigurationWifiP
|
|||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '网络MAC'.tr,
|
leftTitel: '网络MAC'.tr,
|
||||||
rightTitle: '48:55:19:7d:84:7a',
|
rightTitle: '48:55:19:7d:84:7a',
|
||||||
allHeight: 100.h,
|
// allHeight: 100.h,
|
||||||
isHaveLine: false),
|
isHaveLine: false),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
Visibility(
|
Obx(() => Visibility(
|
||||||
visible: true,
|
visible: state.isUseStaticIP.value,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: 'IP地址'.tr,
|
leftTitel: 'IP地址'.tr,
|
||||||
rightTitle: '192.168.1.1',
|
// rightTitle: '192.168.1.1',
|
||||||
allHeight: 100.h,
|
isHaveLine: true,
|
||||||
isHaveLine: true),
|
isHaveRightWidget: true,
|
||||||
CommonItem(
|
rightWidget: getTFWidget(state.ipAddressTF, '请输入IP地址')
|
||||||
leftTitel: '子网掩码'.tr,
|
|
||||||
rightTitle: '255.255.255.0',
|
|
||||||
allHeight: 100.h,
|
|
||||||
isHaveLine: true),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: '默认网关'.tr,
|
|
||||||
rightTitle: '192.168.1.1',
|
|
||||||
allHeight: 100.h,
|
|
||||||
isHaveLine: true),
|
|
||||||
SizedBox(
|
|
||||||
height: 10.h,
|
|
||||||
),
|
),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
|
leftTitel: '子网掩码'.tr,
|
||||||
|
// rightTitle: '255.255.255.0',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: getTFWidget(state.subnetMaskTF, '请输入子网掩码')),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '默认网关'.tr,
|
||||||
|
// rightTitle: '192.168.1.1',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: getTFWidget(state.defaultGatewayTF, '请输入默认网关')
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h,),
|
||||||
|
Obx(() => CommonItem(
|
||||||
leftTitel: '自动获取DNS服务器地址'.tr,
|
leftTitel: '自动获取DNS服务器地址'.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
width: 60.w, height: 50.h, child: _switch())),
|
width: 60.w, height: 50.h, child: _switch()))),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: true,
|
visible: !state.isAutomaticallyGetDNSServerAddress.value,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
@ -118,23 +123,21 @@ class _GatewayConfigurationWifiPageState extends State<GatewayConfigurationWifiP
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(
|
rightWidget: getTFWidget(
|
||||||
_gatewayNamePassward,
|
state.firstChoiceDNSTF,
|
||||||
'请输入'.tr,)),
|
'请输入'.tr)),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '备选DNS'.tr,
|
leftTitel: '备选DNS'.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(
|
rightWidget: getTFWidget(
|
||||||
_gatewayNamePassward,
|
state.alternativeDNSTF,
|
||||||
'请输入'.tr,)),
|
'请输入'.tr,)),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
)),
|
))),
|
||||||
SizedBox(
|
SizedBox(height: 50.h),
|
||||||
height: 50.h,
|
|
||||||
),
|
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||||
child: SubmitBtn(
|
child: SubmitBtn(
|
||||||
@ -147,28 +150,29 @@ class _GatewayConfigurationWifiPageState extends State<GatewayConfigurationWifiP
|
|||||||
// Navigator.pushNamed(context, Routers.selectGatewayPage);
|
// Navigator.pushNamed(context, Routers.selectGatewayPage);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(height: 10.h),
|
||||||
height: 10.h,
|
|
||||||
),
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
GestureDetector(
|
Obx(() => GestureDetector(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
// width: 150.w,
|
// width: 150.w,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
// color: Colors.red,
|
// color: Colors.red,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'不使用静态IP'.tr,
|
state.isUseStaticIP.value
|
||||||
|
? '不使用静态IP'.tr
|
||||||
|
: '使用静态IP'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp, color: AppColors.mainColor)),
|
fontSize: 22.sp, color: AppColors.mainColor)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Navigator.pushNamed(context, Routers.starLockForgetPasswordPage);
|
state.isUseStaticIP.value = !state.isUseStaticIP.value;
|
||||||
|
|
||||||
},
|
},
|
||||||
),
|
)),
|
||||||
SizedBox(width: 30.w),
|
SizedBox(width: 30.w),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -199,11 +203,21 @@ class _GatewayConfigurationWifiPageState extends State<GatewayConfigurationWifiP
|
|||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
|
||||||
hintText: tfStr,
|
hintText: tfStr,
|
||||||
hintStyle: TextStyle(fontSize: 22.sp),
|
hintStyle: TextStyle(fontSize: 22.sp),
|
||||||
//不需要输入框下划线
|
focusedBorder: const OutlineInputBorder(
|
||||||
border: InputBorder.none,
|
borderSide:
|
||||||
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
|
disabledBorder: const OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
|
enabledBorder: const OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -216,16 +230,13 @@ class _GatewayConfigurationWifiPageState extends State<GatewayConfigurationWifiP
|
|||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _switch() {
|
CupertinoSwitch _switch() {
|
||||||
bool _isOn = false;
|
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: _isOn,
|
value: state.isAutomaticallyGetDNSServerAddress.value,
|
||||||
onChanged: (bool value) {
|
onChanged: (bool value) {
|
||||||
setState(() {
|
state.isAutomaticallyGetDNSServerAddress.value = !state.isAutomaticallyGetDNSServerAddress.value;
|
||||||
_isOn = value;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class GatewayConfigurationWifiState{
|
||||||
|
RxBool isUseStaticIP = false.obs;
|
||||||
|
final TextEditingController wifiPasswardTF = TextEditingController();
|
||||||
|
final TextEditingController gatewayNamePasswardTF = TextEditingController();
|
||||||
|
final TextEditingController ipAddressTF = TextEditingController();
|
||||||
|
final TextEditingController subnetMaskTF = TextEditingController();
|
||||||
|
final TextEditingController defaultGatewayTF = TextEditingController();
|
||||||
|
|
||||||
|
RxBool isAutomaticallyGetDNSServerAddress = true.obs;
|
||||||
|
final TextEditingController firstChoiceDNSTF = TextEditingController();
|
||||||
|
final TextEditingController alternativeDNSTF = TextEditingController();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -20,14 +20,18 @@ class _GatewayConnectionLockListPageState extends State<GatewayConnectionLockLis
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(barTitle: '网关'.tr, haveBack:true, backgroundColor: AppColors.mainColor),
|
appBar: TitleAppBar(
|
||||||
|
barTitle: '网关'.tr,
|
||||||
|
haveBack:true,
|
||||||
|
backgroundColor: AppColors.mainColor
|
||||||
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
color: Colors.grey.shade300,
|
color: Colors.grey.shade300,
|
||||||
padding: EdgeInsets.all(15.h),
|
padding: EdgeInsets.all(10.h),
|
||||||
child: Text('网关连接的锁'.tr)
|
child: Text('网关连接的锁'.tr, style: TextStyle(fontSize: 24.sp))
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@ -50,15 +54,14 @@ class _GatewayConnectionLockListPageState extends State<GatewayConnectionLockLis
|
|||||||
child: Container(
|
child: Container(
|
||||||
// height: 100.h,
|
// height: 100.h,
|
||||||
margin: const EdgeInsets.only(bottom: 2),
|
margin: const EdgeInsets.only(bottom: 2),
|
||||||
padding: EdgeInsets.only(left: 10.w, right: 20.w, top: 20.h, bottom: 20.h),
|
padding: EdgeInsets.only(left: 15.w, right: 20.w, top: 15.h, bottom: 15.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(10.w),
|
borderRadius: BorderRadius.circular(10.w),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 10.w,),
|
Image.asset(lockTypeIcon, width: 70.w, height: 70.w,),
|
||||||
Image.asset(lockTypeIcon, width: 90.w, height: 90.w,),
|
|
||||||
SizedBox(width: 20.w,),
|
SizedBox(width: 20.w,),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -69,7 +72,7 @@ class _GatewayConnectionLockListPageState extends State<GatewayConnectionLockLis
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(gateWayName, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ),
|
Text(gateWayName, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -78,9 +81,9 @@ class _GatewayConnectionLockListPageState extends State<GatewayConnectionLockLis
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Image.asset('images/mine/icon_mine_gatewaySignal_strong.png', width: 40.w, height: 40.w,),
|
Image.asset('images/mine/icon_mine_gatewaySignal_strong.png', width: 30.w, height: 30.w,),
|
||||||
SizedBox(width: 10.w,),
|
SizedBox(width: 10.w,),
|
||||||
Text(signalStrength, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ),
|
Text(signalStrength, style: TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w500), ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class _GatewayListPageState extends State<GatewayListPage> {
|
|||||||
actionsList: [
|
actionsList: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(context, Routers.selectGatewayTypePage);
|
Get.toNamed(Routers.selectGatewayTypeNextTipPage);
|
||||||
},
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'images/icon_add_white.png',
|
'images/icon_add_white.png',
|
||||||
|
|||||||
@ -230,6 +230,14 @@ class _MineSetPageState extends State<MineSetPage>
|
|||||||
Get.toNamed(Routers.authorityManagementPage);
|
Get.toNamed(Routers.authorityManagementPage);
|
||||||
// Toast.show(msg: "功能暂未开放");
|
// Toast.show(msg: "功能暂未开放");
|
||||||
}),
|
}),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '网关'.tr,
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Get.toNamed(Routers.gatewayListPage);
|
||||||
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '锁分组'.tr,
|
leftTitel: '锁分组'.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user