Merge branch 'develop_liuyf' into feat_devops
This commit is contained in:
commit
0d9d608289
@ -23,6 +23,9 @@ if (flutterVersionName == null) {
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
// START: FlutterFire Configuration
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
// END: FlutterFire Configuration
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
apply plugin: 'com.android.application'
|
||||
@ -304,6 +307,6 @@ dependencies {
|
||||
implementation 'cn.jiguang.sdk.plugin:vivo:5.2.3'
|
||||
|
||||
// Umeng统计
|
||||
implementation 'com.umeng.umsdk:common:9.3.7'
|
||||
implementation 'com.umeng.umsdk:asms:1.4.1'
|
||||
implementation 'com.umeng.umsdk:common:9.7.9'
|
||||
implementation 'com.umeng.umsdk:asms:1.8.5'
|
||||
}
|
||||
|
||||
@ -2,14 +2,14 @@
|
||||
"project_info": {
|
||||
"project_number": "281500445726",
|
||||
"project_id": "skychip2023-ecdff",
|
||||
"storage_bucket": "skychip2023-ecdff.appspot.com"
|
||||
"storage_bucket": "skychip2023-ecdff.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:281500445726:android:ddf52ac7b7f83cf5c4d20f",
|
||||
"mobilesdk_app_id": "1:281500445726:android:468195b9cc68dd6cc4d20f",
|
||||
"android_client_info": {
|
||||
"package_name": "com.skychip.lock"
|
||||
"package_name": "com.starlock.lock.local"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.example.star_lock">
|
||||
package="com.skychip.lock">
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.BLUETOOTH_SCAN"
|
||||
@ -8,8 +8,6 @@
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />-->
|
||||
<!--允许访问网络,必选权限-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<!--允许获取精确位置,精准定位必选-->
|
||||
@ -58,14 +56,8 @@
|
||||
|
||||
<uses-permission android:name="com.hihonor.permission.sec.SDK_LAUNCHER" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
|
||||
<application
|
||||
android:name="android.app.Application"
|
||||
android:name=".App"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
@ -149,7 +141,7 @@
|
||||
</intent-filter>
|
||||
</service> <!--兼容Q版本-->
|
||||
<activity
|
||||
android:name="com.skychip.lock.MainActivity"
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
|
||||
16
android/app/src/main/kotlin/com/skychip/lock/App.kt
Executable file
16
android/app/src/main/kotlin/com/skychip/lock/App.kt
Executable file
@ -0,0 +1,16 @@
|
||||
package com.skychip.lock
|
||||
|
||||
import io.flutter.app.FlutterApplication
|
||||
import android.util.Log
|
||||
//import com.umeng.commonsdk.UMConfigure;
|
||||
|
||||
class App : FlutterApplication() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
// UMConfigure.setLogEnabled(true);
|
||||
//友盟预初始化
|
||||
// UMConfigure.preInit(getApplicationContext(), "671244cf80464b33f6df9648", "Product");
|
||||
Log.d("MyApplication", "Application has started")
|
||||
}
|
||||
}
|
||||
@ -20,9 +20,12 @@ class MainActivity : FlutterActivity() {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine!!)
|
||||
|
||||
// 初始化 Umeng SDK
|
||||
UMConfigure.init(this, "671244cf80464b33f6df9648", "Product", UMConfigure.DEVICE_TYPE_PHONE, null)
|
||||
// UMConfigure.init(this, "671244cf80464b33f6df9648", "Product", UMConfigure.DEVICE_TYPE_PHONE, null)
|
||||
|
||||
MethodChannel(flutterEngine?.dartExecutor!!.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { call, result ->
|
||||
MethodChannel(
|
||||
flutterEngine?.dartExecutor!!.binaryMessenger,
|
||||
"starLockFlutterSend"
|
||||
).setMethodCallHandler { call, result ->
|
||||
if (call.method == "loadNativeShare") {
|
||||
val map = call.arguments as Map<String, String>
|
||||
val shareText = map["shareText"]
|
||||
@ -32,7 +35,7 @@ class MainActivity : FlutterActivity() {
|
||||
} else {
|
||||
shareText(shareText, "分享")
|
||||
}
|
||||
} else if (call.method == "sendGetBlueStatus") {
|
||||
} else if (call.method == "sendGetBlueStatus") {
|
||||
// 蓝牙是否开启
|
||||
// println("收到原生的信息了 methodmethodmethod: ${call.method}")
|
||||
val bluetoothAdapter: BluetoothAdapter? = BluetoothAdapter.getDefaultAdapter()
|
||||
@ -50,7 +53,10 @@ class MainActivity : FlutterActivity() {
|
||||
status = "-1"
|
||||
}
|
||||
val flutterEngine: FlutterEngine? = this.flutterEngine // 获取你的 FlutterEngine 实例
|
||||
MethodChannel(flutterEngine?.dartExecutor!!.binaryMessenger, "starLockFlutterReceive").invokeMethod("getBlueStatus", status)
|
||||
MethodChannel(
|
||||
flutterEngine?.dartExecutor!!.binaryMessenger,
|
||||
"starLockFlutterReceive"
|
||||
).invokeMethod("getBlueStatus", status)
|
||||
} else {
|
||||
result.notImplemented() // 没有实现的方法
|
||||
}
|
||||
@ -96,7 +102,10 @@ class MainActivity : FlutterActivity() {
|
||||
|
||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine)
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { call, result ->
|
||||
MethodChannel(
|
||||
flutterEngine.dartExecutor.binaryMessenger,
|
||||
"starLockFlutterSend"
|
||||
).setMethodCallHandler { call, result ->
|
||||
if (call.method == "loadNativeShare") {
|
||||
val map = call.arguments as Map<String, String>
|
||||
val shareText = map["shareText"]
|
||||
|
||||
48
android/app/src/sky/google-services.json
Normal file
48
android/app/src/sky/google-services.json
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "281500445726",
|
||||
"project_id": "skychip2023-ecdff",
|
||||
"storage_bucket": "skychip2023-ecdff.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:281500445726:android:ddf52ac7b7f83cf5c4d20f",
|
||||
"android_client_info": {
|
||||
"package_name": "com.skychip.lock"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:281500445726:android:468195b9cc68dd6cc4d20f",
|
||||
"android_client_info": {
|
||||
"package_name": "com.starlock.lock.local"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
1
firebase.json
Normal file
1
firebase.json
Normal file
@ -0,0 +1 @@
|
||||
{"flutter":{"platforms":{"android":{"default":{"projectId":"skychip2023-ecdff","appId":"1:281500445726:android:468195b9cc68dd6cc4d20f","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"skychip2023-ecdff","appId":"1:281500445726:ios:b194ccffb92fb86cc4d20f","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"skychip2023-ecdff","configurations":{"android":"1:281500445726:android:468195b9cc68dd6cc4d20f","ios":"1:281500445726:ios:b194ccffb92fb86cc4d20f"}}}}}}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 45 KiB |
@ -5,7 +5,7 @@
|
||||
#import "XSFlutterManager.h"
|
||||
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
#import <UMCommon/UMCommon.h>
|
||||
// #import <UMCommon/UMCommon.h>
|
||||
|
||||
|
||||
@interface AppDelegate()
|
||||
@ -19,7 +19,7 @@
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
|
||||
[UMConfigure initWithAppkey:@"671244ae80464b33f6df9646" channel:@"Product"];
|
||||
// [UMConfigure initWithAppkey:@"671244ae80464b33f6df9646" channel:@"Product"];
|
||||
|
||||
XSFlutterManager *VC = [[XSFlutterManager alloc] init];
|
||||
self.window.rootViewController = VC;
|
||||
|
||||
@ -87,11 +87,11 @@
|
||||
<key>NSFileProtectionKey</key>
|
||||
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>应用请求麦克风用来通话</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
|
||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="The app uses bluetooth to find, connect and t
|
||||
NSBluetoothPeripheralUsageDescription="The app uses bluetooth to find, connect and transfer data between different devices";
|
||||
NSCameraUsageDescription="The application requests the camera to take photos for avatar upload and face authentication";
|
||||
NSContactsUsageDescription="Access the address book to send electronic keys to contacts in the address book";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="updated location information when applying in the front and backend";
|
||||
NSLocationAlwaysUsageDescription="updated location information when the app is in the background";
|
||||
NSLocationWhenInUseUsageDescription="updated location information when the app is in the foreground";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||
NSLocationAlwaysUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||
NSLocationWhenInUseUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||
NSMicrophoneUsageDescription="request microphone for calls";
|
||||
NSPhotoLibraryUsageDescription="request photo album for avatar upload";
|
||||
|
||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="The app uses bluetooth to find, connect and t
|
||||
NSBluetoothPeripheralUsageDescription="The app uses bluetooth to find, connect and transfer data between different devices";
|
||||
NSCameraUsageDescription="The application requests the camera to take photos for avatar upload and face authentication";
|
||||
NSContactsUsageDescription="Access the address book to send electronic keys to contacts in the address book";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="updated location information when applying in the front and backend";
|
||||
NSLocationAlwaysUsageDescription="updated location information when the app is in the background";
|
||||
NSLocationWhenInUseUsageDescription="updated location information when the app is in the foreground";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||
NSLocationAlwaysUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||
NSLocationWhenInUseUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||
NSMicrophoneUsageDescription="request microphone for calls";
|
||||
NSPhotoLibraryUsageDescription="request photo album for avatar upload";
|
||||
|
||||
@ -87,11 +87,11 @@
|
||||
<key>NSFileProtectionKey</key>
|
||||
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>应用请求麦克风用来通话</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
|
||||
@ -85,11 +85,11 @@
|
||||
<key>NSContactsUsageDescription</key>
|
||||
<string>Reason we need access to the contact list</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>应用请求麦克风用来通话</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
|
||||
@ -85,11 +85,11 @@
|
||||
<key>NSContactsUsageDescription</key>
|
||||
<string>Reason we need access to the contact list</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>应用请求麦克风用来通话</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
|
||||
@ -87,11 +87,11 @@
|
||||
<key>NSFileProtectionKey</key>
|
||||
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
||||
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>应用请求麦克风用来通话</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
|
||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="该应用程序使用蓝牙在不同设备之
|
||||
NSBluetoothPeripheralUsageDescription="该应用程序使用蓝牙在不同设备之间查找、连接和传输数据";
|
||||
NSCameraUsageDescription="应用请求相机,以便于拍摄照片,用于头像上传及人脸认证";
|
||||
NSContactsUsageDescription="应用访问通讯录,用于给通讯录中的联系人发送电子钥匙";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="应用在前台和后台的时候可以搜到更新的位置信息";
|
||||
NSLocationAlwaysUsageDescription="应用在后台的时候可以搜到更新的位置信息";
|
||||
NSLocationWhenInUseUsageDescription="应用在前台的时候可以搜到更新的位置信息";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||
NSLocationAlwaysUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||
NSLocationWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||
NSMicrophoneUsageDescription="应用请求麦克风用来通话";
|
||||
NSPhotoLibraryUsageDescription="应用请求相册用于头像上传";
|
||||
|
||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="该应用程序使用蓝牙在不同设备之
|
||||
NSBluetoothPeripheralUsageDescription="该应用程序使用蓝牙在不同设备之间查找、连接和传输数据";
|
||||
NSCameraUsageDescription="应用请求相机,以便于拍摄照片,用于头像上传及人脸认证";
|
||||
NSContactsUsageDescription="应用访问通讯录,用于给通讯录中的联系人发送电子钥匙";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="应用在前台和后台的时候可以搜到更新的位置信息";
|
||||
NSLocationAlwaysUsageDescription="应用在后台的时候可以搜到更新的位置信息";
|
||||
NSLocationWhenInUseUsageDescription="应用在前台的时候可以搜到更新的位置信息";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||
NSLocationAlwaysUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||
NSLocationWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||
NSMicrophoneUsageDescription="应用请求麦克风用来通话";
|
||||
NSPhotoLibraryUsageDescription="应用请求相册用于头像上传";
|
||||
|
||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="该应用程序使用蓝牙在不同设备之
|
||||
NSBluetoothPeripheralUsageDescription="该应用程序使用蓝牙在不同设备之间查找、连接和传输数据";
|
||||
NSCameraUsageDescription="应用请求相机,以便于拍摄照片,用于头像上传及人脸认证";
|
||||
NSContactsUsageDescription="应用访问通讯录,用于给通讯录中的联系人发送电子钥匙";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="应用在前台和后台的时候可以搜到更新的位置信息";
|
||||
NSLocationAlwaysUsageDescription="应用在后台的时候可以搜到更新的位置信息";
|
||||
NSLocationWhenInUseUsageDescription="应用在前台的时候可以搜到更新的位置信息";
|
||||
NSLocationAlwaysAndWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||
NSLocationAlwaysUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||
NSLocationWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||
NSMicrophoneUsageDescription="应用请求麦克风用来通话";
|
||||
NSPhotoLibraryUsageDescription="应用请求相册用于头像上传";
|
||||
|
||||
1996
lan/lan_hk.json
1996
lan/lan_hk.json
File diff suppressed because it is too large
Load Diff
71
lib/apm/apm_helper.dart
Normal file
71
lib/apm/apm_helper.dart
Normal file
@ -0,0 +1,71 @@
|
||||
//<com>
|
||||
import 'firebase/firebase_helper.dart';
|
||||
|
||||
//</com>
|
||||
|
||||
//<cn>
|
||||
import 'umeng/umeng_helper.dart';
|
||||
//</cn>
|
||||
|
||||
class ApmHelper {
|
||||
ApmHelper._internal();
|
||||
|
||||
factory ApmHelper() => _getInstance();
|
||||
|
||||
static ApmHelper get instance => _getInstance();
|
||||
static ApmHelper? _instance;
|
||||
|
||||
// 增加开关
|
||||
static bool enabled = false;
|
||||
|
||||
static ApmHelper _getInstance() {
|
||||
_instance ??= ApmHelper._internal();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
Future<void> initApp() async {
|
||||
//<cn>
|
||||
await UmengHelper.instance.initApp();
|
||||
//</cn>
|
||||
//<com>
|
||||
await FirebaseHelper.instance.initApp();
|
||||
//</com>
|
||||
}
|
||||
|
||||
Future<void> initSdk() async {
|
||||
//<cn>
|
||||
UmengHelper.instance.initSdk();
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.initSdk();
|
||||
//</com>
|
||||
}
|
||||
|
||||
Future<void> login(String userId) async {
|
||||
//<cn>
|
||||
UmengHelper.instance.login(userId);
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.login(userId);
|
||||
//</com>
|
||||
}
|
||||
|
||||
Future<void> trackEvent(
|
||||
String eventName, Map<String, Object> parameters) async {
|
||||
//<cn>
|
||||
UmengHelper.instance.trackEvent(eventName, parameters);
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.trackEvent(eventName, parameters);
|
||||
//</com>
|
||||
}
|
||||
|
||||
Future<void> logout() async {
|
||||
//<cn>
|
||||
UmengHelper.instance.logout();
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.logout();
|
||||
//</com>
|
||||
}
|
||||
}
|
||||
77
lib/apm/firebase/firebase_helper.dart
Normal file
77
lib/apm/firebase/firebase_helper.dart
Normal file
@ -0,0 +1,77 @@
|
||||
//<com>
|
||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:firebase_core/firebase_core.dart'
|
||||
show Firebase, FirebaseOptions;
|
||||
import 'package:flutter/foundation.dart'
|
||||
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||
|
||||
class DefaultFirebaseOptions {
|
||||
static FirebaseOptions get currentPlatform {
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.android:
|
||||
return android;
|
||||
case TargetPlatform.iOS:
|
||||
return ios;
|
||||
default:
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions are not supported for this platform.',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static const FirebaseOptions android = FirebaseOptions(
|
||||
apiKey: 'AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g',
|
||||
appId: '1:281500445726:android:ddf52ac7b7f83cf5c4d20f',
|
||||
messagingSenderId: '281500445726',
|
||||
projectId: 'skychip2023-ecdff',
|
||||
storageBucket: 'skychip2023-ecdff.firebasestorage.app',
|
||||
);
|
||||
|
||||
static const FirebaseOptions ios = FirebaseOptions(
|
||||
apiKey: 'AIzaSyACbp5aUKhLU1SMg8iIdm9WmNX7wxI7fVc',
|
||||
appId: '1:281500445726:ios:b194ccffb92fb86cc4d20f',
|
||||
messagingSenderId: '281500445726',
|
||||
projectId: 'skychip2023-ecdff',
|
||||
storageBucket: 'skychip2023-ecdff.firebasestorage.app',
|
||||
iosBundleId: 'com.starlock.lock.local',
|
||||
);
|
||||
}
|
||||
|
||||
class FirebaseHelper {
|
||||
factory FirebaseHelper() => _getInstance();
|
||||
|
||||
FirebaseHelper._internal();
|
||||
|
||||
static FirebaseHelper get instance => _getInstance();
|
||||
static FirebaseHelper? _instance;
|
||||
|
||||
static FirebaseHelper _getInstance() {
|
||||
_instance ??= FirebaseHelper._internal();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
Future<void> initApp() async {
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> initSdk() async {
|
||||
FirebaseAnalytics.instance.setAnalyticsCollectionEnabled(true);
|
||||
}
|
||||
|
||||
Future<void> login(String userId) async {
|
||||
FirebaseAnalytics.instance.setUserId(id: userId);
|
||||
}
|
||||
|
||||
Future<void> trackEvent(
|
||||
String eventName, Map<String, Object>? parameters) async {
|
||||
FirebaseAnalytics.instance
|
||||
.logEvent(name: eventName, parameters: parameters);
|
||||
}
|
||||
|
||||
Future<void> logout() async {
|
||||
FirebaseAnalytics.instance.setUserId(id: '');
|
||||
}
|
||||
}
|
||||
//</com>
|
||||
41
lib/apm/umeng/umeng_helper.dart
Normal file
41
lib/apm/umeng/umeng_helper.dart
Normal file
@ -0,0 +1,41 @@
|
||||
//<cn>
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
import '../../flavors.dart';
|
||||
|
||||
class UmengHelper {
|
||||
UmengHelper._internal();
|
||||
|
||||
factory UmengHelper() => _getInstance();
|
||||
|
||||
static UmengHelper get instance => _getInstance();
|
||||
static UmengHelper? _instance;
|
||||
|
||||
static UmengHelper _getInstance() {
|
||||
_instance ??= UmengHelper._internal();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
Future<void> initApp() async {
|
||||
|
||||
}
|
||||
|
||||
Future<void> initSdk() async {
|
||||
UmengCommonSdk.initCommon(
|
||||
F.umengKey.androidKey, F.umengKey.iosKey, F.umengKey.channel);
|
||||
UmengCommonSdk.setPageCollectionModeManual();
|
||||
}
|
||||
|
||||
Future<void> login(String userId) async {
|
||||
UmengCommonSdk.onProfileSignIn(userId);
|
||||
}
|
||||
|
||||
Future<void> trackEvent(
|
||||
String eventName, Map<String, Object> parameters) async {
|
||||
UmengCommonSdk.onEvent(eventName, parameters);
|
||||
}
|
||||
|
||||
Future<void> logout() async {
|
||||
UmengCommonSdk.onProfileSignOff();
|
||||
}
|
||||
}
|
||||
//</cn>
|
||||
@ -22,6 +22,20 @@ class StarLockAMapKey {
|
||||
const StarLockAMapKey({required this.iosKey, required this.androidKey});
|
||||
}
|
||||
|
||||
class UmengKey {
|
||||
//iOS平台的key
|
||||
final String iosKey;
|
||||
|
||||
//Android平台的key
|
||||
final String androidKey;
|
||||
|
||||
//channle
|
||||
final String channel;
|
||||
|
||||
const UmengKey(
|
||||
{required this.iosKey, required this.androidKey, required this.channel});
|
||||
}
|
||||
|
||||
typedef dynamic fCallFunction();
|
||||
|
||||
class F {
|
||||
@ -180,6 +194,62 @@ class F {
|
||||
}
|
||||
}
|
||||
|
||||
// StarLockAMapKey
|
||||
static UmengKey get umengKey {
|
||||
switch (appFlavor) {
|
||||
case Flavor.local:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.dev:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.pre:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.sky_dev:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.sky_pre:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.sky:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.xhj_dev:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.xhj_pre:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.xhj:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
default:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
}
|
||||
}
|
||||
|
||||
// 是否是生产环境
|
||||
static bool get isProductionEnv {
|
||||
switch (appFlavor) {
|
||||
|
||||
@ -2,11 +2,11 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_state.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../network/api_repository.dart';
|
||||
import '../../tools/baseGetXController.dart';
|
||||
@ -55,7 +55,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
|
||||
'B748F838-94EE-4BDB-A0E6-7B2D16849792',
|
||||
state.verificationCode.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('resetPassword_result', {
|
||||
ApmHelper.instance.trackEvent('resetPassword_result', {
|
||||
'account':state.phoneStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'resetPassword_res':'成功',
|
||||
@ -64,7 +64,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
|
||||
showToast('重置成功'.tr);
|
||||
Get.back();
|
||||
}else{
|
||||
UmengCommonSdk.onEvent('resetPassword_result', {
|
||||
ApmHelper.instance.trackEvent('resetPassword_result', {
|
||||
'account':state.phoneStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'resetPassword_res':'${entity.errorCode}--${entity.errorMsg}',
|
||||
|
||||
@ -25,6 +25,7 @@ class LoginData {
|
||||
uid = json['uid'];
|
||||
isVip = json['isVip'];
|
||||
}
|
||||
|
||||
String? accessToken;
|
||||
int? userid;
|
||||
int? expiresAt;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
@ -7,7 +8,6 @@ import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/mine/mine/starLockMine_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../main/lockMian/lockMain/lockMain_logic.dart';
|
||||
import '../../mine/mine/starLockMine_logic.dart';
|
||||
@ -50,7 +50,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
||||
username: state.emailOrPhone.value,
|
||||
deviceInfo: state.deviceInfoMap);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('login_result', {
|
||||
ApmHelper.instance.trackEvent('login_result', {
|
||||
'account': state.emailOrPhone.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'login_res': '成功',
|
||||
@ -65,7 +65,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('login_result', {
|
||||
ApmHelper.instance.trackEvent('login_result', {
|
||||
'account': state.emailOrPhone.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'login_res': '${entity.errorCode}--${entity.errorMsg}',
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
@ -12,7 +12,6 @@ import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../network/api_repository.dart';
|
||||
import '../../tools/baseGetXController.dart';
|
||||
@ -26,6 +25,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
final StarLockRegisterState state = StarLockRegisterState();
|
||||
|
||||
late Timer _timer;
|
||||
|
||||
void _startTimer() {
|
||||
_timer = Timer.periodic(1.seconds, (Timer timer) {
|
||||
if (state.currentSecond > 1) {
|
||||
@ -49,7 +49,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!RegularExpression().validateString(state.pwd.value)){
|
||||
if (!RegularExpression().validateString(state.pwd.value)) {
|
||||
showToast('密码需至少包含数字/字母/字符中的2种组合'.tr);
|
||||
return;
|
||||
}
|
||||
@ -61,10 +61,10 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
verificationCode: state.verificationCode.value,
|
||||
deviceInfo: state.deviceInfoMap.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('register_result', {
|
||||
'account':state.phoneOrEmailStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'register_res':'成功',
|
||||
ApmHelper.instance.trackEvent('register_result', {
|
||||
'account': state.phoneOrEmailStr.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'register_res': '成功',
|
||||
});
|
||||
|
||||
Storage.saveLoginData(entity.data);
|
||||
@ -73,11 +73,11 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: false);
|
||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||
}else{
|
||||
UmengCommonSdk.onEvent('register_result', {
|
||||
'account':state.phoneOrEmailStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'register_res':'${entity.errorCode}--${entity.errorMsg}',
|
||||
} else {
|
||||
ApmHelper.instance.trackEvent('register_result', {
|
||||
'account': state.phoneOrEmailStr.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'register_res': '${entity.errorCode}--${entity.errorMsg}',
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -135,12 +135,15 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
|
||||
// 重置是否能提交
|
||||
void _resetCanSub() {
|
||||
state.canSub.value = state.pwdIsOK && state.codeIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
||||
state.canSub.value = state.pwdIsOK &&
|
||||
state.codeIsOK &&
|
||||
state.phoneOrEmailStr.value.isNotEmpty;
|
||||
}
|
||||
|
||||
// 重置是否能发送验证码
|
||||
void _resetCanSendCode() {
|
||||
state.canSendCode.value = state.pwdIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
||||
state.canSendCode.value =
|
||||
state.pwdIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -19,6 +19,7 @@ import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import 'apm/apm_helper.dart';
|
||||
import 'app.dart';
|
||||
import 'app_settings/app_settings.dart';
|
||||
import 'tools/store_service.dart';
|
||||
@ -27,7 +28,7 @@ import 'tools/store_service.dart';
|
||||
FutureOr<void> main() async {
|
||||
FlutterBugly.postCatchedException(() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await ApmHelper.instance.initApp();
|
||||
await _setCommonServices();
|
||||
|
||||
// 设置国际化信息
|
||||
@ -74,10 +75,7 @@ Future<void> _setCommonServices() async {
|
||||
|
||||
//关于隐私协议的初始化
|
||||
Future<void> privacySDKInitialization() async {
|
||||
UmengCommonSdk.initCommon(
|
||||
'671244cf80464b33f6df9648', '671244ae80464b33f6df9646', 'Product');
|
||||
UmengCommonSdk.setPageCollectionModeManual();
|
||||
|
||||
ApmHelper.instance.initSdk();
|
||||
await Get.putAsync(() => PlatformInfoService().init());
|
||||
await BuglyTool.init();
|
||||
// 初始化JPush服务
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
@ -12,13 +12,8 @@ import 'package:star_lock/mine/valueAddedServices/valueAddedServicesHighFunction
|
||||
import 'package:star_lock/tools/NativeInteractionTool.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../blue/sender_manage.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../../tools/commonDataManage.dart';
|
||||
@ -222,7 +217,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
: '');
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
||||
ApmHelper.instance.trackEvent('add_authorizedAdmin', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -245,7 +240,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
||||
ApmHelper.instance.trackEvent('add_authorizedAdmin', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -1,14 +1,12 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/card/addICCard/addICCard_entity.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../apm/apm_helper.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
@ -22,20 +20,23 @@ import '../../../../tools/eventBusEventManage.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
import 'addICCard_state.dart';
|
||||
|
||||
class AddICCardLogic extends BaseGetXController{
|
||||
class AddICCardLogic extends BaseGetXController {
|
||||
AddICCardState state = AddICCardState();
|
||||
|
||||
// 监听设备返回的数据
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
// 添加IC卡开始
|
||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
if ((reply is SenderAddICCardWithTimeCycleCoercionReply) &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
|
||||
// 添加卡确认
|
||||
if(reply is SenderAddICCardConfirmationReply) {
|
||||
if (reply is SenderAddICCardConfirmationReply) {
|
||||
_replyAddICCardConfirmation(reply);
|
||||
}
|
||||
});
|
||||
@ -46,13 +47,13 @@ class AddICCardLogic extends BaseGetXController{
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡开始,解析数据',
|
||||
detail: '添加卡开始,解析数据 _replyAddICCardBegin:${reply.data}',
|
||||
upload: false
|
||||
);
|
||||
upload: false);
|
||||
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
final List<int> cardNumberList = reply.data.sublist(reply.data.length - 2);
|
||||
final List<int> cardNumberList =
|
||||
reply.data.sublist(reply.data.length - 2);
|
||||
final String cardNumber = listChangInt(cardNumberList).toString();
|
||||
// AppLog.log("添加卡号:$cardNumberList cardNumber:$cardNumber");
|
||||
state.cardNumber.value = cardNumber.toString();
|
||||
@ -63,10 +64,13 @@ class AddICCardLogic extends BaseGetXController{
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList =
|
||||
changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<String>? signKey =
|
||||
await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
@ -78,25 +82,29 @@ class AddICCardLogic extends BaseGetXController{
|
||||
// AppLog.log('添加卡token:$token');
|
||||
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: token,
|
||||
isBeforeAddUser: false
|
||||
);
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
cardNo: 0,
|
||||
useCountLimit: 0xffff,
|
||||
operate: 0,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||
// 是否是胁迫
|
||||
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||
// 是否是循环
|
||||
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||
state.weekDay.value),
|
||||
// 周循环
|
||||
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: token,
|
||||
isBeforeAddUser: false);
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
@ -113,58 +121,59 @@ class AddICCardLogic extends BaseGetXController{
|
||||
message: '添加卡结果,解析数据',
|
||||
detail: '添加卡结果,解析数据 _replyAddICCardConfirmation:${reply.data}',
|
||||
eventStr: '添加卡事件结果',
|
||||
upload: true
|
||||
);
|
||||
upload: true);
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':'成功',
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': '成功',
|
||||
});
|
||||
switch(reply.data[5]){
|
||||
switch (reply.data[5]) {
|
||||
case 0xff:
|
||||
// 注册指纹失败
|
||||
// 注册指纹失败
|
||||
showToast('退出添加'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFE:
|
||||
// 管理员已满
|
||||
// 管理员已满
|
||||
showToast('管理员已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFD:
|
||||
// 用户已满
|
||||
// 用户已满
|
||||
showToast('用户已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFC:
|
||||
// 指纹已满
|
||||
// 指纹已满
|
||||
showToast('锁上面添加卡已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFB:
|
||||
// 指纹已存在
|
||||
// 指纹已存在
|
||||
showToast('卡已存在'.tr);
|
||||
break;
|
||||
default:
|
||||
// 添加指纹中
|
||||
// 当前注册数
|
||||
// 添加指纹中
|
||||
// 当前注册数
|
||||
addICCardData();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':reply.data[2],
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': reply.data[2],
|
||||
});
|
||||
break;
|
||||
}
|
||||
@ -175,91 +184,105 @@ class AddICCardLogic extends BaseGetXController{
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
final String command = SenderAddICCardWithTimeCycleCoercionCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
cardNo: 0,
|
||||
useCountLimit: 0xffff,
|
||||
operate: 0,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||
// 是否是胁迫
|
||||
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||
// 是否是循环
|
||||
weekRound: DateTool()
|
||||
.accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value),
|
||||
// 周循环
|
||||
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
).toString();
|
||||
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':'添加卡超时',
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': '添加卡超时',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡超时处理-添加卡失败',
|
||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
detail:
|
||||
'添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加卡事件超时',
|
||||
upload: true
|
||||
);
|
||||
upload: true);
|
||||
|
||||
Get.close(1);
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
isBeforeAddUser: false
|
||||
);
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
cardNo: 0,
|
||||
useCountLimit: 0xffff,
|
||||
operate: 0,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||
// 是否是胁迫
|
||||
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||
// 是否是循环
|
||||
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||
state.weekDay.value),
|
||||
// 周循环
|
||||
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
isBeforeAddUser: false);
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':'添加卡断开连接',
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': '添加卡断开连接',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡超时处理-添加卡失败',
|
||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
detail:
|
||||
'添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加卡事件断开连接',
|
||||
upload: true
|
||||
);
|
||||
upload: true);
|
||||
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
cancelBlueConnetctToastTimer();
|
||||
@ -270,27 +293,32 @@ class AddICCardLogic extends BaseGetXController{
|
||||
|
||||
// 取消添加指纹
|
||||
Future<void> senderCancelAddCardCommand() async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList =
|
||||
changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<String>? signKey =
|
||||
await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderCancelAddCardCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
cancelBlueConnetctToastTimer();
|
||||
@ -319,18 +347,20 @@ class AddICCardLogic extends BaseGetXController{
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateIdCardUserNoLoadData(String cardId) async{
|
||||
final LoginEntity entity = await ApiRepository.to.updateIdCardUserNoLoadData(
|
||||
Future<void> updateIdCardUserNoLoadData(String cardId) async {
|
||||
final LoginEntity entity =
|
||||
await ApiRepository.to.updateIdCardUserNoLoadData(
|
||||
lockId: state.lockId.value.toString(),
|
||||
cardId: cardId,
|
||||
cardUserNo: state.cardNumber.value,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast('添加成功'.tr, something:(){
|
||||
if(state.fromType.value == 2){
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('添加成功'.tr, something: () {
|
||||
if (state.fromType.value == 2) {
|
||||
// 回调指纹号
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.cardNumber.value));
|
||||
}else if(state.fromType.value == 1){
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(
|
||||
state.cardNumber.value));
|
||||
} else if (state.fromType.value == 1) {
|
||||
eventBus.fire(OtherTypeRefreshListEvent());
|
||||
}
|
||||
Get.close(2);
|
||||
@ -356,5 +386,4 @@ class AddICCardLogic extends BaseGetXController{
|
||||
void onClose() {
|
||||
_replySubscription.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,8 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_state.dart';
|
||||
@ -11,7 +10,6 @@ import 'package:star_lock/main/lockDetail/lockOperatingRecord/lockOperatingRecor
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../blue/blue_manage.dart';
|
||||
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
|
||||
@ -151,7 +149,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -205,7 +203,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -303,7 +301,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
showEasyLoading();
|
||||
getLockRecordLastUploadDataTime();
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -314,7 +312,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
}
|
||||
dismissEasyLoading();
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_entity.dart';
|
||||
@ -17,7 +18,6 @@ import 'package:star_lock/tools/regularExpression.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../../../blue/blue_manage.dart';
|
||||
|
||||
@ -185,7 +185,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
: '');
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('add_electronic_key', {
|
||||
ApmHelper.instance.trackEvent('add_electronic_key', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -201,7 +201,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
update();
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('add_electronic_key', {
|
||||
ApmHelper.instance.trackEvent('add_electronic_key', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -3,11 +3,10 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/fingerprint/addFingerprint/addFingerprint_entity.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../../blue/blue_manage.dart';
|
||||
import '../../../../../blue/io_reply.dart';
|
||||
@ -171,7 +170,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
case 0x00:
|
||||
//成功
|
||||
// var fingerprintNum = listChangInt(reply.data.sublist(9, 11)).toString();
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -203,7 +202,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -254,7 +253,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -302,7 +301,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
);
|
||||
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
@ -14,7 +15,6 @@ import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
||||
import 'package:star_lock/tools/throttler.dart';
|
||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../app_settings/app_settings.dart';
|
||||
import '../../../blue/blue_manage.dart';
|
||||
@ -71,7 +71,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
if (status != 6) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('open_lock', {
|
||||
ApmHelper.instance.trackEvent('open_lock', {
|
||||
'lock_name': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -378,7 +378,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
outTimer: 20,
|
||||
action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('open_lock', {
|
||||
ApmHelper.instance.trackEvent('open_lock', {
|
||||
'lock_name': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -422,7 +422,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
|
||||
upload: true);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('open_lock', {
|
||||
ApmHelper.instance.trackEvent('open_lock', {
|
||||
'lock_name': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -3,9 +3,9 @@ import 'dart:async';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_factoryDataReset.dart';
|
||||
@ -294,7 +294,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
isShowBlueConnetctToast: false,
|
||||
action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -332,7 +332,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
token: getTokenList);
|
||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -538,6 +538,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 下级界面修改成功后传递数据
|
||||
StreamSubscription? _passCurrentLockInformationEvent;
|
||||
|
||||
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_passCurrentLockInformationEvent = eventBus
|
||||
@ -597,7 +598,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -616,7 +617,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
});
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -636,7 +637,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -655,7 +656,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
});
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -2,11 +2,11 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_modelVendor.dart';
|
||||
@ -182,7 +182,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
pwdRight: state.isAdministrator.value == true ? 1 : 0);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -199,7 +199,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
updatePWDNumberRequest(entity.data!.keyboardPwdId.toString());
|
||||
}
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -419,7 +419,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -465,7 +465,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
token: getTokenList);
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -3,10 +3,10 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
|
||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_logic.dart';
|
||||
import 'package:star_lock/mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../app_settings/app_settings.dart';
|
||||
import '../../../blue/blue_manage.dart';
|
||||
@ -407,7 +407,7 @@ class SaveLockLogic extends BaseGetXController {
|
||||
state.lockId = entity.data!.lockId!;
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('save_lock_result', {
|
||||
ApmHelper.instance.trackEvent('save_lock_result', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -423,7 +423,7 @@ class SaveLockLogic extends BaseGetXController {
|
||||
state.sureBtnState.value = 0;
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('save_lock_result', {
|
||||
ApmHelper.instance.trackEvent('save_lock_result', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||
@ -13,7 +14,6 @@ import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
@ -131,7 +131,8 @@ class MineSetLogic extends BaseGetXController {
|
||||
await ApiRepository.to.userLogout(deviceld: getPushDeviceID);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('logout', {
|
||||
ApmHelper.instance.logout();
|
||||
ApmHelper.instance.trackEvent('logout', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -149,7 +150,8 @@ class MineSetLogic extends BaseGetXController {
|
||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
|
||||
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('logout', {
|
||||
ApmHelper.instance.logout();
|
||||
ApmHelper.instance.trackEvent('logout', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -23,9 +23,12 @@ class AppFirstEnterHandle {
|
||||
switch (flagStr) {
|
||||
case isAgreePrivacy: // 隐私协议
|
||||
if (getFlag != isAgreePrivacy) {
|
||||
await showPrivacyAgreementAlert();
|
||||
final bool? isAgree = await showPrivacyAgreementAlert();
|
||||
if (isAgree ?? false) {
|
||||
await privacySDKInitialization();
|
||||
}
|
||||
}
|
||||
await privacySDKInitialization();
|
||||
|
||||
if (Get.isRegistered<StarLockLoginLogic>()) {
|
||||
Get.find<StarLockLoginLogic>().flushedDeviceInfo();
|
||||
}
|
||||
@ -51,8 +54,8 @@ class AppFirstEnterHandle {
|
||||
}
|
||||
|
||||
//隐私协议弹窗
|
||||
Future<void> showPrivacyAgreementAlert() async {
|
||||
await showCupertinoDialog(
|
||||
Future<bool?> showPrivacyAgreementAlert() async {
|
||||
return await showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (BuildContext context) {
|
||||
return PopScope(
|
||||
@ -103,7 +106,8 @@ class AppFirstEnterHandle {
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'.tr
|
||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'
|
||||
.tr
|
||||
.tr),
|
||||
],
|
||||
),
|
||||
@ -123,7 +127,7 @@ class AppFirstEnterHandle {
|
||||
),
|
||||
onPressed: () {
|
||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop(true);
|
||||
getAppFirstEnter(isShowUpdateVersion);
|
||||
},
|
||||
),
|
||||
@ -173,7 +177,8 @@ class AppFirstEnterHandle {
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'.tr
|
||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'
|
||||
.tr
|
||||
.tr),
|
||||
],
|
||||
),
|
||||
@ -193,7 +198,7 @@ class AppFirstEnterHandle {
|
||||
),
|
||||
onPressed: () {
|
||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop(true);
|
||||
getAppFirstEnter(isShowUpdateVersion);
|
||||
},
|
||||
),
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
|
||||
import '../login/login/entity/LoginData.dart';
|
||||
import '../main/lockMian/entity/lockListInfo_entity.dart';
|
||||
@ -192,12 +193,14 @@ class Storage {
|
||||
final String? data = await Storage.getString(saveUserLoginData);
|
||||
if (data != null && data.isNotEmpty) {
|
||||
loginData = LoginData.fromJson(jsonDecode(data));
|
||||
ApmHelper.instance.login(loginData.userid!.toString());
|
||||
}
|
||||
// AppLog.log("loginData:$loginData");
|
||||
return loginData;
|
||||
}
|
||||
|
||||
static Future<void> saveLoginData(LoginData? data) async {
|
||||
ApmHelper.instance.login(data!.userid!.toString());
|
||||
await Storage.setString(saveUserLoginData, jsonEncode(data));
|
||||
}
|
||||
|
||||
|
||||
11
pubspec.yaml
11
pubspec.yaml
@ -236,7 +236,7 @@ dependencies:
|
||||
timelines: ^0.1.0
|
||||
#侧滑删除
|
||||
flutter_slidable: ^3.0.1
|
||||
# audio_service: ^0.18.12
|
||||
# audio_service: ^0.18.12
|
||||
app_settings: ^5.1.1
|
||||
flutter_local_notifications: ^17.0.0
|
||||
fluwx: 4.5.5
|
||||
@ -245,11 +245,16 @@ dependencies:
|
||||
colorfilter_generator: ^0.0.8
|
||||
file_picker: ^5.3.1
|
||||
# 错误日志监控
|
||||
# flutter_bugly_plugin: ^0.0.9
|
||||
# flutter_bugly_plugin: ^0.0.9
|
||||
flutter_bugly: ^1.0.2
|
||||
open_filex: ^4.4.0
|
||||
|
||||
umeng_common_sdk: 1.2.7
|
||||
#<cn>
|
||||
umeng_common_sdk: 1.2.8
|
||||
#</cn>
|
||||
#<com>
|
||||
firebase_analytics: 11.3.0
|
||||
#</com>
|
||||
|
||||
dependency_overrides:
|
||||
#强制设置google_maps_flutter_ios 为 2.5.2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user