This commit is contained in:
魏少阳 2024-03-18 16:16:59 +08:00
commit 6f367928db
25 changed files with 287 additions and 84 deletions

View File

@ -102,7 +102,9 @@ 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` ```bash
cp build/app/outputs/bundle/skyRelease/app-sky-release.aab /d/Downloads/app-sky-universal-release-1.0.16+2024031302.aab
```
- 注意这里的sky.jks和google_pek.zip和encryption_public_key.pem都是sky渠道的和谷歌账号对应。如果需要使用其他谷歌账号需要更换这两个文件。 - 注意这里的sky.jks和google_pek.zip和encryption_public_key.pem都是sky渠道的和谷歌账号对应。如果需要使用其他谷歌账号需要更换这两个文件。
@ -124,7 +126,7 @@ dart run flutter_flavorizr -p assets:extract
``` ```
重新生成Generated.xcconfig以更新购建物版本号等信息 重新生成Generated.xcconfig以更新购建物版本号等信息
```bash ```bash
flutter build ios --config-only flutter build ios --config-only --flavor sky
``` ```
构建/编译 构建/编译
```bash ```bash
@ -141,3 +143,26 @@ Xcode顶部中间设备选择器左边Runner选择下拉选择Edit Scheme
截图完成记得将Runner改回去不然编译出来的sky是debug版的。 截图完成记得将Runner改回去不然编译出来的sky是debug版的。
最后还是随便截图的然后用PS裁剪成要求的分辨率上传了 最后还是随便截图的然后用PS裁剪成要求的分辨率上传了
## 用于aab文件转apk
安装bundletool.jar(该文件在git忽略每个机器需要自行下载)
```bash
wget -o android/bundletool.jar https://github.com/google/bundletool/releases/download/1.15.6/bundletool-all-1.15.6.jar
```
将aab转为apk
```bash
java -jar android/bundletool.jar build-apks --bundle=build/app/outputs/bundle/skyRelease/app-sky-release.aab \
--output=build/app/outputs/bundle/skyRelease/app-sky-release.aab.apks \
--ks=android/app/sky.jks \
--ks-pass=pass:sky2028 \
--ks-key-alias=upload \
--key-pass=pass:sky2028
```
安装apks文件到手机
```bash
java -jar android/bundletool.jar install-apks --apks=build/app/outputs/bundle/skyRelease/app-sky-release.aab.apks
```

View File

@ -1,4 +1,5 @@
gradle-wrapper.jar gradle-wrapper.jar
bundletool.jar
/.gradle /.gradle
/captures/ /captures/
/gradlew /gradlew

View File

@ -29,6 +29,15 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
signingConfigs { signingConfigs {
// debug使--debug模式
// debug模式没办法在buildTypes里面按flavors指定编译签名debug模式只能用同一个签名
debug {
storeFile file("starlock.keystore")
storePassword '123456'
keyAlias = 'starlock'
keyPassword '123456'
}
// preskyxhj
pre { pre {
storeFile file("starlock.keystore") storeFile file("starlock.keystore")
storePassword '123456' storePassword '123456'
@ -143,12 +152,6 @@ android {
productFlavors.sky.signingConfig signingConfigs.sky productFlavors.sky.signingConfig signingConfigs.sky
productFlavors.xhj.signingConfig signingConfigs.xhj productFlavors.xhj.signingConfig signingConfigs.xhj
} }
debug {
productFlavors.dev.signingConfig signingConfigs.pre
productFlavors.pre.signingConfig signingConfigs.pre
productFlavors.sky.signingConfig signingConfigs.sky
productFlavors.xhj.signingConfig signingConfigs.xhj
}
} }
} }

View File

@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "281500445726",
"project_id": "skychip2023-ecdff",
"storage_bucket": "skychip2023-ecdff.appspot.com"
},
"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": []
}
}
}
],
"configuration_version": "1"
}

View File

@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "skychip2023-ecdff",
"private_key_id": "abeb85114bda731d15777f9ef57f1e15ca960922",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDN6gFIXozDnm92\nnFb7q1VK4OurhjsuDwrLxiCEyfx0QSUFBJHcsG3/taK0PLO/vfQiQ6U81xmW2roK\no/ojS0iMbCGOIsc/ZjElhx2Crmbj7XimrnJK6LuIkqKrHjlHbe7CQtu4dxbf9TLF\nXq3uZxU0lhg4VZmMygDgrUphica3h/uNRWlZbucWPKFUIL0VLOiM37rlFiNN33IJ\nUzptP+1D3TP8swPhUOZ/jY4pSMfn35OQ7oyQpEu8v3/oqLbJ1hSXa4DCIjteYN+M\nkVo3l/Uwhf8RO9UC03+JTO6I7iur144sMuIlhxqiCl9J7MV42tLMH/O36v7HsL6s\ng/VhWfT1AgMBAAECggEAC/4qDvX6ytXqdgULB+Nlt1O8RiQuRDN6FH44nKNLAdZd\neppWiHz6Gx+QF2FFstA0bN51vEJm6iNZHI+KXQ3gbtVJawbZhfbEvAPPkzHnKjVF\nhqe4XmaJrZ2kvcSn32Imuse8FlVRTr/wMhCenrkAQizPwlAx/kIxpORS5bVpjnzR\nRrkkfoAplVm74UrTo1bD7ER6ynenkIpDz3ETChrLebmGqCP0KYxobjQAjQ+eyHNw\nDlauaA/VSUpq2IaG7SoFdHqdiJXJO3VEQkxELA0768VpfhcLTB4gVO3bmlG/crlM\nx7VuotjCyVZ6qxwBtiyV68pcWx+ggR4qkGZtN9CsoQKBgQDtFx6JXrU6/RFnyXMk\n0Yc1tM/to0ZZwH4y/CFiOphEyVCQCT+vB1UgNX10eByyOfqgO9kR3ZCC/ZI/QUoe\nxyCcApAH4tNd6LCFxHurnw1JK2Ed+LS6twMloH8HTmqdse8sQW16ZafuoAObUif5\ngYOK0PfzaD63QBX4YZE0vzKLvQKBgQDeVlVWtuAHnLxYZDNVc/n8anHrPX1Kgv7m\ninx1mGikWkoVQHicC1/ouLJa8gQOKbARDwPbfxVNqwJR075neUoNkuhZM9wfkqEC\n0radVoTn6WwnwJCq4nz0f4+x9uKsU5hWC57RXQ2sxcf9NGubmQXakTyDqmrppq3p\nEDJtDMzFmQKBgGssTUB5kGDm7sxEswkMshsj7e4VJYMC0clIUeruY9CMVB+YHrKH\nFQLnSxuwBADI1rNB+oDp8B5Wc5qmb9Pz3ZjIS8VU0okb21fMlr7guge+VTtQJppU\nilai82khGG7KdTxDIzL16vCiYp7+h1VxJz5D8iGUmO0LSiMqL5Jxb27dAoGBAMDP\n2d4DZbD0SZnV+3aFxysRHI3Gm1r80xUWz+wjKcwtyMU5Td71Nk1ZrsKT0tR9boS8\norm9MbpTLQXNPPf7BS9UUU7aXHC89gi+t0Mm/scndHXc1xh6paZa4UCSO+z56cfk\n9+vUaMGGG3MH/LHJOHxdKz97kI/jzjmppDFRwlsxAoGAeT3r/LpNlt8y3W65bWzj\nBYiSHZfsR7jQtLEXp9IclKU76Nl6JHXdPRxhd8pMhCP6o2WIL3DN6rIuhYDHg19q\n+DBi0JSqqMLL3nnFgXOrpCJGIm7ihXvgAvyhO72EXFHtXoR8rk1G7FpiV3YXVdYr\nqs/D031oJaVZiGcDGlm0IpY=\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-l06d6@skychip2023-ecdff.iam.gserviceaccount.com",
"client_id": "100525717804471198688",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-l06d6%40skychip2023-ecdff.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}

View File

@ -46,16 +46,21 @@ PODS:
- Flutter - Flutter
- EMASRest (11.1.1.2) - EMASRest (11.1.1.2)
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_native_contact_picker (0.0.1): - flutter_native_contact_picker (0.0.1):
- Flutter - Flutter
- flutter_pcm_sound (0.0.1): - flutter_pcm_sound (0.0.1):
- Flutter - Flutter
- flutter_voice_processor (1.1.1): - flutter_voice_processor (1.1.0):
- Flutter - Flutter
- ios-voice-processor (~> 1.1.0) - ios-voice-processor (~> 1.1.0)
- fluttertoast (0.0.2): - fluttertoast (0.0.2):
- Flutter - Flutter
- Toast - Toast
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- g711_flutter (0.0.1): - g711_flutter (0.0.1):
- Flutter - Flutter
- google_maps_flutter_ios (0.0.1): - google_maps_flutter_ios (0.0.1):
@ -93,7 +98,7 @@ PODS:
- FlutterMacOS - FlutterMacOS
- sqflite (0.0.3): - sqflite (0.0.3):
- Flutter - Flutter
- FlutterMacOS - FMDB (>= 2.7.5)
- SwiftProtobuf (1.25.2) - SwiftProtobuf (1.25.2)
- system_settings (0.0.1): - system_settings (0.0.1):
- Flutter - Flutter
@ -102,6 +107,7 @@ PODS:
- Flutter - Flutter
- video_player_avfoundation (0.0.1): - video_player_avfoundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS
- webview_flutter_wkwebview (0.0.1): - webview_flutter_wkwebview (0.0.1):
- Flutter - Flutter
@ -120,6 +126,7 @@ DEPENDENCIES:
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`) - flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`)
- flutter_pcm_sound (from `.symlinks/plugins/flutter_pcm_sound/ios`) - flutter_pcm_sound (from `.symlinks/plugins/flutter_pcm_sound/ios`)
- flutter_voice_processor (from `.symlinks/plugins/flutter_voice_processor/ios`) - flutter_voice_processor (from `.symlinks/plugins/flutter_voice_processor/ios`)
@ -135,10 +142,10 @@ DEPENDENCIES:
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`) - reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`) - sqflite (from `.symlinks/plugins/sqflite/ios`)
- system_settings (from `.symlinks/plugins/system_settings/ios`) - system_settings (from `.symlinks/plugins/system_settings/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
SPEC REPOS: SPEC REPOS:
@ -153,6 +160,7 @@ SPEC REPOS:
- AMap3DMap - AMap3DMap
- AMapFoundation - AMapFoundation
- AMapLocation - AMapLocation
- FMDB
- GoogleMaps - GoogleMaps
- ios-voice-processor - ios-voice-processor
- Protobuf - Protobuf
@ -187,6 +195,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/device_info_plus/ios" :path: ".symlinks/plugins/device_info_plus/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_native_contact_picker: flutter_native_contact_picker:
:path: ".symlinks/plugins/flutter_native_contact_picker/ios" :path: ".symlinks/plugins/flutter_native_contact_picker/ios"
flutter_pcm_sound: flutter_pcm_sound:
@ -218,13 +228,13 @@ EXTERNAL SOURCES:
shared_preferences_foundation: shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin" :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite: sqflite:
:path: ".symlinks/plugins/sqflite/darwin" :path: ".symlinks/plugins/sqflite/ios"
system_settings: system_settings:
:path: ".symlinks/plugins/system_settings/ios" :path: ".symlinks/plugins/system_settings/ios"
url_launcher_ios: url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios" :path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation: video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/ios" :path: ".symlinks/plugins/video_player_avfoundation/darwin"
webview_flutter_wkwebview: webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios" :path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
@ -251,10 +261,12 @@ SPEC CHECKSUMS:
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475 EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82 flutter_voice_processor: 53afbf59ad3feb82f4a379fea9ed8dc98495210f
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
g711_flutter: 8f2769052d2cf3549f83d11e1c42d81d94441123 g711_flutter: 8f2769052d2cf3549f83d11e1c42d81d94441123
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458 google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4 GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
@ -270,12 +282,12 @@ SPEC CHECKSUMS:
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec sqflite: 50a33e1d72bd59ee092a519a35d107502757ebed
SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1 SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1
system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126 video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4
PODFILE CHECKSUM: 8406bb0e8f1c4b5dff3955810b207d90193914a0 PODFILE CHECKSUM: 8406bb0e8f1c4b5dff3955810b207d90193914a0

