# Conflicts:
#	star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart
This commit is contained in:
魏少阳 2024-03-23 11:28:20 +08:00
commit 104fbcc188
24 changed files with 550 additions and 471 deletions

View File

@ -72,8 +72,12 @@ flutter build apk --split-per-abi --release --flavor sky -t lib/main_sky.dart
通用build/app/outputs/apk/sky/release/app-sky-universal-release.apk 通用build/app/outputs/apk/sky/release/app-sky-universal-release.apk
32位build/app/outputs/apk/sky/release/app-sky-armeabi-v7a-release.apk 32位build/app/outputs/apk/sky/release/app-sky-armeabi-v7a-release.apk
64位build/app/outputs/apk/sky/release/app-sky-arm64-v8a-release.apk 64位build/app/outputs/apk/sky/release/app-sky-arm64-v8a-release.apk
注意修改“VersionCode”为版本代码
```bash ```bash
cp build/app/outputs/apk/sky/release/app-sky-universal-release.apk /d/Downloads/ cp build/app/outputs/apk/sky/release/app-sky-armeabi-v7a-release.apk /d/www/SkyReleases/app-sky-32-release-VersionCode.apk
cp build/app/outputs/apk/sky/release/app-sky-arm64-v8a-release.apk /d/www/SkyReleases/app-sky-64-release-VersionCode.apk
cp build/app/outputs/apk/sky/release/app-sky-universal-release.apk /d/www/SkyReleases/app-sky-universal-release-VersionCode.apk
``` ```
## 获取编译包的签名 ## 获取编译包的签名
用于APP备案国内商店上架等 用于APP备案国内商店上架等
@ -102,10 +106,11 @@ java -jar android/google/pepk.jar --keystore=android/app/sky.jks --alias=upload
```bash ```bash
flutter build appbundle --release --flavor sky -t lib/main_sky.dart flutter build appbundle --release --flavor sky -t lib/main_sky.dart
``` ```
编译后的包:`build/app/outputs/bundle/skyRelease/app-sky-release.aab`
注意修改“VersionCode”为版本代码
```bash ```bash
cp build/app/outputs/bundle/skyRelease/app-sky-release.aab /d/Downloads/app-sky-universal-release-1.0.16+2024031302.aab cp build/app/outputs/bundle/skyRelease/app-sky-release.aab /d/www/SkyReleases/app-sky-release-VersionCode.aab
``` ```
- 注意这里的sky.jks和google_pek.zip和encryption_public_key.pem都是sky渠道的和谷歌账号对应。如果需要使用其他谷歌账号需要更换这两个文件。 - 注意这里的sky.jks和google_pek.zip和encryption_public_key.pem都是sky渠道的和谷歌账号对应。如果需要使用其他谷歌账号需要更换这两个文件。
## 用于华为商店 ## 用于华为商店

View File

