This commit is contained in:
魏少阳 2024-03-06 17:54:24 +08:00
commit 8f5a72b89f
25 changed files with 348 additions and 200 deletions

View File

@ -56,11 +56,13 @@ android {
dev { dev {
dimension "flavor-type" dimension "flavor-type"
applicationId "com.starlock.lock.dev" applicationId "com.starlock.lock.dev"
signingConfig signingConfigs.pre
resValue "string", "app_name", "星锁-dev" resValue "string", "app_name", "星锁-dev"
} }
pre { pre {
dimension "flavor-type" dimension "flavor-type"
applicationId "com.starlock.lock.pre" applicationId "com.starlock.lock.pre"
signingConfig signingConfigs.pre
resValue "string", "app_name", "星锁" resValue "string", "app_name", "星锁"
} }
sky { sky {
@ -104,18 +106,13 @@ android {
defaultConfig { defaultConfig {
applicationId "cn.starlock.lock"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
// minSdkVersion flutter.minSdkVersion
// targetSdkVersion flutter.targetSdkVersion
minSdkVersion 25 minSdkVersion 25
targetSdkVersion 33 targetSdkVersion 33
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
signingConfig signingConfigs.sky
// 使 flutter build apk --split-per-abi // 使 flutter build apk --split-per-abi
// ndk在同一个个包中包含多个架构 // ndk在同一个个包中包含多个架构
// NDK配置使flutter run .apk包 // NDK配置使flutter run .apk包
@ -133,19 +130,21 @@ android {
universalApk true universalApk true
} }
} }
}// /Users/sky/app-starlock/star_lock/android/app/sky.jks }
buildTypes { buildTypes {
release { release {
// release编译模式下应用闪退[Debug模式下运行正常但是打Release包时则闪退解决办法](https://blog.csdn.net/weixin_39370093/article/details/109631210)
// release模式设置混淆可以解决地图闪退问题
//
minifyEnabled false
shrinkResources false
productFlavors.dev.signingConfig signingConfigs.pre productFlavors.dev.signingConfig signingConfigs.pre
productFlavors.pre.signingConfig signingConfigs.pre productFlavors.pre.signingConfig signingConfigs.pre
productFlavors.sky.signingConfig signingConfigs.sky productFlavors.sky.signingConfig signingConfigs.sky
productFlavors.xhj.signingConfig signingConfigs.xhj productFlavors.xhj.signingConfig signingConfigs.xhj
} }
debug { debug {
productFlavors.dev.signingConfig signingConfigs.pre signingConfig signingConfigs.pre
productFlavors.pre.signingConfig signingConfigs.pre
productFlavors.sky.signingConfig signingConfigs.sky
productFlavors.xhj.signingConfig signingConfigs.xhj
} }
} }
} }

View File

@ -1,8 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.star_lock">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@ -58,6 +58,27 @@
<meta-data android:name="com.alibaba.app.appkey" android:value="333904040"/> <meta-data android:name="com.alibaba.app.appkey" android:value="333904040"/>
<!-- 请填写你自己的appSecret --> <!-- 请填写你自己的appSecret -->
<meta-data android:name="com.alibaba.app.appsecret" android:value="c316965fe0a74fc9a481a5c44a535dc2"/> <meta-data android:name="com.alibaba.app.appsecret" android:value="c316965fe0a74fc9a481a5c44a535dc2"/>
<!-- 华为通道的参数appid -->
<meta-data android:name="com.huawei.hms.client.appid" android:value="appid=xxxxx"/>
<!-- vivo通道的参数api_key为appkey -->
<meta-data android:name="com.vivo.push.api_key" android:value=""/>
<meta-data android:name="com.vivo.push.app_id" android:value=""/>
<!-- honor通道的参数-->
<meta-data android:name="com.hihonor.push.app_id" android:value=""/>
<!-- oppo -->
<meta-data android:name="com.oppo.push.key" android:value=""/>
<meta-data android:name="com.oppo.push.secret" android:value=""/>
<!-- 小米-->
<meta-data android:name="com.xiaomi.push.id" android:value="id=2222222222222222222"/>
<meta-data android:name="com.xiaomi.push.key" android:value="id=5555555555555"/>
<!-- 魅族-->
<meta-data android:name="com.meizu.push.id" android:value=""/>
<meta-data android:name="com.meizu.push.key" android:value=""/>
<!-- fcm -->
<meta-data android:name="com.gcm.push.sendid" android:value="id=999999999999"/>
<meta-data android:name="com.gcm.push.applicationid" android:value=""/>
<meta-data android:name="com.gcm.push.projectid" android:value=""/>
<meta-data android:name="com.gcm.push.api.key" android:value=""/>
<!-- 消息接收监听器 (用户可自主扩展) --> <!-- 消息接收监听器 (用户可自主扩展) -->
<receiver android:name="cn.starlock.lock.MyMessageReceiver" android:exported="false"> <receiver android:name="cn.starlock.lock.MyMessageReceiver" android:exported="false">
<!-- 为保证receiver安全建议设置不可导出如需对其他应用开放可通过androidpermission进行限制 --> <!-- 为保证receiver安全建议设置不可导出如需对其他应用开放可通过androidpermission进行限制 -->