View File

@ -776,7 +776,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 4A63B2C308CB401731950EC8 /* Pods-Runner.debug-sky.xcconfig */; baseConfigurationReference = 4A63B2C308CB401731950EC8 /* Pods-Runner.debug-sky.xcconfig */;
buildSettings = { buildSettings = {
DEVELOPMENT_TEAM = 7D53BZAN75; DEVELOPMENT_TEAM = NAQ5PL2DYC;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -789,7 +789,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 8CD96970DEA44F6CC71DEECE /* Pods-Runner.profile-sky.xcconfig */; baseConfigurationReference = 8CD96970DEA44F6CC71DEECE /* Pods-Runner.profile-sky.xcconfig */;
buildSettings = { buildSettings = {
DEVELOPMENT_TEAM = 7D53BZAN75; DEVELOPMENT_TEAM = NAQ5PL2DYC;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -802,7 +802,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 16A83D21DFB231D8453DC681 /* Pods-Runner.release-sky.xcconfig */; baseConfigurationReference = 16A83D21DFB231D8453DC681 /* Pods-Runner.release-sky.xcconfig */;
buildSettings = { buildSettings = {
DEVELOPMENT_TEAM = 7D53BZAN75; DEVELOPMENT_TEAM = NAQ5PL2DYC;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -899,7 +899,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -961,7 +961,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -1163,7 +1163,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -1232,7 +1232,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -1307,7 +1307,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -1375,7 +1375,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -1444,7 +1444,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -1519,7 +1519,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -1586,7 +1586,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -1636,7 +1636,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -1983,7 +1983,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -2058,7 +2058,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -2126,7 +2126,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -2195,7 +2195,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -2270,7 +2270,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",

View File

@ -24,7 +24,7 @@
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Release-sky" buildConfiguration = "Debug-sky"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"

BIN
star_lock/ios/pre.cer Normal file

Binary file not shown.

View File

@ -0,0 +1,16 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIChTCCAW0CAQAwQDEmMCQGCSqGSIb3DQEJARYXZ2VqaWF4aWFuZ0BzdGFyLWxv
Y2suY24xCTAHBgNVBAMMADELMAkGA1UEBhMCQ04wggEiMA0GCSqGSIb3DQEBAQUA
A4IBDwAwggEKAoIBAQDBFXe33Qv478FHsp4fG5SyANP95LyjbidU6tZgbIALtLlj
AU7gEQgEzxGKTONVsDqt6yH713tUMtNa2+KBGQUpvtdFpLjJW7KWzejY7wrp5oN4
2XGYzeSVxlzPqeNaoIgiu6DLElYvQjmPlIm1WIIbR+eKrsSNgh2AQIu6o8KHIQpQ
YY2B3thQHkWGt4jQU5jMoEuhDVIAW7An7FXCIF8ylaQ5de6/4ChxfUtYsnWlbMH3
BJ/NkX50NKPYac5XnBkeQ5kNWwP/0AQyp+u9946zPBDH0Uj88sf9F2qQ9b8Je+92
wpRR0laKfx7Onrii1LjknEFbK1dS6OYblhWcVLxNAgMBAAGgADANBgkqhkiG9w0B
AQsFAAOCAQEAIbGjExcvNonjW1XLag4IaXDXjnfD7kn7gBZsLInXPoGkGkvjPysw
l6vGD+YcfmqOutf9mCNcQ35GyfyUX9alPBUfr9nww9rfMaXKfCgOBp7I1Iz6gYz0
7NkUygWI0+yIC/EP5SirvUijZ7jp/Ak7+nVtgpgr10ebbHOS2UxbSZWGHJ4eap3K
16OOauyqBn59H14gvwqPxSDVB/N+sDd9WrIB2JNLUYcRuP447w0R2KLeh5Yh5Uqs
1CIa196/JyT4tYoR0TMGaClwqEtox0UOw1oHPA4qB268LrEhM9eYgH7BweA2yzXp
NCMR6fnCnJOLWrNa1Km3ej3sJOa6/WTfLw==
-----END CERTIFICATE REQUEST-----

BIN
star_lock/ios/pre.p12 Normal file

Binary file not shown.

BIN
star_lock/ios/sky.cer Normal file

Binary file not shown.

View File

@ -0,0 +1,16 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICgTCCAWkCAQAwPDEiMCAGCSqGSIb3DQEJARYTc2t5Y2hpcDIwMjNAMTYzLmNv
bTEJMAcGA1UEAwwAMQswCQYDVQQGEwJDTjCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBANMDfNeq1KCzcBvfKE/eDOAc8yEhSSnkmgvAqT+mjILVnBIOS0Ei
t2xBLoXEgkgQXZq5+3JrSqZNA+Kw17w6ltrS080IyBnlRrAnv68efcRhPv9YoB0m
DDuirUX7BMi3h5wHCcOtNSitxYzq2/esMGU7uiWdwZMNhWnXP8oqaPhiz4tkTWz8
y9eVskdje1/GF5G7t/nqOwrHFNZL1jvBseJyzL+ksreigeaqpHzZ32zDBCZez9Af
QOdDOBsnDr+IUJRBMXSYx8NGwyDUXgeI4dkWtkKTxVmUQsvwP3QRw0Kp6VsRHbnu
0kEA1Ua6xa7j2WUz5zDm5FcO7UrnJjDXeUUCAwEAAaAAMA0GCSqGSIb3DQEBCwUA
A4IBAQBAr0U+vx646FaELsaX/SwERIrwrwzkrX3XRu9LiX1An0GtNt50obFCKC/I
am63PxRlo+6oxL0w1Qv8WD1Q1DogUPmHzffM3gPopgow0B4oHGsyFeUw/LxJ0dHK
qo718cYNVRNTRlggrQCpsft7PSLkQoRzlxMxTo5/ALTCQ84gWlPSSGEFnD0a4mZ8
PsgFi+k4bvRfkTneBnJKw2ruxXbn06eDqNCW50AkI7ORfbIhx0FSuQ1cbpG8Dqlu
4u0dpBjc8ukQqvhRNLz1niOmzIz/8m2Kid6CmQThATKH4KMw+CJI1GEQszxL5ZZE
/n8sWRDAqglQpkYz3anLj5dnAf5h
-----END CERTIFICATE REQUEST-----

BIN
star_lock/ios/sky.p12 Normal file

Binary file not shown.

View File

@ -243,6 +243,7 @@ class AddFaceLogic extends BaseGetXController {
featureData: state.featureData.value, featureData: state.featureData.value,
addType: state.addType.value, addType: state.addType.value,
cyclicConfig: state.cyclicConfig.value, cyclicConfig: state.cyclicConfig.value,
faceRight: state.isAdministrator.value == true ? 1 : 0,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
@ -264,7 +265,8 @@ class AddFaceLogic extends BaseGetXController {
showToast("添加成功"); showToast("添加成功");
if (state.fromType.value == 2) { if (state.fromType.value == 2) {
// //
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.faceNumber.value)); eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(
state.faceNumber.value));
} else if (state.fromType.value == 1) { } else if (state.fromType.value == 1) {
eventBus.fire(OtherTypeRefreshListEvent()); eventBus.fire(OtherTypeRefreshListEvent());
} }

View File

@ -19,6 +19,7 @@ class AddFaceState {
final fromType = 1.obs; final fromType = 1.obs;
final featureData = ''.obs; final featureData = ''.obs;
final isClickAddFace = false.obs; final isClickAddFace = false.obs;
final isAdministrator = false.obs;
AddFaceState() { AddFaceState() {
Map map = Get.arguments; Map map = Get.arguments;
@ -31,5 +32,6 @@ class AddFaceState {
lockId.value = map["lockId"]; lockId.value = map["lockId"];
cyclicConfig.value = map["cyclicConfig"]; cyclicConfig.value = map["cyclicConfig"];
fromType.value = map["fromType"]; fromType.value = map["fromType"];
isAdministrator.value = map["isAdministrator"];
} }
} }

View File

@ -82,6 +82,7 @@ class AddFaceTypeLogic extends BaseGetXController {
"startDate": int.parse(startDate), "startDate": int.parse(startDate),
"cyclicConfig": state.weekdaysList.value, "cyclicConfig": state.weekdaysList.value,
"fromType": state.fromType.value, "fromType": state.fromType.value,
"isAdministrator": state.isAdministrator.value,
}); });
} }