@ -36,7 +36,13 @@ android {
keyAlias = 'starlock' keyAlias = 'starlock'
keyPassword '123456' keyPassword '123456'
} }
// preskyxhj // xiepreskyxhj
xie {
storeFile file("starlock.keystore")
storePassword '123456'
keyAlias = 'starlock'
keyPassword '123456'
}
pre { pre {
storeFile file("starlock.keystore") storeFile file("starlock.keystore")
storePassword '123456' storePassword '123456'
@ -57,10 +63,18 @@ android {
keyPassword 'xhj8872' keyPassword 'xhj8872'
} }
} }
// ----- BEGIN flavorDimensions (autogenerated by flutter_flavorizr) ----- // ----- BEGIN flavorDimensions (autogenerated by flutter_flavorizr) -----
flavorDimensions "flavor-type" flavorDimensions "flavor-type"
productFlavors { productFlavors {
xie {
dimension "flavor-type"
applicationId "com.starlock.lock.xie"
signingConfig signingConfigs.pre
resValue "string", "app_name", "星锁-xie"
manifestPlaceholders.JPUSH_PKGNAME = "com.starlock.lock.xie"
}
dev { dev {
dimension "flavor-type" dimension "flavor-type"
applicationId "com.starlock.lock.dev" applicationId "com.starlock.lock.dev"
@ -93,8 +107,7 @@ android {
// ----- END flavorDimensions (autogenerated by flutter_flavorizr) ----- // ----- END flavorDimensions (autogenerated by flutter_flavorizr) -----
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion ndkVersion flutter.ndkVersion
lintOptions{ lintOptions{
@ -163,6 +176,7 @@ android {
// //
minifyEnabled false minifyEnabled false
shrinkResources false shrinkResources false
productFlavors.xie.signingConfig signingConfigs.pre
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -51,6 +51,16 @@ app:
flavorDimensions: "flavor-type" flavorDimensions: "flavor-type"
flavors: flavors:
xie:
app:
name: "星锁-xie"
icon: "assets/icon/dev.png"
android:
applicationId: "com.starlock.lock.xie"
customConfig:
signingConfig: signingConfigs.pre
ios:
bundleId: "com.starlock.lock.xie"
dev: dev:
app: app:
name: "星锁-dev" name: "星锁-dev"

View File

@ -28,8 +28,16 @@
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key> <key>NSExceptionDomains</key>
<true/> <dict>
<key>jpush.cn</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict> </dict>
<key>NSBluetoothAlwaysUsageDescription</key> <key>NSBluetoothAlwaysUsageDescription</key>
<string>The app uses bluetooth to find, connect and transfer data between different devices</string> <string>The app uses bluetooth to find, connect and transfer data between different devices</string>
@ -76,8 +84,6 @@
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
<key>NSUserTrackingUsageDescription</key>
<string>需要访问您的隐私数据,以提供个性化的体验。</string>
<key>io.flutter.embedded_views_preview</key> <key>io.flutter.embedded_views_preview</key>
<true/> <true/>
</dict> </dict>

View File

@ -1,17 +1,13 @@
// import 'package:aliyun_push/aliyun_push.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:star_lock/flavors.dart'; import 'package:star_lock/flavors.dart';
import 'package:star_lock/tools/app_manager.dart'; import 'package:star_lock/tools/app_manager.dart';
import 'package:star_lock/tools/bindings/app_binding.dart'; import 'package:star_lock/tools/bindings/app_binding.dart';
import 'package:star_lock/tools/storage.dart'; import 'package:star_lock/tools/xs_jPhush.dart';
// import 'package:star_lock/tools/storage.dart';
// import 'package:star_lock/tools/xs_aliyunPush.dart';
import 'package:star_lock/translations/app_dept.dart'; import 'package:star_lock/translations/app_dept.dart';
import 'package:star_lock/translations/trans_lib.dart'; import 'package:star_lock/translations/trans_lib.dart';
@ -32,8 +28,6 @@ class MyApp extends StatefulWidget {
// final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>(); // final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();
class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget { class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
final JPush jpush = JPush();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ScreenUtilInit( return ScreenUtilInit(
@ -106,7 +100,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
initJPushService(); XSJPushProvider().initJPushService();
} }
@override @override
@ -114,43 +108,6 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
WidgetsBinding.instance.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
super.dispose(); super.dispose();
} }
Future<void> initJPushService() async {
final data = await Storage.getString(saveUserLoginData);
if (data != null && data.isNotEmpty) {
jpush.setup(
appKey: "7ff37d174c1a568a89e98dad",
channel: "flutter_channel",
production: false,
debug: true,
);
jpush.addEventHandler(
//
onReceiveNotification: (Map<String, dynamic> message) async {
print("flutter onReceiveNotification: $message");
},
//
onOpenNotification: (Map<String, dynamic> message) async {
print("flutter onOpenNotification: $message");
},
//
onReceiveMessage: (Map<String, dynamic> message) async {
print("flutter onReceiveMessage: $message");
},
);
jpush.applyPushAuthority(
const NotificationSettingsIOS(sound: true, alert: true, badge: true));
// jpush.setChannelAndSound(
// channel: "flutter_channel", channelID: "115700", sound: "default");
// Platform messages may fail, so we use a try/catch PlatformException.
jpush.getRegistrationID().then((rid) {
print("flutter get registration id : $rid");
});
}
}
} }
void openBlueScan() { void openBlueScan() {

View File

@ -1,4 +1,5 @@
enum Flavor { enum Flavor {
xie,
dev, dev,
pre, pre,
sky, sky,
@ -20,6 +21,8 @@ class F {
static String get title { static String get title {
switch (appFlavor) { switch (appFlavor) {
case Flavor.xie:
return '星锁-xie';
case Flavor.dev: case Flavor.dev:
return '星锁-dev'; return '星锁-dev';
case Flavor.pre: case Flavor.pre:
@ -35,6 +38,8 @@ class F {
static String get navTitle { static String get navTitle {
switch (appFlavor) { switch (appFlavor) {
case Flavor.xie:
return '星锁-xie';
case Flavor.dev: case Flavor.dev:
return '星锁-dev'; return '星锁-dev';
case Flavor.pre: case Flavor.pre:
@ -50,10 +55,12 @@ class F {
static String get apiPrefix { static String get apiPrefix {
switch (appFlavor) { switch (appFlavor) {
// case Flavor.ge:
// return 'https://ge.lock.star-lock.cn';
case Flavor.xie:
return 'http://192.168.1.15:8022';
case Flavor.dev: case Flavor.dev:
return 'https://dev.lock.star-lock.cn'; return 'https://dev.lock.star-lock.cn';
// return "http://192.168.1.15:8022"; //
// "https://ge.lock.star-lock.cn"; //
case Flavor.pre: case Flavor.pre:
return 'https://pre.lock.star-lock.cn'; return 'https://pre.lock.star-lock.cn';
case Flavor.sky: case Flavor.sky:
@ -69,6 +76,7 @@ class F {
// StarLockAMapKey // StarLockAMapKey
static StarLockAMapKey get aMapKey { static StarLockAMapKey get aMapKey {
switch (appFlavor) { switch (appFlavor) {
case Flavor.xie:
case Flavor.dev: case Flavor.dev:
return const StarLockAMapKey( return const StarLockAMapKey(
androidKey: 'b56b681ee89f4db43a5aa1879ae8cbfe', androidKey: 'b56b681ee89f4db43a5aa1879ae8cbfe',

View File

@ -7,6 +7,7 @@ import 'package:intl/intl.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
import 'package:star_lock/tools/appFirstEnterHandle.dart';
import '../../../blue/blue_manage.dart'; import '../../../blue/blue_manage.dart';
import '../../../blue/io_protocol/io_addUser.dart'; import '../../../blue/io_protocol/io_addUser.dart';
@ -30,7 +31,8 @@ class LockDetailLogic extends BaseGetXController {
// //
void initReplySubscription() { void initReplySubscription() {
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async { state.replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
Get.log("锁详情收到了蓝牙解析消息 reply:${reply.commandType}"); Get.log("锁详情收到了蓝牙解析消息 reply:${reply.commandType}");
// //
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) { if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
@ -48,7 +50,8 @@ class LockDetailLogic extends BaseGetXController {
// } // }
// //
if (reply is SenderReferEventRecordTimeReply && state.ifCurrentScreen.value == true) { if (reply is SenderReferEventRecordTimeReply &&
state.ifCurrentScreen.value == true) {
_replyReferEventRecordTime(reply); _replyReferEventRecordTime(reply);
} }
@ -71,7 +74,7 @@ class LockDetailLogic extends BaseGetXController {
// _showFullScreenOverlay(Get.context!); // _showFullScreenOverlay(Get.context!);
state.iSClosedUnlockSuccessfulPopup.value = true; state.iSClosedUnlockSuccessfulPopup.value = true;
if (state.closedUnlockSuccessfulTimer != null ) { if (state.closedUnlockSuccessfulTimer != null) {
state.closedUnlockSuccessfulTimer!.cancel(); state.closedUnlockSuccessfulTimer!.cancel();
state.closedUnlockSuccessfulTimer = null; state.closedUnlockSuccessfulTimer = null;
} }
@ -377,7 +380,8 @@ class LockDetailLogic extends BaseGetXController {
eventBus.fire(RefreshLockDetailInfoDataEvent()); eventBus.fire(RefreshLockDetailInfoDataEvent());
}); });
BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, BlueManage()
.bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!,
(BluetoothConnectionState deviceConnectionState) async { (BluetoothConnectionState deviceConnectionState) async {
if (deviceConnectionState == BluetoothConnectionState.connected) { if (deviceConnectionState == BluetoothConnectionState.connected) {
// //
@ -409,7 +413,8 @@ class LockDetailLogic extends BaseGetXController {
publicKey: publicKeyDataList, publicKey: publicKeyDataList,
privateKey: getPrivateKeyList, privateKey: getPrivateKeyList,
token: getTokenList); token: getTokenList);
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) { } else if (deviceConnectionState ==
BluetoothConnectionState.disconnected) {
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
if (state.ifCurrentScreen.value == true) { if (state.ifCurrentScreen.value == true) {
showBlueConnetctToast(); showBlueConnetctToast();
@ -464,7 +469,8 @@ class LockDetailLogic extends BaseGetXController {
signKey: signKeyDataList, signKey: signKeyDataList,
privateKey: getPrivateKeyList, privateKey: getPrivateKeyList,
); );
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) { } else if (deviceConnectionState ==
BluetoothConnectionState.disconnected) {
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
if (state.ifCurrentScreen.value == true) { if (state.ifCurrentScreen.value == true) {
showBlueConnetctToast(); showBlueConnetctToast();
@ -694,17 +700,22 @@ class LockDetailLogic extends BaseGetXController {
/// ///
void initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() { void initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() {
// eventBus // eventBus
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent = eventBus.on<LockSetChangeSetRefreshLockDetailWithType>().listen((event) { state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent =
eventBus
.on<LockSetChangeSetRefreshLockDetailWithType>()
.listen((event) {
if (event.type == 0) { if (event.type == 0) {
// 0 // 0
state.isAttendance.value = int.parse(event.setResult); state.isAttendance.value = int.parse(event.setResult);
state.keyInfos.value.lockSetting!.attendance = int.parse(event.setResult); state.keyInfos.value.lockSetting!.attendance =
int.parse(event.setResult);
} else if (event.type == 1) { } else if (event.type == 1) {
// 1 // 1
state.isOpenLockNeedOnline.value = int.parse(event.setResult); state.isOpenLockNeedOnline.value = int.parse(event.setResult);
state.keyInfos.value.lockSetting!.appUnlockOnline = state.keyInfos.value.lockSetting!.appUnlockOnline =
int.parse(event.setResult); int.parse(event.setResult);
Get.log("state.isOpenLockNeedOnline.value:${state.isOpenLockNeedOnline.value}"); Get.log(
"state.isOpenLockNeedOnline.value:${state.isOpenLockNeedOnline.value}");
} else if (event.type == 2) { } else if (event.type == 2) {
// 2 // 2
state.isOpenPassageMode.value = int.parse(event.setResult); state.isOpenPassageMode.value = int.parse(event.setResult);
@ -718,26 +729,28 @@ class LockDetailLogic extends BaseGetXController {
state.electricQuantity.value = int.parse(event.setResult); state.electricQuantity.value = int.parse(event.setResult);
state.keyInfos.value.electricQuantity = int.parse(event.setResult); state.keyInfos.value.electricQuantity = int.parse(event.setResult);
} else if (event.type == 5) { } else if (event.type == 5) {
// 5 // 5
state.keyInfos.value.lockSetting!.remoteUnlock = int.parse(event.setResult); state.keyInfos.value.lockSetting!.remoteUnlock =
int.parse(event.setResult);
} }
eventBus.fire(RefreshLockDetailInfoDataEvent()); eventBus.fire(RefreshLockDetailInfoDataEvent());
}); });
} }
String getKeyStatusTextAndShow(){ String getKeyStatusTextAndShow() {
String text = ""; String text = "";
if (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitIneffective || if (state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusWaitIneffective ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) { state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
text = "你的钥匙${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}"; text =
"你的钥匙${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}";
} else { } else {
text = state.isOpenPassageMode.value == 1 text = state.isOpenPassageMode.value == 1
? "常开模式启动!长按闭锁" ? "常开模式启动!长按闭锁"
: TranslationLoader : TranslationLoader.lanKeys!.clickUnlockAndHoldDownClose!.tr;
.lanKeys!.clickUnlockAndHoldDownClose!.tr;
} }
return text; return text;
} }
@ -825,6 +838,20 @@ class LockDetailLogic extends BaseGetXController {
return formattedTime; return formattedTime;
} }
Future<void> positionPermissionAlert() async {
//
if (Platform.isAndroid) {
AppFirstEnterHandle()
.getAppFirstEnter(state.widgetContext, isAgreePosition);
var getFlag = await Storage.getString(isAgreePosition);
if (getFlag == isAgreePosition) {
openBlueSet();
}
} else {
openBlueSet();
}
}
openBlueSet() { openBlueSet() {
if (!Platform.isIOS) { if (!Platform.isIOS) {
getMicrophonePermission().then((value) { getMicrophonePermission().then((value) {
@ -861,10 +888,14 @@ class LockDetailLogic extends BaseGetXController {
// TODO: implement onReady // TODO: implement onReady
super.onReady(); super.onReady();
openBlueSet();
Get.log("LockDetailPage onReady"); Get.log("LockDetailPage onReady");
// _initReplySubscription(); // _initReplySubscription();
// _initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction(); // _initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction();
// openBlueSet();
positionPermissionAlert();
// _scanListDiscoveredDeviceSubscriptionAction(); // _scanListDiscoveredDeviceSubscriptionAction();
} }
@ -886,5 +917,4 @@ class LockDetailLogic extends BaseGetXController {
// _scanListDiscoveredDeviceSubscription.cancel(); // _scanListDiscoveredDeviceSubscription.cancel();
} }
} }

View File

@ -33,7 +33,8 @@ class LockDetailPage extends StatefulWidget {
State<LockDetailPage> createState() => _LockDetailPageState(); State<LockDetailPage> createState() => _LockDetailPageState();
} }
class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStateMixin, RouteAware { class _LockDetailPageState extends State<LockDetailPage>
with TickerProviderStateMixin, RouteAware {
// with RouteAware // with RouteAware
final logic = Get.put(LockDetailLogic()); final logic = Get.put(LockDetailLogic());
final state = Get.find<LockDetailLogic>().state; final state = Get.find<LockDetailLogic>().state;
@ -61,6 +62,7 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
Get.log("LockDetailPage didChangeDependencies2222"); Get.log("LockDetailPage didChangeDependencies2222");
/// ///
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!); AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
} }
@ -68,12 +70,13 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
StreamSubscription? _lockRefreshLockDetailInfoDataEvent; StreamSubscription? _lockRefreshLockDetailInfoDataEvent;
void _initRefreshLockDetailInfoDataEventAction() { void _initRefreshLockDetailInfoDataEventAction() {
// eventBus // eventBus
_lockRefreshLockDetailInfoDataEvent = eventBus.on<RefreshLockDetailInfoDataEvent>().listen((event) { _lockRefreshLockDetailInfoDataEvent =
eventBus.on<RefreshLockDetailInfoDataEvent>().listen((event) {
setState(() {}); setState(() {});
}); });
} }
void loadData(){ void loadData() {
// print("widget.lockListInfoItemEntity.lockUserNo:${widget.lockListInfoItemEntity.lockUserNo}"); // print("widget.lockListInfoItemEntity.lockUserNo:${widget.lockListInfoItemEntity.lockUserNo}");
// print("state.lockUserNo:${state.lockUserNo}"); // print("state.lockUserNo:${state.lockUserNo}");
@ -81,17 +84,18 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
state.lockUserNo = state.keyInfos.value.lockUserNo!; state.lockUserNo = state.keyInfos.value.lockUserNo!;
if (state.lockUserNo == 0) { if (state.lockUserNo == 0) {
state.bottomBtnisEable.value = false; state.bottomBtnisEable.value = false;
}else{ } else {
state.bottomBtnisEable.value = true; state.bottomBtnisEable.value = true;
} }
// print("state.keyInfos.value.keyStatus:${state.keyInfos.value.keyStatus}"); // print("state.keyInfos.value.keyStatus:${state.keyInfos.value.keyStatus}");
if (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitIneffective || if (state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusWaitIneffective ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) { state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
state.openDoorBtnisUneable.value = false; state.openDoorBtnisUneable.value = false;
}else{ } else {
state.openDoorBtnisUneable.value = true; state.openDoorBtnisUneable.value = true;
} }
@ -100,28 +104,28 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
state.senderUserId = state.keyInfos.value.senderUserId!; state.senderUserId = state.keyInfos.value.senderUserId!;
state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!; state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!;
state.isOpenLockNeedOnline.value = state.isOpenLockNeedOnline.value =
state.keyInfos.value.lockSetting!.appUnlockOnline!; state.keyInfos.value.lockSetting!.appUnlockOnline!;
state.electricQuantity.value = state.keyInfos.value.electricQuantity!; state.electricQuantity.value = state.keyInfos.value.electricQuantity!;
state.isOpenPassageMode.value = state.keyInfos.value.passageMode!; state.isOpenPassageMode.value = state.keyInfos.value.passageMode!;
state.lockAlias.value = state.keyInfos.value.lockAlias!; state.lockAlias.value = state.keyInfos.value.lockAlias!;
BlueManage().connectDeviceName = BlueManage().connectDeviceName =
state.keyInfos.value.bluetooth!.bluetoothDeviceName!; state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
List<int> publicKeyData = List<int> publicKeyData =
state.keyInfos.value.bluetooth!.publicKey!.cast<int>(); state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
var saveStrList = changeIntListToStringList(publicKeyData); var saveStrList = changeIntListToStringList(publicKeyData);
Storage.setStringList(saveBluePublicKey, saveStrList); Storage.setStringList(saveBluePublicKey, saveStrList);
// //
List<int> privateKeyData = List<int> privateKeyData =
state.keyInfos.value.bluetooth!.privateKey!.cast<int>(); state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
var savePrivateKeyList = changeIntListToStringList(privateKeyData); var savePrivateKeyList = changeIntListToStringList(privateKeyData);
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList); Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
// signKey // signKey
List<int> signKeyData = List<int> signKeyData =
state.keyInfos.value.bluetooth!.signKey!.cast<int>(); state.keyInfos.value.bluetooth!.signKey!.cast<int>();
var saveSignKeyList = changeIntListToStringList(signKeyData); var saveSignKeyList = changeIntListToStringList(signKeyData);
Storage.setStringList(saveBlueSignKey, saveSignKeyList); Storage.setStringList(saveBlueSignKey, saveSignKeyList);
@ -131,16 +135,29 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
state.widgetContext = context;
loadData(); loadData();
return ListView( return ListView(
children: [ children: [
Visibility( Visibility(
visible: ( visible:
(state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) && // ((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime ||
(DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) < 30 && DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) > 0) &&// 030 state.keyInfos.value.keyType ==
(state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitReceive)// 使 XSConstantMacro.keyTypeLoop) && //
) ? true : false, (DateTool().compareTimeGetDaysFromNow(
state.keyInfos.value.endDate!) <
30 &&
DateTool().compareTimeGetDaysFromNow(
state.keyInfos.value.endDate!) >
0) && // 030
(state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusNormalUse ||
state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusWaitReceive) // 使
)
? true
: false,
child: Container( child: Container(
// height: 30.h, // height: 30.h,
color: const Color(0xFFFBEFD4), color: const Color(0xFFFBEFD4),
@ -148,7 +165,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text("钥匙将在${DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!)}天后失效", Text(
"钥匙将在${DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!)}天后失效",
style: TextStyle( style: TextStyle(
color: const Color(0xffCBA74B), fontSize: 24.sp)) color: const Color(0xffCBA74B), fontSize: 24.sp))
], ],
@ -185,21 +203,21 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
), ),
), ),
Visibility( Visibility(
visible: state.iSClosedUnlockSuccessfulPopup.value, visible: state.iSClosedUnlockSuccessfulPopup.value,
// visible: true, // visible: true,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
state.iSClosedUnlockSuccessfulPopup.value = false; state.iSClosedUnlockSuccessfulPopup.value = false;
}); });
}, },
child: Container( child: Container(
width: 1.sw, width: 1.sw,
height: 1.sh - ScreenUtil().statusBarHeight * 2, height: 1.sh - ScreenUtil().statusBarHeight * 2,
color: Colors.black.withOpacity(0.3), color: Colors.black.withOpacity(0.3),
child: _unlockSuccessWidget()), child: _unlockSuccessWidget()),
), ),
) )
]), ]),
], ],
); );
@ -215,73 +233,70 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
SizedBox( SizedBox(
width: 1.sw - 120.w * 2, width: 1.sw - 120.w * 2,
child: Center( child: Center(
child: Text( child: Text(
state.lockAlias.value, state.lockAlias.value,
style: TextStyle( style: TextStyle(
fontSize: 22.sp, fontSize: 22.sp,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: state.isOpenPassageMode.value == 1 color: state.isOpenPassageMode.value == 1
? AppColors.openPassageModeColor ? AppColors.openPassageModeColor
: AppColors.darkGrayTextColor), : AppColors.darkGrayTextColor),
))), ))),
Positioned( Positioned(
child: Column( child: Column(
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// logic.getStarLockStatus(); // logic.getStarLockStatus();
showDeletAlertDialog( showDeletAlertDialog(
context, context,
DateTool().dateToYMDHNSString(state DateTool().dateToYMDHNSString(state
.keyInfos.value.electricQuantityDate! .keyInfos.value.electricQuantityDate!
.toString())); .toString()));
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Image.asset( Image.asset(
showElectricIcon( showElectricIcon(state.electricQuantity.value),
state.electricQuantity.value), width: 30.w,
width: 30.w, height: 24.w),
height: 24.w), SizedBox(width: 2.w),
SizedBox(width: 2.w), Text("${state.electricQuantity.value}%",
Text("${state.electricQuantity.value}%", style: TextStyle(
style: TextStyle( fontSize: 18.sp,
fontSize: 18.sp, color: AppColors.darkGrayTextColor)),
color: AppColors.darkGrayTextColor)), SizedBox(width: 2.w),
SizedBox(width: 2.w), Icon(
Icon( Icons.info, // 使 warning
Icons.info, // 使 warning color: AppColors.mainColor, //
color: AppColors.mainColor, // size: 25.w, // 30
size: 25.w, // 30 ),
), SizedBox(width: 20.w),
SizedBox(width: 20.w), ],
], ),
), ),
), Row(
Row( mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end, children: [
children: [ Image.asset(showElectricIcon(state.electricQuantity.value),
Image.asset( width: 30.w, height: 24.w),
showElectricIcon(state.electricQuantity.value), SizedBox(width: 2.w),
width: 30.w, Text("--%",
height: 24.w), style: TextStyle(
SizedBox(width: 2.w), fontSize: 18.sp,
Text("--%", color: AppColors.darkGrayTextColor)),
style: TextStyle( SizedBox(width: 2.w),
fontSize: 18.sp, Icon(
color: AppColors.darkGrayTextColor)), Icons.info, // 使 warning
SizedBox(width: 2.w), color: AppColors.mainColor, //
Icon( size: 25.w, // 30
Icons.info, // 使 warning ),
color: AppColors.mainColor, // SizedBox(width: 20.w),
size: 25.w, // 30 ],
), ),
SizedBox(width: 20.w), ],
], ))
),
],
))
], ],
), ),
SizedBox(height: 30.h), SizedBox(height: 30.h),
@ -293,36 +308,43 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
children: [ children: [
Center( Center(
child: GestureDetector( child: GestureDetector(
onTap: state.openDoorBtnisUneable.value == true ? () { onTap: state.openDoorBtnisUneable.value == true
// Get.log("点击开锁"); ? () {
setState(() { // Get.log("点击开锁");
startOpenLock(); setState(() {
}); startOpenLock();
} : null, });
onLongPressStart: state.openDoorBtnisUneable.value == true ? (details) { }
Get.log("长按闭锁"); : null,
setState(() { onLongPressStart: state.openDoorBtnisUneable.value == true
startUnLock(); ? (details) {
}); Get.log("长按闭锁");
// startUnLock(); setState(() {
}:null, startUnLock();
});
// startUnLock();
}
: null,
child: Stack( child: Stack(
children: [ children: [
Image.asset( Image.asset(
state.openDoorBtnisUneable.value == false ? 'images/main/icon_main_openLockBtn_grey.png' : (state.isOpenPassageMode.value == 1 state.openDoorBtnisUneable.value == false
? 'images/main/icon_main_openLockBtn_grey.png'
: (state.isOpenPassageMode.value == 1
? 'images/main/icon_main_normallyOpenMode_center.png' ? 'images/main/icon_main_normallyOpenMode_center.png'
: 'images/main/icon_main_openLockBtn_center.png'), : 'images/main/icon_main_openLockBtn_center.png'),
width: 330.w, width: 330.w,
height: 330.w, height: 330.w,
), ),
state.openDoorBtnisUneable.value == false ? Positioned( state.openDoorBtnisUneable.value == false
child: Image.asset( ? Positioned(
'images/main/icon_main_openLockBtn_grey.png', child: Image.asset(
width: 330.w, 'images/main/icon_main_openLockBtn_grey.png',
height: 330.w, width: 330.w,
), height: 330.w,
) : ),
state.openLockBtnState.value == 1 )
: state.openLockBtnState.value == 1
? buildRotationTransition() ? buildRotationTransition()
: Positioned( : Positioned(
child: Image.asset( child: Image.asset(
@ -332,8 +354,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
width: 330.w, width: 330.w,
height: 330.w, height: 330.w,
)), )),
], ],
), ),
)), )),
], ],
), ),
@ -361,10 +383,10 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
children: [ children: [
Text( Text(
logic.getKeyStatusTextAndShow(), logic.getKeyStatusTextAndShow(),
style: TextStyle( style: TextStyle(
fontSize: 22.sp, fontSize: 22.sp,
color: AppColors.btnDisableColor, color: AppColors.btnDisableColor,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
], ],
), ),
@ -543,7 +565,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_clockingIn.png', 'images/main/icon_main_clockingIn.png',
TranslationLoader.lanKeys!.checkingIn!.tr, TranslationLoader.lanKeys!.checkingIn!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.checkingInListPage, Get.toNamed(Routers.checkingInListPage,
arguments: state.keyInfos.value); arguments: state.keyInfos.value);
})); }));
@ -552,14 +575,18 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_operatingRecord.png', 'images/main/icon_main_operatingRecord.png',
TranslationLoader.lanKeys!.operatingRecord!.tr, TranslationLoader.lanKeys!.operatingRecord!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.lockOperatingRecordPage, Get.toNamed(Routers.lockOperatingRecordPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
})); }));
// //
showWidgetArr.add(bottomItem('images/main/icon_main_set.png', showWidgetArr.add(bottomItem(
TranslationLoader.lanKeys!.set!.tr, state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { 'images/main/icon_main_set.png',
TranslationLoader.lanKeys!.set!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.lockSetPage, arguments: { Get.toNamed(Routers.lockSetPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
"isOnlyOneData": state.isOnlyOneData "isOnlyOneData": state.isOnlyOneData
@ -577,7 +604,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_clockingIn.png', 'images/main/icon_main_clockingIn.png',
TranslationLoader.lanKeys!.checkingIn!.tr, TranslationLoader.lanKeys!.checkingIn!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.checkingInListPage, Get.toNamed(Routers.checkingInListPage,
arguments: state.keyInfos.value); arguments: state.keyInfos.value);
})); }));
@ -587,7 +615,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_electronicKey.png', 'images/main/icon_main_electronicKey.png',
TranslationLoader.lanKeys!.electronicKey!.tr, TranslationLoader.lanKeys!.electronicKey!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.electronicKeyListPage, Get.toNamed(Routers.electronicKeyListPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
})); }));
@ -596,7 +625,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_password.png', 'images/main/icon_main_password.png',
TranslationLoader.lanKeys!.password!.tr, TranslationLoader.lanKeys!.password!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.passwordKeyListPage, Get.toNamed(Routers.passwordKeyListPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
})); }));
@ -606,7 +636,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_icCard.png', 'images/main/icon_main_icCard.png',
TranslationLoader.lanKeys!.card!.tr, TranslationLoader.lanKeys!.card!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
// logic.showToast("普通用户第一次需要在锁旁边操作哦。", something: () { // logic.showToast("普通用户第一次需要在锁旁边操作哦。", something: () {
// logic.showEasyLoading(); // logic.showEasyLoading();
// }); // });
@ -621,7 +652,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_fingerprint.png', 'images/main/icon_main_fingerprint.png',
TranslationLoader.lanKeys!.fingerprint!.tr, TranslationLoader.lanKeys!.fingerprint!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.fingerprintListPage, arguments: { Get.toNamed(Routers.fingerprintListPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
}); });
@ -633,7 +665,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_remoteControl.png', 'images/main/icon_main_remoteControl.png',
TranslationLoader.lanKeys!.remoteControl!.tr, TranslationLoader.lanKeys!.remoteControl!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.remoteControlListPage); Get.toNamed(Routers.remoteControlListPage);
})); }));
} }
@ -644,7 +677,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
bottomItem( bottomItem(
'images/main/icon_face.png', 'images/main/icon_face.png',
TranslationLoader.lanKeys!.humanFace!.tr, TranslationLoader.lanKeys!.humanFace!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.faceList, arguments: { Get.toNamed(Routers.faceList, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
}); // Toast.show(msg: "功能暂未开放"); }); // Toast.show(msg: "功能暂未开放");
@ -658,7 +692,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
bottomItem( bottomItem(
'images/main/icon_catEyes.png', 'images/main/icon_catEyes.png',
TranslationLoader.lanKeys!.monitoring!.tr, TranslationLoader.lanKeys!.monitoring!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.realTimePicturePage, arguments: { Get.toNamed(Routers.realTimePicturePage, arguments: {
"lockName": state.keyInfos.value.lockName, "lockName": state.keyInfos.value.lockName,
"isMonitoring": true "isMonitoring": true
@ -672,7 +707,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_authorizedAdmin.png', 'images/main/icon_main_authorizedAdmin.png',
TranslationLoader.lanKeys!.authorizedAdmin!.tr, TranslationLoader.lanKeys!.authorizedAdmin!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.authorizedAdminListPage, Get.toNamed(Routers.authorizedAdminListPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
})); }));
@ -682,53 +718,73 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
// arguments: {"keyInfo": state.keyInfos.value}); // arguments: {"keyInfo": state.keyInfos.value});
// }) // })
var endWiddget = [ var endWiddget = <Widget>[];
endWiddget.add(
// //
bottomItem( bottomItem(
'images/main/icon_main_operatingRecord.png', 'images/main/icon_main_operatingRecord.png',
TranslationLoader.lanKeys!.operatingRecord!.tr, TranslationLoader.lanKeys!.operatingRecord!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
// Get.toNamed(Routers.lockOperatingRecordPage, // Get.toNamed(Routers.lockOperatingRecordPage,
// arguments: {"keyInfo": state.keyInfos.value}); // arguments: {"keyInfo": state.keyInfos.value});
Get.toNamed(Routers.doorLockLogPage, Get.toNamed(Routers.doorLockLogPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
}), }),
// );
bottomItem(
if (state.keyInfos.value.lockFeature!.d3Face == 1) {
//
endWiddget.add(bottomItem(
'images/main/icon_lockDetail_videoLog.png', 'images/main/icon_lockDetail_videoLog.png',
TranslationLoader.lanKeys!.videoLog!.tr, TranslationLoader.lanKeys!.videoLog!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
// state.bottomBtnisEable.value, () {
Get.toNamed(Routers.videoLogPage); Get.toNamed(Routers.videoLogPage);
}), }));
}
endWiddget.add(
// //
bottomItem( bottomItem(
'images/main/icon_lockDetail_messageReminding.png', 'images/main/icon_lockDetail_messageReminding.png',
TranslationLoader.lanKeys!.messageReminding!.tr, TranslationLoader.lanKeys!.messageReminding!.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.msgNotificationPage); Get.toNamed(Routers.msgNotificationPage);
}), }),
);
endWiddget.add(
// //
bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { bottomItem(
'images/main/icon_main_set.png',
TranslationLoader.lanKeys!.set!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
// logic.clickItemBtnAction(10); // logic.clickItemBtnAction(10);
Get.toNamed(Routers.lockSetPage, arguments: { Get.toNamed(Routers.lockSetPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
"isOnlyOneData": state.isOnlyOneData, "isOnlyOneData": state.isOnlyOneData,
}); });
}), }),
]; );
showWidgetArr.addAll(endWiddget); showWidgetArr.addAll(endWiddget);
return showWidgetArr; return showWidgetArr;
} }
// //
Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable, bool bottomBtnisEable, Function() onClick) { Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable,
bool bottomBtnisEable, Function() onClick) {
var width = 42.w; var width = 42.w;
var height = 42.h; var height = 42.h;
return GestureDetector( return GestureDetector(
onTap:openDoorBtnisUneable ? (bottomBtnisEable ? onClick : () { onTap: openDoorBtnisUneable
logic.showToast("请在锁旁边完成第一次开锁"); ? (bottomBtnisEable
}) : null, ? onClick
: () {
logic.showToast("请在锁旁边完成第一次开锁");
})
: null,
child: Container( child: Container(
// height: 300.h, // height: 300.h,
color: Colors.white, color: Colors.white,
@ -741,9 +797,11 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
child: Image.asset(iconUrl, child: Image.asset(iconUrl,
width: width, width: width,
height: height, height: height,
color: openDoorBtnisUneable ? (bottomBtnisEable color: openDoorBtnisUneable
? AppColors.mainColor ? (bottomBtnisEable
: AppColors.lockDetailBottomBtnUneable) : AppColors.lockDetailBottomBtnUneable, ? AppColors.mainColor
: AppColors.lockDetailBottomBtnUneable)
: AppColors.lockDetailBottomBtnUneable,
fit: BoxFit.fitWidth), fit: BoxFit.fitWidth),
), ),
SizedBox(height: 10.w), SizedBox(height: 10.w),
@ -751,9 +809,11 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
child: Text(name, child: Text(name,
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 20.sp,
color:openDoorBtnisUneable ? (bottomBtnisEable color: openDoorBtnisUneable
? AppColors.blackColor ? (bottomBtnisEable
: AppColors.lockDetailBottomBtnUneable) : AppColors.lockDetailBottomBtnUneable), ? AppColors.blackColor
: AppColors.lockDetailBottomBtnUneable)
: AppColors.lockDetailBottomBtnUneable),
textAlign: TextAlign.center)) textAlign: TextAlign.center))
], ],
)), )),
@ -762,7 +822,8 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
listeningAnimations() async { listeningAnimations() async {
await Future.delayed(Duration.zero, () { await Future.delayed(Duration.zero, () {
state.animationController = AnimationController(duration: const Duration(seconds: 1), vsync: this); state.animationController = AnimationController(
duration: const Duration(seconds: 1), vsync: this);
state.animationController!.repeat(); state.animationController!.repeat();
//StatusListener //StatusListener
state.animationController!.addStatusListener((status) { state.animationController!.addStatusListener((status) {
@ -996,5 +1057,4 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
// state.animationController!.stop(); // state.animationController!.stop();
// } // }
} }
} }

View File

@ -51,6 +51,8 @@ class LockDetailState {
final PageController pageController = PageController(); final PageController pageController = PageController();
var currentPage = 0.obs; var currentPage = 0.obs;
late BuildContext widgetContext;
// LockDetailState() { // LockDetailState() {
// Map map = Get.arguments; // Map map = Get.arguments;
// lockCount = map["lockCount"]; // lockCount = map["lockCount"];

View File

@ -20,6 +20,13 @@ class _LockMonitoringPageState extends State<LockMonitoringPage> {
final logic = Get.put(LockMonitoringLogic()); final logic = Get.put(LockMonitoringLogic());
final state = Get.find<LockMonitoringLogic>().state; final state = Get.find<LockMonitoringLogic>().state;
@override
void initState() {
super.initState();
requestMicrophonePermission();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return SizedBox(
@ -155,18 +162,9 @@ class _LockMonitoringPageState extends State<LockMonitoringPage> {
Widget bottomBottomBtnWidget() { Widget bottomBottomBtnWidget() {
return Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ return Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
// //
Obx(() => bottomBtnItemWidget(getAnswerBtnImg(), getAnswerBtnName(), Colors.white, () async { Obx(() => bottomBtnItemWidget(
// getAnswerBtnImg(), getAnswerBtnName(), Colors.white, () async {
await logic.getPermissionStatus().then((value) async { logic.udpAnswerAction();
if (!value) {
return;
}
// state.isSenderAudioData.value = false;
print("发送接听了");
//
logic.udpAnswerAction();
});
}, longPress: () { }, longPress: () {
// //
print("onLongPress"); print("onLongPress");
@ -292,6 +290,19 @@ class _LockMonitoringPageState extends State<LockMonitoringPage> {
); );
} }
//
Future requestMicrophonePermission() async {
await logic.getPermissionStatus().then((value) async {
if (!value) {
return;
}
// state.isSenderAudioData.value = false;
print("发送接听了");
//
});
}
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();

View File

@ -1,4 +1,3 @@
import 'dart:async'; import 'dart:async';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
@ -14,27 +13,27 @@ import 'lockMain_state.dart';
class LockMainLogic extends BaseGetXController { class LockMainLogic extends BaseGetXController {
final LockMainState state = LockMainState(); final LockMainState state = LockMainState();
Future<LockListInfoEntity> getStarLockInfo() async{ Future<LockListInfoEntity> getStarLockInfo() async {
LockListInfoEntity entity = await ApiRepository.to.getStarLockListInfo( LockListInfoEntity entity = await ApiRepository.to.getStarLockListInfo(
pageNo:pageNo, pageNo: pageNo,
pageSize:50, pageSize: 50,
); );
if(entity.errorCode!.codeIsSuccessful){ if (entity.errorCode!.codeIsSuccessful) {
if(entity.data!.groupList!.isEmpty){ if (entity.data!.groupList!.isEmpty) {
state.dataLength.value = 0; state.dataLength.value = 0;
}else if(entity.data!.groupList!.length == 1){ } else if (entity.data!.groupList!.length == 1) {
GroupList groupList = entity.data!.groupList![0]; GroupList groupList = entity.data!.groupList![0];
if(groupList.lockList!.length > 1){ if (groupList.lockList!.length > 1) {
state.dataLength.value = 2; state.dataLength.value = 2;
}else{ } else {
state.dataLength.value = 1; state.dataLength.value = 1;
} }
}else{ } else {
state.dataLength.value = 2; state.dataLength.value = 2;
} }
state.lockListInfoEntity.value = entity; state.lockListInfoEntity.value = entity;
// return entity.data!; // return entity.data!;
}else{ } else {
print("首页锁列表请求失败"); print("首页锁列表请求失败");
state.dataLength.value = 0; state.dataLength.value = 0;
} }
@ -70,7 +69,8 @@ class LockMainLogic extends BaseGetXController {
connectListener() async { connectListener() async {
Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
print("设置网络切换监听:$result"); print("设置网络切换监听:$result");
if(state.networkConnectionStatus.value == 0 && result != ConnectivityResult.none){ if (state.networkConnectionStatus.value == 0 &&
result != ConnectivityResult.none) {
// //
state.networkConnectionStatus.value = 1; state.networkConnectionStatus.value = 1;
getStarLockInfo(); getStarLockInfo();
@ -85,7 +85,7 @@ class LockMainLogic extends BaseGetXController {
print("onReady()"); print("onReady()");
// UDP // UDP
// UdpHelp().openUDP(); UdpHelp().openUDP();
BlueManage(); BlueManage();
} }
@ -112,5 +112,4 @@ class LockMainLogic extends BaseGetXController {
// _teamEvent.cancel(); // _teamEvent.cancel();
// state.timer.cancel(); // state.timer.cancel();
} }
}
}

View File

@ -0,0 +1,8 @@
import 'flavors.dart';
import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.xie;
await runner.main();
}

View File

@ -1,6 +1,6 @@
import 'dart:ffi';
import 'dart:io'; import 'dart:io';
import 'package:cached_network_image/cached_network_image.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 'package:get/get.dart';
@ -23,16 +23,36 @@ class MinePersonInfoPage extends StatefulWidget {
State<MinePersonInfoPage> createState() => _MinePersonInfoPageState(); State<MinePersonInfoPage> createState() => _MinePersonInfoPageState();
} }
class _MinePersonInfoPageState extends State<MinePersonInfoPage> { class _MinePersonInfoPageState extends State<MinePersonInfoPage>
with WidgetsBindingObserver {
final logic = Get.put(MinePersonInfoLogic()); final logic = Get.put(MinePersonInfoLogic());
final state = Get.find<MinePersonInfoLogic>().state; final state = Get.find<MinePersonInfoLogic>().state;
@override @override
initState() { initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); //
logic.getUserInfoRequest(); logic.getUserInfoRequest();
_checkCameraPermission();
_checkPhotoPermission();
} }
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this); //
super.dispose();
}
// //
// @override
// void didChangeAppLifecycleState(AppLifecycleState state) {
// super.didChangeAppLifecycleState(state);
// if (state == AppLifecycleState.resumed) {
// //
// checkCameraPermission();
// }
// }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -176,54 +196,58 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
)); ));
} }
Future<void> requestCameraPermission() async { // Future<void> requestCameraPermission() async {
// // var status = await Permission.camera.status;
PermissionStatus status = await Permission.camera.status; // if (status.isGranted) {
// selectCamera();
// } else {
// status = await Permission.camera.request();
// if (status.isGranted) {
// selectCamera();
// } else {
// showPermissionDeniedDialog();
// }
// }
// }
Future<void> _requestCameraPermission() async {
var status = await Permission.camera.request();
if (status.isGranted) { if (status.isGranted) {
// setState(() {
// state.hasCameraPermission.value = true; //
selectCamera(); });
} else { } else {
// //
// showPermissionDeniedDialog();
status = await Permission.camera.request();
if (status.isGranted) {
//
selectCamera();
} else {
//
//
showPermissionDeniedDialog();
}
} }
} }
Future<void> requestPhotoPermission() async { Future<void> _requestPhotoPermission() async {
// var status = await Permission.photos.request();
PermissionStatus status = await Permission.photos.status;
if (status.isGranted) { if (status.isGranted) {
// setState(() {
// state.hasPhotoPermission.value = true; //
selectImage(); });
} else { } else {
// //
// showPermissionDeniedDialog();
status = await Permission.photos.request();
if (status.isGranted) {
//
selectImage();
} else {
//
//
showPermissionDeniedDialog();
}
} }
} }
// Future<void> requestPhotoPermission() async {
// var status = await Permission.photos.status;
// if (status.isGranted) {
// selectImage();
// } else {
// status = await Permission.photos.request();
// if (status.isGranted) {
// selectImage();
// } else {
// showPermissionDeniedDialog();
// }
// }
// }
// //
void showPermissionDeniedDialog() { void showPermissionDeniedDialog() {
showDialog( showDialog(
@ -236,8 +260,8 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
TextButton( TextButton(
child: const Text('去设置'), child: const Text('去设置'),
onPressed: () { onPressed: () {
openAppSettings(); //
Navigator.of(context).pop(); // Navigator.of(context).pop(); //
openAppSettings(); //
}, },
), ),
], ],
@ -259,11 +283,13 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
int getSelectIndex = value; int getSelectIndex = value;
if (getSelectIndex == 0) { if (getSelectIndex == 0) {
// //
// selectCamera(); state.hasCameraPermission.value == true
requestCameraPermission(); ? selectCamera()
: _requestCameraPermission();
} else if (getSelectIndex == 1) { } else if (getSelectIndex == 1) {
// selectImage(); state.hasPhotoPermission.value == true
requestPhotoPermission(); ? selectImage()
: _requestPhotoPermission();
} }
}, },
); );
@ -300,23 +326,29 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
} }
} }
// child: state.mineInfoData.value.headUrl != null Future<void> _checkCameraPermission() async {
// ? CachedNetworkImage( var status = await Permission.camera.status;
// imageUrl: Uri.encodeFull( if (status.isGranted) {
// state.mineInfoData.value.headUrl!), setState(() {
// width: 72.w, state.hasCameraPermission.value = true; //
// height: 72.w, });
// fit: BoxFit.fill, } else {
// placeholder: (context, url) => Image.asset( setState(() {
// 'images/controls_user.png', state.hasCameraPermission.value = false; //
// width: 72.w, });
// height: 72.w, }
// fit: BoxFit.fill, }
// ))
// : Image.asset( Future<void> _checkPhotoPermission() async {
// 'images/controls_user.png', var status = await Permission.photos.status;
// width: 72.w, if (status.isGranted) {
// height: 72.w, setState(() {
// fit: BoxFit.fill, state.hasPhotoPermission.value = true; //
// ), });
} else {
setState(() {
state.hasPhotoPermission.value = false; //
});
}
}
} }