View File

@ -1,62 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.star_lock"
xmlns:tools="http://schemas.android.com/tools">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="星锁" android:name="${applicationName}" android:icon="@mipmap/ic_logo">
<!-- 请填写你自己的- appKey -->
<meta-data android:name="com.alibaba.app.appkey" android:value="333904040"/>
<!-- 请填写你自己的appSecret -->
<meta-data android:name="com.alibaba.app.appsecret" android:value="c316965fe0a74fc9a481a5c44a535dc2"/>
<!-- 华为通道的参数appid -->
<meta-data android:name="com.huawei.hms.client.appid" android:value="appid=xxxxx" />
<!-- vivo通道的参数api_key为appkey -->
<meta-data android:name="com.vivo.push.api_key" android:value="" />
<meta-data android:name="com.vivo.push.app_id" android:value="" />
<!-- honor通道的参数-->
<meta-data android:name="com.hihonor.push.app_id" android:value="" />
<!-- oppo -->
<meta-data android:name="com.oppo.push.key" android:value="" />
<meta-data android:name="com.oppo.push.secret" android:value="" />
<!-- 小米-->
<meta-data android:name="com.xiaomi.push.id" android:value="id=2222222222222222222" />
<meta-data android:name="com.xiaomi.push.key" android:value="id=5555555555555" />
<!-- 魅族-->
<meta-data android:name="com.meizu.push.id" android:value="" />
<meta-data android:name="com.meizu.push.key" android:value="" />
<!-- fcm -->
<meta-data android:name="com.gcm.push.sendid" android:value="id=999999999999" />
<meta-data android:name="com.gcm.push.applicationid" android:value="" />
<meta-data android:name="com.gcm.push.projectid" android:value="" />
<meta-data android:name="com.gcm.push.api.key" android:value="" />
<!-- 消息接收监听器 (用户可自主扩展) -->
<receiver
android:name="cn.starlock.lock.MyMessageReceiver"
android:exported="false" > <!-- 为保证receiver安全建议设置不可导出如需对其他应用开放可通过androidpermission进行限制 -->
<intent-filter>
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
</intent-filter>
<intent-filter>
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
</intent-filter>
<intent-filter>
<action android:name="com.alibaba.sdk.android.push.RECEIVE" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@ -57,6 +57,8 @@ flavors:
icon: "assets/icon/dev.png" icon: "assets/icon/dev.png"
android: android:
applicationId: "com.starlock.lock.dev" applicationId: "com.starlock.lock.dev"
customConfig:
signingConfig: signingConfigs.pre
ios: ios:
bundleId: "com.starlock.lock.dev" bundleId: "com.starlock.lock.dev"
pre: pre:
@ -65,6 +67,8 @@ flavors:
icon: "assets/icon/pre.png" icon: "assets/icon/pre.png"
android: android:
applicationId: "com.starlock.lock.pre" applicationId: "com.starlock.lock.pre"
customConfig:
signingConfig: signingConfigs.pre
ios: ios:
bundleId: "com.starlock.lock.pre" bundleId: "com.starlock.lock.pre"
sky: sky:

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -1,6 +1,7 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart'; import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
import 'package:star_lock/login/register/starLock_register_binding.dart'; import 'package:star_lock/login/register/starLock_register_binding.dart';
import 'package:star_lock/main/accessoriesList/accessoriesList_page.dart';
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart'; import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart';
@ -186,7 +187,7 @@ abstract class Routers {
static const starLockMain = '/StarLockMain'; // static const starLockMain = '/StarLockMain'; //
static const starLockMinePage = '/StarLockMinePage'; // static const starLockMinePage = '/StarLockMinePage'; //
static const selectLockTypePage = '/SelectLockTypePage'; // static const selectLockTypePage = '/SelectLockTypePage'; //
static const LockMallPage = '/LockMallPage'; // static const lockMallPage = '/LockMallPage'; //
static const addLockPage = '/AddLockPage'; // static const addLockPage = '/AddLockPage'; //
static const nearbyLockPage = '/NearbyLockPage'; // static const nearbyLockPage = '/NearbyLockPage'; //
static const lockAddressPage = '/LockAddressPage'; // static const lockAddressPage = '/LockAddressPage'; //
@ -424,6 +425,8 @@ abstract class Routers {
static const catEyeCustomModePage = '/catEyeCustomModePage'; // static const catEyeCustomModePage = '/catEyeCustomModePage'; //
static const videoSlotPage = '/videoSlotPage'; // static const videoSlotPage = '/videoSlotPage'; //
static const liveVideoPage = '/liveVideoPage'; // static const liveVideoPage = '/liveVideoPage'; //
static const accessoriesListPage = '/accessoriesListPage'; //
} }
abstract class AppRouters { abstract class AppRouters {
@ -445,7 +448,7 @@ abstract class AppRouters {
page: () => const SelectLockTypePage(), page: () => const SelectLockTypePage(),
), ),
GetPage( GetPage(
name: Routers.LockMallPage, name: Routers.lockMallPage,
page: () => const LockMallPage(), page: () => const LockMallPage(),
), ),
GetPage( GetPage(
@ -1024,5 +1027,8 @@ abstract class AppRouters {
GetPage( GetPage(
name: Routers.messageDetailPage, name: Routers.messageDetailPage,
page: (() => const MessageDetailPage())), page: (() => const MessageDetailPage())),
GetPage(
name: Routers.accessoriesListPage,
page: (() => const AccessoriesListPage()))
]; ];
} }