View File

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -20,10 +21,10 @@ class AddFaceTypePage extends StatefulWidget {
const AddFaceTypePage( const AddFaceTypePage(
{Key? key, {Key? key,
required this.selectType, required this.selectType,
required this.lockId, required this.lockId,
required this.fromType, required this.fromType,
required this.fromTypeTwoStaffName}) required this.fromTypeTwoStaffName})
: super(key: key); : super(key: key);
@override @override
@ -70,7 +71,6 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
TranslationLoader.lanKeys!.pleaseEnter!.tr, TranslationLoader.lanKeys!.pleaseEnter!.tr,
state.nameController), state.nameController),
keyTimeLimitWidget(), keyTimeLimitWidget(),
SizedBox(height: 10.h),
keyBottomWidget() keyBottomWidget()
], ],
); );
@ -137,16 +137,12 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
action: () async { action: () async {
Pickers.showDatePicker(context, mode: DateMode.YMDHM, Pickers.showDatePicker(context, mode: DateMode.YMDHM,
onConfirm: (p) { onConfirm: (p) {
setState(() { state.beginTime.value =
setState(() { '${p.year}-${p.month!.toString().padLeft(2, '0')}-${p.day!.toString().padLeft(2, '0')} ${p.hour!.toString().padLeft(2, '0')}:${p.minute!.toString().padLeft(2, '0')}';
state.beginTime.value = state.beginTimeTimestamp.value =
'${p.year}-${p.month!.toString().padLeft(2, '0')}-${p.day!.toString().padLeft(2, '0')} ${p.hour!.toString().padLeft(2, '0')}:${p.minute!.toString().padLeft(2, '0')}'; DateTime.parse(state.beginTime.value)
state.beginTimeTimestamp.value = .millisecondsSinceEpoch
DateTime.parse(state.beginTime.value) .toString();
.millisecondsSinceEpoch
.toString();
});
});
}); });
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
@ -156,16 +152,12 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
action: () { action: () {
Pickers.showDatePicker(context, mode: DateMode.YMDHM, Pickers.showDatePicker(context, mode: DateMode.YMDHM,
onConfirm: (p) { onConfirm: (p) {
setState(() { state.endTime.value =
setState(() { '${p.year}-${p.month!.toString().padLeft(2, '0')}-${p.day!.toString().padLeft(2, '0')} ${p.hour!.toString().padLeft(2, '0')}:${p.minute!.toString().padLeft(2, '0')}';
state.endTime.value = state.endTimeTimestamp.value =
'${p.year}-${p.month!.toString().padLeft(2, '0')}-${p.day!.toString().padLeft(2, '0')} ${p.hour!.toString().padLeft(2, '0')}:${p.minute!.toString().padLeft(2, '0')}'; DateTime.parse(state.endTime.value)
state.endTimeTimestamp.value = .millisecondsSinceEpoch
DateTime.parse(state.endTime.value) .toString();
.millisecondsSinceEpoch
.toString();
});
});
}); });
})), })),
Container(height: 10.h), Container(height: 10.h),
@ -183,6 +175,13 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
// isHaveRightWidget: true, // isHaveRightWidget: true,
// rightWidget: SizedBox( // rightWidget: SizedBox(
// width: 60.w, height: 50.h, child: _isStressFingerprint())), // width: 60.w, height: 50.h, child: _isStressFingerprint())),
CommonItem(
leftTitel: "是否是管理员",
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
rightWidget: SizedBox(
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))),
SizedBox(height: 30.h), SizedBox(height: 30.h),
SubmitBtn( SubmitBtn(
btnName: TranslationLoader.lanKeys!.next!.tr, btnName: TranslationLoader.lanKeys!.next!.tr,
@ -305,4 +304,17 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
), ),
); );
} }
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: state.isAdministrator.value,
onChanged: (value) {
state.isAdministrator.value = value;
},
);
}
} }