View File

@ -12,4 +12,7 @@ class MinePersonInfoState {
List<XFile>? imageList; List<XFile>? imageList;
// 使ImagePicker前必须先实例化 // 使ImagePicker前必须先实例化
final ImagePicker imagePicker = ImagePicker(); final ImagePicker imagePicker = ImagePicker();
var hasPhotoPermission = false.obs; //
var hasCameraPermission = false.obs; //
} }

View File

@ -2,6 +2,8 @@ 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:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart';
import 'package:star_lock/talk/call/callTalk.dart';
import '../../appRouters.dart'; import '../../appRouters.dart';
import '../../tools/storage.dart'; import '../../tools/storage.dart';
import 'udp_manage.dart'; import 'udp_manage.dart';
@ -68,6 +70,10 @@ class UDPTalkClass {
Get.toNamed(Routers.lockMonitoringPage, arguments: {"lockId": "111"}); Get.toNamed(Routers.lockMonitoringPage, arguments: {"lockId": "111"});
} }
Timer(const Duration(minutes: 1), () {
stopLocalAudio();
callNoAnswer();
});
playLocalAudio(); playLocalAudio();
} else { } else {
@ -127,4 +133,13 @@ class UDPTalkClass {
audioPlayer.setReleaseMode(ReleaseMode.loop); audioPlayer.setReleaseMode(ReleaseMode.loop);
await audioPlayer.stop(); await audioPlayer.stop();
} }
//
void callNoAnswer() {
CallTalk().stopPcmSound();
//
LockMonitoringLogic().udpHangUpAction();
//
Get.back();
}
} }

View File

@ -1,137 +0,0 @@
/*
import 'dart:io';
import 'package:aliyun_push/aliyun_push.dart';
import 'package:star_lock/flavors.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class XSAliyunPushProvider {
late AliyunPush _aliyunPush = AliyunPush();
Future<void> init(AliyunPush aliyunPush) async {
_aliyunPush = aliyunPush;
if (Platform.isAndroid) {
_aliyunPush.createAndroidChannel('1', '测试通道A', 3, '测试创建通知通道');
_aliyunPush.setAndroidLogLevel(kAliyunPushLogLevelError);
}
_addPushCallback();
}
Future<void> _onNotification(Map<dynamic, dynamic> message) async {
// print('onNotification: $message');
}
Future<void> _onAndroidNotificationReceivedInApp(
Map<dynamic, dynamic> message) async {
// print('onAndroidNotificationReceivedInApp: $message');
}
Future<void> _onMessage(Map<dynamic, dynamic> message) async {
// print('onMessage: $message');
}
Future<void> _onNotificationOpened(Map<dynamic, dynamic> message) async {
// print('onNotificationOpened: $message');
}
Future<void> _onNotificationRemoved(Map<dynamic, dynamic> message) async {
// print('onNotificationRemoved: $message');
}
Future<void> _onAndroidNotificationClickedWithNoAction(
Map<dynamic, dynamic> message) async {
// print('onAndroidNotificationClickedWithNoAction: $message');
}
Future<void> _onIOSChannelOpened(Map<dynamic, dynamic> message) async {}
Future<void> _onIOSRegisterDeviceTokenSuccess(
Map<dynamic, dynamic> message) async {
// Toast.show(msg: 'APNs注册成功, $message');
}
Future<void> _onIOSRegisterDeviceTokenFailed(
Map<dynamic, dynamic> message) async {
// Toast.show(msg: '注册APNs失败, errorMsg: $message');
}
_addPushCallback() {
_aliyunPush.addMessageReceiver(
onNotification: _onNotification,
onNotificationOpened: _onNotificationOpened,
onNotificationRemoved: _onNotificationRemoved,
onMessage: _onMessage,
onAndroidNotificationReceivedInApp: _onAndroidNotificationReceivedInApp,
onAndroidNotificationClickedWithNoAction:
_onAndroidNotificationClickedWithNoAction,
onIOSChannelOpened: _onIOSChannelOpened,
onIOSRegisterDeviceTokenSuccess: _onIOSRegisterDeviceTokenSuccess,
onIOSRegisterDeviceTokenFailed: _onIOSRegisterDeviceTokenFailed);
}
Future<void> initAliyunPush() async {
String appKey;
String appSecret;
if (Platform.isIOS) {
if (F.appFlavor == Flavor.sky) {
appKey = "334068745";
appSecret = "bee9c200835e4951a85dc8709c319560";
} else {
appKey = "333904046";
appSecret = "3eead09a7fc7416cb4082319aa6f48c6";
}
} else {
if (F.appFlavor == Flavor.sky) {
appKey = "334068743";
appSecret = "64de537f14984159a66ada10e54c6b63";
} else {
appKey = "333904040";
appSecret = "c316965fe0a74fc9a481a5c44a535dc2";
}
}
_aliyunPush
.initPush(appKey: appKey, appSecret: appSecret)
.then((initResult) {
var code = initResult['code'];
if (code == kAliyunPushSuccessCode) {
// Toast.show(msg: "初始化推送成功");
} else {
String errorMsg = initResult['errorMsg'];
// print('初始化推送失败,原因为:$errorMsg');
// Toast.show(msg: '初始化推送失败, errorMsg: $errorMsg.}');
}
});
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
}
Future<void> initAliyunThirdPush() async {
// Platform messages may fail, so we use a try/catch PlatformException.
// We also handle the message potentially returning null.
_aliyunPush.initAndroidThirdPush().then((initResult) {
var code = initResult['code'];
if (code == kAliyunPushSuccessCode) {
// Toast.show(msg: "初始化辅助通道成功");
} else {
String errorMsg = initResult['errorMsg'];
// Toast.show(msg: '初始化辅助通道成功, errorMsg: $errorMsg');
// print("初始化辅助通道失败,原因为:$errorMsg");
}
});
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
}
void pushBindDeviceID(String deviceID, int deviceType) async {
var entity = await ApiRepository.to.pushBindAppId(deviceID, deviceType);
if (entity.errorCode!.codeIsSuccessful) {}
}
}
*/

View File

@ -0,0 +1,53 @@
import 'dart:io';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/storage.dart';
class XSJPushProvider {
final JPush jpush = JPush();
Future<void> initJPushService() async {
final data = await Storage.getString(saveUserLoginData);
if (data != null && data.isNotEmpty) {
jpush.setup(
appKey: "7ff37d174c1a568a89e98dad",
channel: "flutter_channel",
production: false,
debug: true,
);
jpush.addEventHandler(
//
onReceiveNotification: (Map<String, dynamic> message) async {
print("flutter onReceiveNotification: $message");
},
//
onOpenNotification: (Map<String, dynamic> message) async {
print("flutter onOpenNotification: $message");
},
//
onReceiveMessage: (Map<String, dynamic> message) async {
print("flutter onReceiveMessage: $message");
},
);
jpush.applyPushAuthority(
const NotificationSettingsIOS(sound: true, alert: true, badge: true));
// jpush.setChannelAndSound(
// channel: "flutter_channel", channelID: "115700", sound: "default");
// Platform messages may fail, so we use a try/catch PlatformException.
jpush.getRegistrationID().then((rid) {
print("flutter get registration id : $rid");
pushBindDeviceID(rid, Platform.isAndroid ? 10 : 20);
});
}
}
void pushBindDeviceID(String deviceID, int deviceType) async {
var entity = await ApiRepository.to.pushBindAppId(deviceID, deviceType);
if (entity.errorCode!.codeIsSuccessful) {}
}
}

View File

@ -101,8 +101,8 @@ class VersionUndateTool {
child: Text("下次再说"), child: Text("下次再说"),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
Storage.setString( // Storage.setString(
isShowUpdateVersion, isShowUpdateVersion); // isShowUpdateVersion, isShowUpdateVersion);
}, },
), ),
CupertinoDialogAction( CupertinoDialogAction(

View File

@ -18,8 +18,11 @@ 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.
# 版本说明: # 版本说明:
# 1.0.18+20240321打包给欧阳测试 # 1.0.18+2024032001修复同意隐私政策前获取SN
version: 1.0.19+20240321 # 1.0.18+2024032002修复注册页布局错乱修复第二次才可以删除锁的问题修改申请权限字符串
# 1.0.18+20240321(2024032101):打包给欧阳测试
# 1.0.20+2024032102修复Apple Store App Tracking Transparency权限问题
version: 1.0.20+2024032102
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'