View File

@ -49,18 +49,26 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
children: [ children: [
Container( Container(
padding: EdgeInsets.all(10.w), padding: EdgeInsets.all(10.w),
child: Center(child: Image.asset('images/icon_main_1024.png', width: 110.w, height: 110.w))), child: Center(
child: Image.asset('images/icon_main_1024.png',
width: 110.w, height: 110.w))),
SizedBox(height: 50.w), SizedBox(height: 50.w),
LoginInput( LoginInput(
controller: state.emailOrPhoneController, controller: state.emailOrPhoneController,
onchangeAction: (v){ onchangeAction: (v) {
logic.checkNext(state.emailOrPhoneController); logic.checkNext(state.emailOrPhoneController);
}, },
leftWidget: Padding( leftWidget: Padding(
padding: EdgeInsets.only(top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), padding: EdgeInsets.only(
child: Image.asset('images/icon_login_account.png', width: 36.w, height: 36.w,), top: 30.w, bottom: 20.w, right: 20.w, left: 5.w),
child: Image.asset(
'images/icon_login_account.png',
width: 36.w,
height: 36.w,
),
), ),
hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, hintText:
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
inputFormatters: [ inputFormatters: [
// FilteringTextInputFormatter.allow(RegExp('[0-9]')), // FilteringTextInputFormatter.allow(RegExp('[0-9]')),
@ -69,15 +77,21 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
SizedBox(height: 10.h), SizedBox(height: 10.h),
LoginInput( LoginInput(
controller: state.pwdController, controller: state.pwdController,
onchangeAction: (v){ onchangeAction: (v) {
logic.checkNext(state.pwdController); logic.checkNext(state.pwdController);
}, },
isPwd: true, isPwd: true,
leftWidget: Padding( leftWidget: Padding(
padding: EdgeInsets.only(top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), padding: EdgeInsets.only(
child: Image.asset('images/icon_login_password.png', width: 36.w, height: 36.w,), top: 30.w, bottom: 20.w, right: 20.w, left: 5.w),
child: Image.asset(
'images/icon_login_password.png',
width: 36.w,
height: 36.w,
),
), ),
hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}", hintText:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}",
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(20), LengthLimitingTextInputFormatter(20),
]), ]),
@ -86,41 +100,55 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Obx(() => GestureDetector( Obx(() => GestureDetector(
onTap: (){ onTap: () {
state.agree.value = !state.agree.value; state.agree.value = !state.agree.value;
logic.changeAgreeState(); logic.changeAgreeState();
}, },
child: Image.asset(state.agree.value ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,) child: Image.asset(
)), state.agree.value
SizedBox(width: 15.w,), ? 'images/icon_round_select.png'
: 'images/icon_round_unSelect.png',
width: 30.w,
height: 30.w,
))),
SizedBox(
width: 15.w,
),
Flexible( Flexible(
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: TranslationLoader.lanKeys!.readAndAgree!.tr, text: TranslationLoader.lanKeys!.readAndAgree!.tr,
style: TextStyle(color: const Color(0xff333333), fontSize: 20.sp), style: TextStyle(
color: const Color(0xff333333), fontSize: 20.sp),
children: [ children: [
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.middle, alignment: PlaceholderAlignment.middle,
child: GestureDetector( child: GestureDetector(
child: Text('${TranslationLoader.lanKeys!.userAgreement!.tr}', style: TextStyle(color: AppColors.mainColor, fontSize: 20.sp)), child: Text(
'${TranslationLoader.lanKeys!.userAgreement!.tr}',
style: TextStyle(
color: AppColors.mainColor,
fontSize: 20.sp)),
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, Get.toNamed(Routers.webviewShowPage, arguments: {
arguments: { "url": XSConstantMacro.userAgreementURL,
"url": XSConstantMacro.userAgreementURL, "title": '用户协议'
"title": '用户协议' });
});
}, },
)), )),
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.middle, alignment: PlaceholderAlignment.middle,
child: GestureDetector( child: GestureDetector(
child: Text('${TranslationLoader.lanKeys!.privacyPolicy!.tr}', style: TextStyle( color: AppColors.mainColor, fontSize: 20.sp)), child: Text(
'${TranslationLoader.lanKeys!.privacyPolicy!.tr}',
style: TextStyle(
color: AppColors.mainColor,
fontSize: 20.sp)),
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, Get.toNamed(Routers.webviewShowPage, arguments: {
arguments: { "url": XSConstantMacro.privacyPolicyURL,
"url": XSConstantMacro.privacyPolicyURL, "title": '隐私政策'
"title": '隐私政策' });
});
}, },
)), )),
], ],
@ -135,10 +163,11 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
borderRadius: 20.w, borderRadius: 20.w,
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
isDisabled: state.canNext.value, isDisabled: state.canNext.value,
onClick: state.canNext.value ? (){ onClick: state.canNext.value
logic.login(); ? () {
}: null) logic.login();
), }
: null)),
SizedBox(height: 50.w), SizedBox(height: 50.w),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -149,11 +178,34 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
height: 50.h, height: 50.h,
// color: Colors.red, // color: Colors.red,
child: Center( child: Center(
child: Text('${TranslationLoader.lanKeys!.forgetPassword!.tr}', style: TextStyle(fontSize: 22.sp, color: AppColors.mainColor)), child: Text(
'${TranslationLoader.lanKeys!.forgetPassword!.tr}',
style: TextStyle(
fontSize: 22.sp, color: AppColors.mainColor)),
), ),
), ),
onTap: () { onTap: () {
Navigator.pushNamed(context, Routers.starLockForgetPasswordPage); Navigator.pushNamed(
context, Routers.starLockForgetPasswordPage);
},
),
Expanded(
child: SizedBox(
width: 10.sp,
)),
GestureDetector(
child: SizedBox(
// width: 150.w,
height: 50.h,
// color: Colors.red,
child: Center(
child: Text('演示模式',
style: TextStyle(
fontSize: 22.sp, color: AppColors.mainColor)),
),
),
onTap: () {
Get.toNamed(Routers.demoModeLockDetailPage);
}, },
) )
], ],