View File

@ -7,6 +7,7 @@ class AddFaceTypeState {
final fromType = 1.obs; // // 1 2 final fromType = 1.obs; // // 1 2
var fromTypeTwoStaffName = "".obs; // var fromTypeTwoStaffName = "".obs; //
final isStressFingerprint = false.obs; final isStressFingerprint = false.obs;
final isAdministrator = false.obs; //
var beginTime = "".obs; // var beginTime = "".obs; //
var endTime = "".obs; // var endTime = "".obs; //

View File

@ -91,6 +91,7 @@ class FingerprintItemData {
int? faceType; int? faceType;
List? cyclicConfig; List? cyclicConfig;
String? featureData; String? featureData;
int? faceRight;
FingerprintItemData( FingerprintItemData(
{this.fingerprintStatus, {this.fingerprintStatus,
@ -119,7 +120,8 @@ class FingerprintItemData {
this.addType, this.addType,
this.faceType, this.faceType,
this.cyclicConfig, this.cyclicConfig,
this.featureData}); this.featureData,
this.faceRight});
FingerprintItemData.fromJson(Map<String, dynamic> json) { FingerprintItemData.fromJson(Map<String, dynamic> json) {
fingerprintStatus = json['fingerprintStatus']; fingerprintStatus = json['fingerprintStatus'];
@ -149,6 +151,7 @@ class FingerprintItemData {
faceType = json['faceType']; faceType = json['faceType'];
cyclicConfig = json['cyclicConfig']; cyclicConfig = json['cyclicConfig'];
featureData = json['featureData']; featureData = json['featureData'];
faceRight = json['faceRight'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -180,6 +183,7 @@ class FingerprintItemData {
data['faceType'] = faceType; data['faceType'] = faceType;
data['cyclicConfig'] = cyclicConfig; data['cyclicConfig'] = cyclicConfig;
data['featureData'] = featureData; data['featureData'] = featureData;
data['faceRight'] = faceRight;
return data; return data;
} }

View File

@ -1,7 +1,11 @@
import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.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:permission_handler/permission_handler.dart';
import 'package:star_lock/flavors.dart'; import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart'; import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
import '../../../appRouters.dart'; import '../../../appRouters.dart';
@ -18,7 +22,7 @@ class MineSetPage extends StatefulWidget {
State<MineSetPage> createState() => _MineSetPageState(); State<MineSetPage> createState() => _MineSetPageState();
} }
class _MineSetPageState extends State<MineSetPage> { class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
final logic = Get.put(MineSetLogic()); final logic = Get.put(MineSetLogic());
final state = Get.find<MineSetLogic>().state; final state = Get.find<MineSetLogic>().state;
@ -26,11 +30,25 @@ class _MineSetPageState extends State<MineSetPage> {
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this);
logic.userSettingsInfoRequest(); logic.userSettingsInfoRequest();
} }
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
if (state == AppLifecycleState.resumed) {
//
//
_checkNotificationPermission();
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_checkNotificationPermission();
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
@ -371,8 +389,45 @@ class _MineSetPageState extends State<MineSetPage> {
thumbColor: CupertinoColors.white, thumbColor: CupertinoColors.white,
value: state.isPushNotification.value, value: state.isPushNotification.value,
onChanged: (value) { onChanged: (value) {
state.isPushNotification.value = !state.isPushNotification.value; // state.isPushNotification.value = !state.isPushNotification.value;
openAppSettings();
}, },
); );
} }
Future<void> _checkNotificationPermission() async {
bool notificationEnabled = false;
if (Platform.isAndroid) {
notificationEnabled = await state.flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.areNotificationsEnabled() ??
false;
} else if (Platform.isIOS) {
notificationEnabled = await state.flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: true,
badge: true,
sound: true,
) ??
false;
}
if (notificationEnabled) {
print('Notifications are enabled');
state.isPushNotification.value = true;
} else {
print('Notifications are disabled');
state.isPushNotification.value = false;
}
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}
} }