View File

@ -0,0 +1,23 @@
import 'package:star_lock/main/accessoriesList/accessoriesList_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class AccessoriesListLogic extends BaseGetXController {
final AccessoriesListState state = AccessoriesListState();
@override
void onReady() {
// TODO: implement onReady
super.onReady();
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
}
@override
void onClose() {
// TODO: implement onClose
}
}

View File

@ -0,0 +1,76 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/accessoriesList/accessoriesList_logic.dart';
import '../../../app_settings/app_colors.dart';
import '../../../baseWidget.dart';
import '../../../tools/titleAppBar.dart';
class AccessoriesListPage extends StatefulWidget {
const AccessoriesListPage({Key? key}) : super(key: key);
@override
State<AccessoriesListPage> createState() => _AccessoriesListPageState();
}
class _AccessoriesListPageState extends State<AccessoriesListPage>
with BaseWidget {
final logic = Get.put(AccessoriesListLogic());
final state = Get.find<AccessoriesListLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: TitleAppBar(
barTitle: '选择设备类型',
haveBack: true,
backgroundColor: AppColors.mainColor),
body: ListView(
children: [
_accessoriesItem(
'images/main/icon_main_attachment_lighting.png', "照明灯具", true),
_accessoriesItem(
'images/main/icon_main_attachment_doorOpener.png', "开门器", false),
_accessoriesItem(
'images/main/icon_main_attachment_ElectricCurtain.png',
"电动窗帘",
true),
_accessoriesItem('images/main/icon_main_attachment_doorSensor.png',
"门窗传感器", false),
_accessoriesItem(
'images/main/icon_main_attachment_sensor.png', "传感器", true),
],
),
);
}
//
Widget _accessoriesItem(String iconStr, String gatewayType, bool isWhite) {
return GestureDetector(
onTap: () {
logic.showToast("该功能暂未开放");
},
child: Container(
color: isWhite == true ? Colors.white : AppColors.mainBackgroundColor,
width: 1.sw,
height: 140.h,
padding: EdgeInsets.all(30.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
iconStr,
),
SizedBox(width: 20.w),
Text(
gatewayType,
style: TextStyle(fontSize: 22.sp),
)
],
),
),
);
}
}

View File

@ -0,0 +1,6 @@
import 'package:get/get.dart';
class AccessoriesListState {
var getLockType = 1.obs; //0-1-2-NFC无源锁3-4-5-6-7-
var lockTypeImg = 'images/lockType/addLock_touchScreen.png'.obs; //
}

View File

@ -70,18 +70,18 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
Obx(() => getPeriodValidityWidget()), Obx(() => getPeriodValidityWidget()),
Container(height: 10.h), Container(height: 10.h),
CommonItem( CommonItem(
leftTitel: "受账号", leftTitel: "收者",
rightTitle: state.itemData.value.username, rightTitle: state.itemData.value.username ?? "",
action: () {}), action: () {}),
const SizedBox(height: 1), const SizedBox(height: 1),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.sender!.tr, leftTitel: TranslationLoader.lanKeys!.sender!.tr,
rightTitle: state.itemData.value.senderUsername, rightTitle: state.itemData.value.senderUsername ?? "",
action: () {}), action: () {}),
const SizedBox(height: 1), const SizedBox(height: 1),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.senderTime!.tr, leftTitel: TranslationLoader.lanKeys!.senderTime!.tr,
rightTitle: getSenderDate(state.itemData.value), rightTitle: getSenderDate(state.itemData.value) ?? "",
action: () {}), action: () {}),
Container(height: 10.h), Container(height: 10.h),
CommonItem( CommonItem(
@ -157,12 +157,15 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
rightTitle: '${state.beginTime.value}\n${state.endTime.value}', rightTitle: '${state.beginTime.value}\n${state.endTime.value}',
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
var data = await Get.toNamed(Routers.electronicKeyDetailChangeDate, arguments: {"itemData": state.itemData.value}); var data = await Get.toNamed(Routers.electronicKeyDetailChangeDate,
if(data != null) { arguments: {"itemData": state.itemData.value});
if (data != null) {
state.beginTimeTimestamp.value = data["beginTimeTimestamp"]; state.beginTimeTimestamp.value = data["beginTimeTimestamp"];
state.endTimeTimestamp.value = data["endTimeTimestamp"]; state.endTimeTimestamp.value = data["endTimeTimestamp"];
state.beginTime.value = DateTool().dateToYMDHNString(state.beginTimeTimestamp.value.toString()); state.beginTime.value = DateTool()
state.endTime.value = DateTool().dateToYMDHNString(state.endTimeTimestamp.value.toString()); .dateToYMDHNString(state.beginTimeTimestamp.value.toString());
state.endTime.value = DateTool()
.dateToYMDHNString(state.endTimeTimestamp.value.toString());
} }
}); });
} }

View File

@ -421,28 +421,30 @@ class _LockDetailPageState extends State<LockDetailPage>
List<Widget> getAttachmentWidget() { List<Widget> getAttachmentWidget() {
var showWidgetArr = <Widget>[]; var showWidgetArr = <Widget>[];
// 线 // 线
if (state.isAttendance.value == 1) { // if (state.isAttendance.value == 1) {
showWidgetArr.add(bottomItem( // showWidgetArr.add(bottomItem(
'images/main/icon_lockDetail_WirelessKeyboard.png', // 'images/main/icon_lockDetail_WirelessKeyboard.png',
'无线键盘', // '无线键盘',
state.bottomBtnisUneable.value, // state.bottomBtnisUneable.value,
() {})); // () {}));
} // }
// // //
showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png', // showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png',
'照明', state.bottomBtnisUneable.value, () {})); // '照明', state.bottomBtnisUneable.value, () {}));
// // //
showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png', // showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png',
'门磁', state.bottomBtnisUneable.value, () {})); // '门磁', state.bottomBtnisUneable.value, () {}));
// // //
showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png', // showWidgetArr.add(bottomItem('images/main/icon_lockDetail_illuminator.png',
'开门器', state.bottomBtnisUneable.value, () {})); // '开门器', state.bottomBtnisUneable.value, () {}));
// //
showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件', showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件',
state.bottomBtnisUneable.value, () {})); state.bottomBtnisUneable.value, () {
Navigator.pushNamed(context, Routers.accessoriesListPage);
}));
return showWidgetArr; return showWidgetArr;
} }

View File

@ -79,31 +79,30 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
Obx( Obx(
() => () => state.listData.value.isEmpty || state.listData.value.isEmpty
state.listData.value.isEmpty || state.listData.value.length == 0 ? Image.asset(
? Image.asset( 'images/main/monitorBg.png',
'images/main/monitorBg.png', width: ScreenUtil().screenWidth,
width: ScreenUtil().screenWidth, height: ScreenUtil().screenHeight,
height: ScreenUtil().screenHeight, fit: BoxFit.cover,
fit: BoxFit.cover, )
) : Builder(
: Builder( builder: (BuildContext context) {
builder: (BuildContext context) { try {
try { return Image.memory(
return Image.memory( state.listData.value,
state.listData.value, gaplessPlayback: true,
gaplessPlayback: true, width: 1.sw,
width: 1.sw, height: 1.sh,
height: 1.sh, fit: BoxFit.cover,
fit: BoxFit.cover, );
); } catch (e, stackTrace) {
} catch (e, stackTrace) { print('Error loading image: $e');
print('Error loading image: $e'); print('Stack trace: $stackTrace');
print('Stack trace: $stackTrace'); return Container();
return Container(); }
} },
}, ),
),
), ),
Obx(() => state.listData.value.isEmpty Obx(() => state.listData.value.isEmpty
? Positioned( ? Positioned(
@ -161,7 +160,7 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
"images/main/icon_lockDetail_monitoringOpenVoice.png"))), "images/main/icon_lockDetail_monitoringOpenVoice.png"))),
), ),
), ),
SizedBox(width: 60.w), SizedBox(width: 30.w),
// //
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -178,7 +177,7 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
"images/main/icon_lockDetail_monitoringScreenshot.png")), "images/main/icon_lockDetail_monitoringScreenshot.png")),
), ),
), ),
SizedBox(width: 60.w), SizedBox(width: 30.w),
// //
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -191,10 +190,34 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
child: Image( child: Image(
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
fit: BoxFit.fill,
image: const AssetImage( image: const AssetImage(
"images/main/icon_lockDetail_monitoringScreenRecording.png")), "images/main/icon_lockDetail_monitoringScreenRecording.png")),
), ),
), ),
SizedBox(width: 30.w),
GestureDetector(
onTap: () {
logic.showToast('该功能暂未开放');
},
child: Image(
width: 28.w,
height: 28.w,
fit: BoxFit.fill,
image:
const AssetImage("images/main/icon_lockDetail_rectangle.png"))
// child: Container(
// width: 50.w,
// height: 50.w,
// padding: EdgeInsets.all(5.w),
// child: Image(
// width: 40.w,
// height: 40.w,
// fit: BoxFit.fill,
// image: const AssetImage(
// "images/main/icon_lockDetail_rectangle.png")),
// ),
)
]); ]);
} }

View File

@ -22,7 +22,6 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
} }
@ -35,17 +34,21 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
), ),
body: Container( body: ListView(
width: 1.sw, children: [
height: 1.sh - ScreenUtil().statusBarHeight * 2, Container(
color: Colors.white, width: 1.sw,
child: Column( height: 1.sh - ScreenUtil().statusBarHeight,
children: [ color: Colors.white,
topTip(), child: Column(
topWidget(), children: [
Expanded(child: bottomWidget()) topTip(),
], topWidget(),
), Expanded(child: bottomWidget())
],
),
),
],
)); ));
} }
@ -72,6 +75,7 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
Widget topWidget() { Widget topWidget() {
// KeyInfos keyInfo = widget.lockMainEntity.data!.keyInfos![0]; // KeyInfos keyInfo = widget.lockMainEntity.data!.keyInfos![0];
return Column( return Column(
mainAxisSize: MainAxisSize.min,
children: [ children: [
SizedBox(height: 30.h), SizedBox(height: 30.h),
Stack( Stack(
@ -229,7 +233,8 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png', showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png',
TranslationLoader.lanKeys!.checkingIn!.tr, () { TranslationLoader.lanKeys!.checkingIn!.tr, () {
// gotoLogin(); // gotoLogin();
Get.toNamed(Routers.checkingInListPage, arguments: LockListInfoItemEntity()); Get.toNamed(Routers.checkingInListPage,
arguments: LockListInfoItemEntity());
})); }));
// } // }
@ -239,9 +244,8 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
TranslationLoader.lanKeys!.electronicKey!.tr, () { TranslationLoader.lanKeys!.electronicKey!.tr, () {
// gotoLogin(); // gotoLogin();
Get.toNamed(Routers.electronicKeyListPage, arguments: { Get.toNamed(Routers.electronicKeyListPage,
"keyInfo": LockListInfoItemEntity() arguments: {"keyInfo": LockListInfoItemEntity()});
});
}), }),
// //
@ -249,9 +253,8 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
TranslationLoader.lanKeys!.password!.tr, () { TranslationLoader.lanKeys!.password!.tr, () {
// gotoLogin(); // gotoLogin();
Get.toNamed(Routers.passwordKeyListPage, arguments: { Get.toNamed(Routers.passwordKeyListPage,
"keyInfo": LockListInfoItemEntity() arguments: {"keyInfo": LockListInfoItemEntity()});
});
}), }),
// ic卡 // ic卡
@ -259,8 +262,7 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
TranslationLoader.lanKeys!.card!.tr, () { TranslationLoader.lanKeys!.card!.tr, () {
// gotoLogin(); // gotoLogin();
Get.toNamed(Routers.cardListPage, Get.toNamed(Routers.cardListPage, arguments: {"lockId": 0});
arguments: {"lockId": 0});
}), }),
// //
@ -313,9 +315,8 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
TranslationLoader.lanKeys!.authorizedAdmin!.tr, () { TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
// gotoLogin(); // gotoLogin();
Get.toNamed(Routers.authorizedAdminListPage, arguments: { Get.toNamed(Routers.authorizedAdminListPage,
"keyInfo": LockListInfoItemEntity() arguments: {"keyInfo": LockListInfoItemEntity()});
});
}), }),
// //
bottomItem('images/main/icon_main_operatingRecord.png', bottomItem('images/main/icon_main_operatingRecord.png',
@ -330,7 +331,8 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
Get.toNamed(Routers.videoLogPage); Get.toNamed(Routers.videoLogPage);
}), }),
// //
bottomItem('images/main/icon_lockDetail_messageReminding.png', "消息提醒", () { bottomItem('images/main/icon_lockDetail_messageReminding.png', "消息提醒",
() {
Get.toNamed(Routers.msgNotificationPage); Get.toNamed(Routers.msgNotificationPage);
}), }),
// //
@ -376,5 +378,4 @@ class _DemoModeLockDetailPageState extends State<DemoModeLockDetailPage> {
// Get.toNamed(Routers.selectLockTypePage); // Get.toNamed(Routers.selectLockTypePage);
logic.showToast("演示模式"); logic.showToast("演示模式");
} }
} }

View File

@ -18,7 +18,8 @@ class SelectLockTypePage extends StatefulWidget {
State<SelectLockTypePage> createState() => _SelectLockTypePageState(); State<SelectLockTypePage> createState() => _SelectLockTypePageState();
} }
class _SelectLockTypePageState extends State<SelectLockTypePage> with BaseWidget { class _SelectLockTypePageState extends State<SelectLockTypePage>
with BaseWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -80,6 +81,11 @@ class _SelectLockTypePageState extends State<SelectLockTypePage> with BaseWidget
// Navigator.pushNamed(context, Routers.gatewayListPage); // Navigator.pushNamed(context, Routers.gatewayListPage);
getNearByLimits(); getNearByLimits();
}), }),
lockTypeItem(
'images/lockType/lockType_gatewayLock.png', '网络摄像头', () {
// Navigator.pushNamed(context, Routers.gatewayListPage);
getNearByLimits();
}),
], ],
), ),
), ),

View File

@ -152,7 +152,7 @@ class _StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
mineItem('images/mine/icon_mine_main_shoppingcart.png', "配件商城".tr, mineItem('images/mine/icon_mine_main_shoppingcart.png', "配件商城".tr,
() { () {
Get.back(); Get.back();
Get.toNamed(Routers.LockMallPage); Get.toNamed(Routers.lockMallPage);
}), }),
mineItem('images/mine/icon_mine_main_about.png', mineItem('images/mine/icon_mine_main_about.png',
TranslationLoader.lanKeys!.about!.tr, () { TranslationLoader.lanKeys!.about!.tr, () {

View File

@ -53,7 +53,7 @@ class UdpHelp {
} }
void closeUDP() { void closeUDP() {
if(udpHeartTimer != null){ if (udpHeartTimer != null) {
udpHeartTimer!.cancel(); udpHeartTimer!.cancel();
} }
} }

View File

@ -1,12 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'package:audioplayers/audioplayers.dart'; import 'package:audioplayers/audioplayers.dart';
import 'package:fast_gbk/fast_gbk.dart'; import 'package:fast_gbk/fast_gbk.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/tools/eventBusEventManage.dart';
import '../../appRouters.dart'; import '../../appRouters.dart';
import '../../main/lockDetail/monitoring/monitoring/lockMonitoring_page.dart';
import '../../tools/storage.dart'; import '../../tools/storage.dart';
import 'udp_manage.dart'; import 'udp_manage.dart';

View File

@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.11+20240305 version: 1.0.11+20240306
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'