View File

@ -1,3 +1,4 @@
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart'; import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
@ -13,4 +14,6 @@ class MineSetState {
var hideExpiredAccessFlag = 2.obs; // var hideExpiredAccessFlag = 2.obs; //
var currentLanguage = "".obs; // var currentLanguage = "".obs; //
late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
} }

View File

@ -1059,6 +1059,7 @@ class ApiProvider extends BaseProvider {
String featureData, String featureData,
String addType, String addType,
List cyclicConfig, List cyclicConfig,
int faceRight,
) => ) =>
post( post(
addFaceURL.toUrl, addFaceURL.toUrl,
@ -1072,6 +1073,7 @@ class ApiProvider extends BaseProvider {
'featureData': featureData, 'featureData': featureData,
'addType': addType, 'addType': addType,
'cyclicConfig': cyclicConfig, 'cyclicConfig': cyclicConfig,
'faceRight': faceRight
})); }));
// //
@ -1267,11 +1269,7 @@ class ApiProvider extends BaseProvider {
// //
Future<Response> removeBrokenLockData(List lockIdList) => Future<Response> removeBrokenLockData(List lockIdList) =>
post( post(removeBadLockURL.toUrl, jsonEncode({'lockIds': lockIdList}));
removeBadLockURL.toUrl,
jsonEncode({
'lockIds': lockIdList
}));
Future<Response> listLockByGroup(String type, String keyGroupId) => post( Future<Response> listLockByGroup(String type, String keyGroupId) => post(
listLockByGroupURL.toUrl, listLockByGroupURL.toUrl,

View File

@ -1193,19 +1193,28 @@ class ApiRepository {
} }
// //
Future<AddFaceEntity> addFaceData({ Future<AddFaceEntity> addFaceData(
required int lockId, {required int lockId,
required String faceName, required String faceName,
required String faceNumber, required String faceNumber,
required int faceType, required int faceType,
required int startDate, required int startDate,
required int endDate, required int endDate,
required String featureData, required String featureData,
required String addType, required String addType,
required List cyclicConfig, required List cyclicConfig,
}) async { required int faceRight}) async {
final res = await apiProvider.addFaceData(lockId, faceName, faceNumber, final res = await apiProvider.addFaceData(
faceType, startDate, endDate, featureData, addType, cyclicConfig); lockId,
faceName,
faceNumber,
faceType,
startDate,
endDate,
featureData,
addType,
cyclicConfig,
faceRight);
return AddFaceEntity.fromJson(res.body); return AddFaceEntity.fromJson(res.body);
} }

View File

@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.15+20240313 version: 1.0.15+2024031501
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
@ -142,6 +142,7 @@ dependencies:
flutter_slidable: ^3.0.1 flutter_slidable: ^3.0.1
audio_service: ^0.18.12 audio_service: ^0.18.12
app_settings: ^5.1.1 app_settings: ^5.1.1
flutter_local_notifications: ^17.0.0
system_settings: ^2.0.0 system_settings: ^2.0.0
dev_dependencies: dev_dependencies: