diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..d50c782e Binary files /dev/null and b/.DS_Store differ diff --git a/star_lock/.gitignore b/star_lock/.gitignore new file mode 100644 index 00000000..24476c5d --- /dev/null +++ b/star_lock/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/star_lock/.metadata b/star_lock/.metadata new file mode 100644 index 00000000..31b763f9 --- /dev/null +++ b/star_lock/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled. + +version: + revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + channel: stable + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + - platform: android + create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + - platform: ios + create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + - platform: linux + create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + - platform: macos + create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + - platform: web + create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + - platform: windows + create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/star_lock/README.md b/star_lock/README.md new file mode 100644 index 00000000..debff993 --- /dev/null +++ b/star_lock/README.md @@ -0,0 +1,16 @@ +# star_lock + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/star_lock/analysis_options.yaml b/star_lock/analysis_options.yaml new file mode 100644 index 00000000..61b6c4de --- /dev/null +++ b/star_lock/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/star_lock/android/.gitignore b/star_lock/android/.gitignore new file mode 100644 index 00000000..6f568019 --- /dev/null +++ b/star_lock/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/star_lock/android/app/build.gradle b/star_lock/android/app/build.gradle new file mode 100644 index 00000000..2c82c384 --- /dev/null +++ b/star_lock/android/app/build.gradle @@ -0,0 +1,71 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.star_lock" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/star_lock/android/app/src/debug/AndroidManifest.xml b/star_lock/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..e38be3cb --- /dev/null +++ b/star_lock/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + diff --git a/star_lock/android/app/src/main/AndroidManifest.xml b/star_lock/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..0f4383a6 --- /dev/null +++ b/star_lock/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/star_lock/android/app/src/main/kotlin/com/example/star_lock/MainActivity.kt b/star_lock/android/app/src/main/kotlin/com/example/star_lock/MainActivity.kt new file mode 100644 index 00000000..7cc68c46 --- /dev/null +++ b/star_lock/android/app/src/main/kotlin/com/example/star_lock/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.star_lock + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/star_lock/android/app/src/main/res/drawable-v21/launch_background.xml b/star_lock/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/star_lock/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/star_lock/android/app/src/main/res/drawable/launch_background.xml b/star_lock/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/star_lock/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/star_lock/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/star_lock/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/star_lock/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/star_lock/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/star_lock/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/star_lock/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/star_lock/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/star_lock/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/star_lock/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/star_lock/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/star_lock/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/star_lock/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/star_lock/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/star_lock/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/star_lock/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/star_lock/android/app/src/main/res/values-night/styles.xml b/star_lock/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..06952be7 --- /dev/null +++ b/star_lock/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/star_lock/android/app/src/main/res/values/styles.xml b/star_lock/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..cb1ef880 --- /dev/null +++ b/star_lock/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/star_lock/android/app/src/profile/AndroidManifest.xml b/star_lock/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..41b3e34c --- /dev/null +++ b/star_lock/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/star_lock/android/build.gradle b/star_lock/android/build.gradle new file mode 100644 index 00000000..83ae2200 --- /dev/null +++ b/star_lock/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.6.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.1.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/star_lock/android/gradle.properties b/star_lock/android/gradle.properties new file mode 100644 index 00000000..94adc3a3 --- /dev/null +++ b/star_lock/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/star_lock/android/gradle/wrapper/gradle-wrapper.properties b/star_lock/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..cb24abda --- /dev/null +++ b/star_lock/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/star_lock/android/settings.gradle b/star_lock/android/settings.gradle new file mode 100644 index 00000000..44e62bcf --- /dev/null +++ b/star_lock/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/star_lock/images/ic_menu_up_arrow.png b/star_lock/images/ic_menu_up_arrow.png new file mode 100644 index 00000000..bacb2bbb Binary files /dev/null and b/star_lock/images/ic_menu_up_arrow.png differ diff --git a/star_lock/images/icon_item_checked.png b/star_lock/images/icon_item_checked.png new file mode 100644 index 00000000..330c61fc Binary files /dev/null and b/star_lock/images/icon_item_checked.png differ diff --git a/star_lock/images/icon_lock.png b/star_lock/images/icon_lock.png new file mode 100644 index 00000000..0d7054a3 Binary files /dev/null and b/star_lock/images/icon_lock.png differ diff --git a/star_lock/images/icon_main_1024.png b/star_lock/images/icon_main_1024.png new file mode 100644 index 00000000..aa0093ef Binary files /dev/null and b/star_lock/images/icon_main_1024.png differ diff --git a/star_lock/images/icon_right.png b/star_lock/images/icon_right.png new file mode 100644 index 00000000..96479871 Binary files /dev/null and b/star_lock/images/icon_right.png differ diff --git a/star_lock/images/icon_round_selet.png b/star_lock/images/icon_round_selet.png new file mode 100644 index 00000000..10501495 Binary files /dev/null and b/star_lock/images/icon_round_selet.png differ diff --git a/star_lock/images/icon_round_unSelet.png b/star_lock/images/icon_round_unSelet.png new file mode 100644 index 00000000..c96a5f8e Binary files /dev/null and b/star_lock/images/icon_round_unSelet.png differ diff --git a/star_lock/images/icon_unHaveData.png b/star_lock/images/icon_unHaveData.png new file mode 100644 index 00000000..9ca9b958 Binary files /dev/null and b/star_lock/images/icon_unHaveData.png differ diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json new file mode 100644 index 00000000..d2c03c74 --- /dev/null +++ b/star_lock/images/lan/lan_en.json @@ -0,0 +1,206 @@ +{ + "starLock":"Star Lock", + "clickUnlockAndHoldDownClose":"Click To Unlock And Hold Down to Close", + "checkingIn":"Checking In", + "electronicKey":"Electronic Key", + "password":"Password", + "card":"Card", + "fingerprint":"Fingerprint", + "remoteControl":"RemoteControl", + "operatingRecord":"Operating Record", + "number":"Number", + "additive":"Additive", + "addTime":"Add Time", + + "reset":"Reset", + "sendKey":"SendKey", + "timeLimit":"TimeLimit", + "permanent":"Permanent", + "once":"Once", + "circulation":"Circulation", + "receiver":"Receiver", + "pleaseEnterNumberOrEmail":"Please enter the number or email", + "name":"Name", + "enterYourName":"Please Enter Your Name", + "effectiveTime":"Effective Time", + "failureTime":"Failure Time", + "effectiveDate":"Effective Date", + "failureDate":"Failure Date", + "Monday":"M", + "Tuesday":"T", + "Wednesday":"W", + "Thursday":"T", + "Friday":"F", + "Saturday":"S", + "Sunday":"S", + + "realNameAuthentication":"RealNameAuthentication", + "sendKeyBottomTip":"The recipient can use it unlimited times during the validity period", + "send":"Send", + "periodValidity":"PeriodValidity", + "sendGroupKey":"Send Group Key", + "lock":"Lock", + "pleaseAdd":"Please Add", + "pleaseSelet":"Please Selet", + "remoteUnlockingAllowed":"Remote Unlocking Allowed", + "pleaseEnter":"Please Enter", + "getPassword":"Get Password", + "custom":"Custom", + "clearAll":"ClearAll", + "recursiveDevice":"Recursive Device", + "pleaseNameYourPassword":"Please Name Your Password", + "pleaseEnterDigitsNumber":"pleaseEnter6", + "getPasswordTip1":"The password must be used at least once in the last 24 hours, otherwise it is invalid\n", + "getPasswordTip2":"The password can be used for an unlimited number of times in the next period. The password must be used at least once within 24 hours after it takes effect, otherwise it will be invalid\n", + "getPasswordTip3":"The password is valid for 6 hours and can only be used once\n", + "getPasswordTip4":"It can be added next to the lock via Bluetooth on the phone or remotely via the gateway\n", + "getPasswordTip5":"The password must be used at least once within the first 24 hours, otherwise it will be invalid\n", + "getPasswordTip6":"The password is valid for 24 hours. Entering it on the lock invalidates all previously used passwords\n", + "getTip":"Get", + "addTip":"Add", + "sender":"Sender", + "senderTime":"Sender Time", + "keyDetail":"Key Detail", + "detail":"Detail", + "delete":"Delete", + "passwordDetail":"Password Detail", + "share":"Share", + "amend":"Amend", + "sure":"Sure", + "cancel":"Cancel", + + "add":"Add", + "accountNumber":"AccountNumber", + "volumeAuthorizationLock":"Volume Authorization Lock", + "authorizedAdminTip":"The authorized administrator has important access to this lock, so make sure you only send it to people you trust", + "lockOperatingRecordTip":"The historical records can be retained only for a certain period of time. If you want to retain historical records, export them in the upper right corner", + + "basicInformation":"Basic Information", + "wirelessKeyboard":"Wireless Keyboard", + "doorMagnetic":"Door Magnetic", + "remoteUnlocking":"Remote Unlocking", + "automaticBlocking":"Automatic Blocking", + "normallyOpenMode":"Normally Open Mode", + "lockSound":"Lock Sound", + "burglarAlarm":"Burglar Alarm", + "resetButton":"Reset Button", + "lockTime":"Lock Time", + "diagnose":"Diagnose", + "uploadData":"Upload Data", + "importOtherLockData":"Import Other Lock Data", + "lockEscalation":"Lock Escalation", + "markedHouseState":"Marked House State", + "unlockReminder":"Unlock Reminder", + "unlockQRCode":"Unlock QR Code", + "lockNumber":"Lock Number", + "electricQuantity":"Electric Quantity", + "lockName":"Lock Name", + "lockGrouping":"Lock Grouping", + "adminOpenLockPassword":"Admin Open Lock Password", + "update":"Update", + "updateElectricQuantityTip":"The battery information can be updated remotely via the gateway or next to the lock via Bluetooth on the phone\n", + "adminOpenLockPasswordTip":"If you have changed the password on the lock, the actual valid password inside the lock may be different from the one shown here\n", + "updateLockAdminPassword":"Upload the lock administrator password", + "whenScreenFlashesClickNext":"When the screen flashes, click Next", + "theScreenNeverFlickered":"The screen never flickered", + "enterNumberOrPressSet":"Enter *529# or press the Settings key", + "theLocationOfTheSetKeyWillBeDifferent":"The location of the set key will be different", + "pressAndHoldTheResetButtonTwoSeconds":"Press And Hold The Reset Button 2 Seconds", + "nearbyEquipment":"Nearby Equipment", + "noData":"No Data", + "doorMagneticListTopTip":"You can query the open and close status of a door by using the door status sensor. Add a door magnet to each lock", + "remoteUnlockingPageTip":"When enabled, you will be able to open the lock remotely through the gateway. This function can only be turned on and off near the lock via Bluetooth on the phone.", + "currentMode":"Current Mode", + "delayTime":"Delay Time", + "automaticBlockingTip":"After the time set above, the lock will automatically close. After you enable or modify the Settings, open the lock once for the time to take effect", + "time":"Time", + "normallyOpen":"Normally Open", + "date":"Date", + "begin":"Begin", + "end":"End", + "allDay":"All Day", + "save":"Save", + "normallyOpenModeTip":"During the set normal opening time, the lock will remain open after opening until it is manually closed During the set normal opening time, the lock will remain open after opening until it is manually closed", + "pleaseSeletLockVolume":"Please Selet Lock Volume", + "lockSoundTip":"When the function is enabled, you can hear the prompt tone of the smart lock. Including low battery, incorrect password and so on.", + "low":"Low", + "lower":"Lower", + "medium":"Medium", + "high":"High", + "higher":"Higher", + "burglarAlarmTip":"After opening, an alarm sound will be issued when the lock is picked", + "resetButtonTip":"After opening, you can re-add with APP by long pressing the reset key on the lock. After closing, the reset key is invalid, and the lock can be re-added only after being deleted by app", + "calibrationTime":"Calibration Time", + "setTheDSTMode":"Set The DST Mode", + "diagnoseTip":"Diagnosis is to read the configuration information inside the lock and upload it so that the staff can analyze the cause of the failure", + "uploading":"Uploading", + "uploadDataTip":"This operation will upload the locked data to the server, which may take several minutes", + "importOtherLockDataTip":"Please select which lock you want to import from", + "haveNewVersion":"Have New Version", + "currentVersion":"Current Version", + "newVersion":"New Version", + "upgrade":"Upgrade", + "leisure":"Leisure", + "checkedIn":"Checked In", + + "lanEnglish":"English", + "lanChinese":"Chinese", + "multilingual":"Multilingual", + "addLock":"Add Lock", + "gateway":"Gateway", + "message":"Message", + "supportStaff":"Support Staff", + "set":"Set", + "moreServices":"More Services", + + "moreSet":"More Set", + "prompTone":"Promp Tone", + "touchUnlock":"Touch Unlock", + "pushNotification":"Push Notification", + "lockUserManagement":"Lock User Management", + "authorizedAdmin":"Authorized Admin", + "lockGroup":"Lock Group", + "transferSmartLock":"Transfer Smart Lock", + "multiLanguage":"Multi Language", + "lockScreen":"Lock Screen", + "closed":"Closed", + "opened":"Opened", + "hideInvalidUnlockPermissions":"Hide Invalid Unlock Permissions", + "appUnlockRequiresMobilePhoneAccessToTheLock":"APP Unlock Requires Mobile Phone Access To The Lock", + "valueAddedServices":"Value Added Services", + "about":"About", + "userAgreement":"User Agreement", + "privacyPolicy":"Privacy Policy", + "personalInformationCollectionList":"Personal Information Collection List", + "applicationPermissionDescription":"Application Permission Description", + "thirdPartyInformationSharingList":"Third party information sharing list", + "logout":"Logout", + "deleteAccount":"Delete Account", + + "allLock":"All Lock", + "searchAllLockType":"Search All Lock Type", + "doorLock":"Door Lock", + "padlock":"Pad lock", + "safeLock":"Safe Lock", + "intelligentLockCore":"Intelligent Lock Core", + "parkingLock":"Parking Lock", + "bicycleLock":"Bicycle Lock", + "longRangeControl":"LongRange Control", + "lightTouchScreen":"Light Touch Screen", + "lightTouchScreenTip":"Light Touch Screen Tip", + "next":"Next", + "nearbyLock":"Nearby Lock", + "addSuccessfullyPleaseRename":"Add Successfully Please Rename", + "whenAddingLockThePhoneMustBeNextToTheLock":"When adding a lock, the phone must be next to the lock", + + "login":"Login", + "register":"Register", + "forgetPassword":"Forget Password", + "readAndAgree":"I Have Read And Agree", + "verificationCode":"VerificationCode", + "registerPasswordTip":"The password must be 8-20 characters, including at least 2 of the numbers/letters/symbols", + "iphone":"Iphone", + "email":"Email", + "countryAndRegion":"Country And Region", + "selet":"Selet" +} diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json new file mode 100644 index 00000000..a3ca2ae2 --- /dev/null +++ b/star_lock/images/lan/lan_keys.json @@ -0,0 +1,207 @@ +{ + "starLock":"starLock", + "clickUnlockAndHoldDownClose":"clickUnlockAndHoldDownClose", + "checkingIn":"checkingIn", + "electronicKey":"electronicKey", + "password":"password", + "card":"card", + "fingerprint":"fingerprint", + "remoteControl":"remoteControl", + "operatingRecord":"operatingRecord", + "number":"number", + "additive":"additive", + "addTime":"addTime", + + "reset":"reset", + "sendKey":"sendKey", + "timeLimit":"timeLimit", + "permanent":"permanent", + "once":"once", + "circulation":"circulation", + "receiver":"receiver", + "pleaseEnterNumberOrEmail":"pleaseEnterNumberOrEmail", + "name":"name", + "enterYourName":"enterYourName", + "effectiveTime":"effectiveTime", + "failureTime":"failureTime", + "effectiveDate":"effectiveDate", + "failureDate":"failureDate", + "Monday":"Monday", + "Tuesday":"Tuesday", + "Wednesday":"Wednesday", + "Thursday":"Thursday", + "Friday":"Friday", + "Saturday":"Saturday", + "Sunday":"Sunday", + + "realNameAuthentication":"realNameAuthentication", + "sendKeyBottomTip":"sendKeyBottomTip", + "send":"send", + "periodValidity":"periodValidity", + "sendGroupKey":"sendGroupKey", + "lock":"lock", + "pleaseAdd":"pleaseAdd", + "pleaseSelet":"pleaseSelet", + "remoteUnlockingAllowed":"remoteUnlockingAllowed", + "pleaseEnter":"pleaseEnter", + "getPassword":"getPassword", + "custom":"custom", + "clearAll":"clearAll", + "recursiveDevice":"recursiveDevice", + "pleaseNameYourPassword":"pleaseNameYourPassword", + "pleaseEnterDigitsNumber":"pleaseEnter6", + "getPasswordTip1":"getPasswordTip1", + "getPasswordTip2":"getPasswordTip2", + "getPasswordTip3":"getPasswordTip3", + "getPasswordTip4":"getPasswordTip4", + "getPasswordTip5":"getPasswordTip5", + "getPasswordTip6":"getPasswordTip6", + "getTip":"getTip", + "addTip":"addTip", + "sender":"sender", + "senderTime":"senderTime", + "keyDetail":"keyDetail", + "detail":"detail", + "delete":"delete", + "passwordDetail":"passwordDetail", + "share":"share", + "amend":"amend", + "sure":"sure", + "cancel":"cancel", + "add":"add", + "accountNumber":"accountNumber", + "volumeAuthorizationLock":"volumeAuthorizationLock", + "authorizedAdminTip":"authorizedAdminTip", + "lockOperatingRecordTip":"lockOperatingRecordTip", + + "basicInformation":"basicInformation", + "wirelessKeyboard":"wirelessKeyboard", + "doorMagnetic":"doorMagnetic", + "remoteUnlocking":"remoteUnlocking", + "automaticBlocking":"automaticBlocking", + "normallyOpenMode":"normallyOpenMode", + "lockSound":"lockSound", + "burglarAlarm":"burglarAlarm", + "resetButton":"resetButton", + "lockTime":"lockTime", + "diagnose":"diagnose", + "uploadData":"uploadData", + "importOtherLockData":"importOtherLockData", + "lockEscalation":"lockEscalation", + "markedHouseState":"markedHouseState", + "unlockReminder":"unlockReminder", + "unlockQRCode":"unlockQRCode", + "lockNumber":"lockNumber", + "electricQuantity":"electricQuantity", + "lockName":"lockName", + "lockGrouping":"lockGrouping", + "adminOpenLockPassword":"adminOpenLockPassword", + "update":"update", + "updateElectricQuantityTip":"updateElectricQuantityTip", + "adminOpenLockPasswordTip":"adminOpenLockPasswordTip", + "updateLockAdminPassword":"updateLockAdminPassword", + "whenScreenFlashesClickNext":"whenScreenFlashesClickNext", + "theScreenNeverFlickered":"theScreenNeverFlickered", + "enterNumberOrPressSet":"enterNumberOrPressSet", + "theLocationOfTheSetKeyWillBeDifferent":"theLocationOfTheSetKeyWillBeDifferent", + "pressAndHoldTheResetButtonTwoSeconds":"pressAndHoldTheResetButtonTwoSeconds", + "nearbyEquipment":"nearbyEquipment", + "noData":"noData", + "doorMagneticListTopTip":"doorMagneticListTopTip", + "remoteUnlockingPageTip":"remoteUnlockingPageTip", + "currentMode":"currentMode", + "delayTime":"delayTime", + "automaticBlockingTip":"automaticBlockingTip", + "time":"time", + "normallyOpen":"normallyOpen", + "date":"date", + "begin":"begin", + "end":"end", + "allDay":"allDay", + "save":"save", + "normallyOpenModeTip":"normallyOpenModeTip", + "pleaseSeletLockVolume":"pleaseSeletLockVolume", + "lockSoundTip":"lockSoundTip", + "low":"low", + "lower":"lower", + "medium":"medium", + "high":"high", + "higher":"higher", + "burglarAlarmTip":"burglarAlarmTip", + "resetButtonTip":"resetButtonTip", + "calibrationTime":"calibrationTime", + "setTheDSTMode":"setTheDSTMode", + "diagnoseTip":"diagnoseTip", + "uploading":"uploading", + "uploadDataTip":"uploadDataTip", + "importOtherLockDataTip":"importOtherLockDataTip", + "haveNewVersion":"haveNewVersion", + "currentVersion":"currentVersion", + "newVersion":"newVersion", + "upgrade":"upgrade", + "leisure":"leisure", + "checkedIn":"checkedIn", + + "lanEnglish":"lanEnglish", + "lanChinese":"lanChinese", + "multilingual":"multilingual", + "addLock":"addLock", + "gateway":"gateway", + "message":"message", + "supportStaff":"supportStaff", + "set":"set", + "moreServices":"moreServices", + + "moreSet":"moreSet", + "prompTone":"prompTone", + "touchUnlock":"touchUnlock", + "pushNotification":"pushNotification", + "lockUserManagement":"lockUserManagement", + "authorizedAdmin":"authorizedAdmin", + "lockGroup":"lockGroup", + "transferSmartLock":"transferSmartLock", + "transferGateway":"transferGateway", + + "multiLanguage":"multiLanguage", + "lockScreen":"lockScreen", + "closed":"closed", + "opened":"opened", + "hideInvalidUnlockPermissions":"hideInvalidUnlockPermissions", + "appUnlockRequiresMobilePhoneAccessToTheLock":"appUnlockRequiresMobilePhoneAccessToTheLock", + "valueAddedServices":"valueAddedServices", + "about":"about", + "userAgreement":"userAgreement", + "privacyPolicy":"privacyPolicy", + "personalInformationCollectionList":"personalInformationCollectionList", + "applicationPermissionDescription":"applicationPermissionDescription", + "thirdPartyInformationSharingList":"thirdPartyInformationSharingList", + "logout":"logout", + "deleteAccount":"deleteAccount", + + "allLock":"allLock", + "searchAllLockType":"searchAllLockType", + "doorLock":"doorLock", + "padlock":"padlock", + "safeLock":"safeLock", + "intelligentLockCore":"intelligentLockCore", + "parkingLock":"parkingLock", + "bicycleLock":"bicycleLock", + "longRangeControl":"longRangeControl", + "lightTouchScreen":"lightTouchScreen", + "lightTouchScreenTip":"lightTouchScreenTip", + "next":"next", + "nearbyLock":"nearbyLock", + "addSuccessfullyPleaseRename":"addSuccessfullyPleaseRename", + "whenAddingLockThePhoneMustBeNextToTheLock":"whenAddingLockThePhoneMustBeNextToTheLock", + + "login":"login", + "register":"Register", + "forgetPassword":"forgetPassword", + "readAndAgree":"readAndAgree", + "verificationCode":"verificationCode", + "registerPasswordTip":"registerPasswordTip", + "iphone":"iphone", + "email":"email", + "countryAndRegion":"countryAndRegion", + "selet":"selet" +} \ No newline at end of file diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json new file mode 100644 index 00000000..6fd56a6d --- /dev/null +++ b/star_lock/images/lan/lan_zh.json @@ -0,0 +1,206 @@ +{ + "starLock":"星锁", + "clickUnlockAndHoldDownClose":"点击开锁,长按关闭", + "checkingIn":"考勤", + "electronicKey":"电子钥匙", + "password":"密码", + "card":"卡", + "fingerprint":"指纹", + "remoteControl":"遥控", + "operatingRecord":"操作记录", + "number":"号", + "additive":"添加者", + "addTime":"添加时间", + + "reset":"重置", + "sendKey":"发送钥匙", + "timeLimit":"限时", + "permanent":"永久", + "once":"单次", + "circulation":"循环", + "receiver":"接收者", + "pleaseEnterNumberOrEmail":"请输入手机号或者邮箱", + "name":"姓名", + "enterYourName":"请输入姓名", + "effectiveTime":"生效时间", + "failureTime":"失效时间", + "effectiveDate":"生效日期", + "failureDate":"失效日期", + "Monday":"一", + "Tuesday":"二", + "Wednesday":"三", + "Thursday":"四", + "Friday":"五", + "Saturday":"六", + "Sunday":"日", + + "realNameAuthentication":"实名认证", + "sendKeyBottomTip":"接收者在有效期内可以不限次数使用", + "send":"发送", + "periodValidity":"有效期", + "sendGroupKey":"群发钥匙", + "lock":"锁", + "pleaseAdd":"请添加", + "pleaseSelet":"请选择", + "remoteUnlockingAllowed":"允许远程开锁", + "pleaseEnter":"请输入", + "getPassword":"获取密码", + "custom":"自定义", + "clearAll":"清空", + "recursiveDevice":"循环方式", + "pleaseNameYourPassword":"请给密码命名", + "pleaseEnterDigitsNumber":"请输入6-9位数字", + "getPasswordTip1":"密码在24小时内至少要使用过一次,否则将无效", + "getPasswordTip2":"限时密码可以再有下期内不限次数使用 \\n密码在生效后的24小时内至少要使用过一次,否则将失效", + "getPasswordTip3":"密码有限期为6个小时,只能使用一次", + "getPasswordTip4":"可在锁旁边通过手机蓝牙添加,也可以通过网关远程添加", + "getPasswordTip5":"密码在生效后的24小时内至少要使用过一次,否则将失效", + "getPasswordTip6":"密码有效期为24小时,在锁上输入后,将使之前使用过的密码都失效", + "getTip":"获取", + "addTip":"添加", + "sender":"发送人", + "senderTime":"发送时间", + "keyDetail":"钥匙详情", + "detail":"详情", + "delete":"删除", + "passwordDetail":"密码详情", + "share":"分享", + "amend":"修改", + "sure":"确定", + "cancel":"取消", + "add":"添加", + "accountNumber":"账号", + "volumeAuthorizationLock":"批量授权锁", + "authorizedAdminTip":"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人", + "lockOperatingRecordTip":"只能保留一定时间内的记录,如果您需要保留历史记录,可以在右上角导出", + + "basicInformation":"基本信息", + "wirelessKeyboard":"无线键盘", + "doorMagnetic":"门磁", + "remoteUnlocking":"远程开锁", + "automaticBlocking":"自动闭锁", + "normallyOpenMode":"常开模式", + "lockSound":"锁声音", + "burglarAlarm":"防撬报警", + "resetButton":"重置键", + "lockTime":"锁时间", + "diagnose":"诊断", + "uploadData":"上传数据", + "importOtherLockData":"导入其他锁数据", + "lockEscalation":"锁升级", + "markedHouseState":"标记房态", + "unlockReminder":"开锁提醒", + "unlockQRCode":"开锁二维码", + "lockNumber":"锁编号", + "electricQuantity":"电量", + "lockName":"名称", + "lockGrouping":"锁分组", + "adminOpenLockPassword":"管理员开锁密码", + "update":"更新", + "updateElectricQuantityTip":"电量信息可以通过网关远程更新,或通过手机蓝牙在锁旁边更新", + "adminOpenLockPasswordTip":"如果你在锁上修改过密码,锁内实际有效密码与这里显示的可能不同", + "updateLockAdminPassword":"上传锁内管理员密码", + "whenScreenFlashesClickNext":"当屏幕闪烁时,点击下一步", + "theScreenNeverFlickered":"屏幕一直没有闪烁", + "enterNumberOrPressSet":"输入*529#或按设置键", + "theLocationOfTheSetKeyWillBeDifferent":"设置键的位置会有差异", + "pressAndHoldTheResetButtonTwoSeconds":"长按重置键2秒", + "nearbyEquipment":"附近的设备", + "noData":"暂无数据", + "doorMagneticListTopTip":"通过门磁可查询门的开、关状态。每把锁咳添加一个门磁", + "remoteUnlockingPageTip":"功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。", + "currentMode":"当前模式", + "delayTime":"延迟时间", + "automaticBlockingTip":"经过以上设定的时间,锁会自动关闭。开启或修改设置后,请先开一次锁,使时间生效", + "time":"时间", + "normallyOpen":"常开", + "date":"日期", + "begin":"开始", + "end":"结束", + "allDay":"全天", + "save":"保存", + "normallyOpenModeTip":"在设置的常开时间内,锁呗打开后将一直处于打开的状态,直到被手动关闭", + "pleaseSeletLockVolume":"请选择锁音量", + "lockSoundTip":"功能开启后,你将可以听到智能锁的提示音。包括电量过低,密码错误等提示。", + "low":"低", + "lower":"较低", + "medium":"中", + "higher":"较高", + "high":"高", + "burglarAlarmTip":"开启后,锁被撬动时,会发出报警声", + "resetButtonTip":"开启后,可通过长按锁上的重置键来用APP重新添加\\n关闭后,重置键无效,锁要通过app删除后才能重新添加", + "calibrationTime":"校准时间", + "setTheDSTMode":"夏令时模式设置", + "diagnoseTip":"诊断是读取锁内的配置信息并上传,以便工作人员分析故障的原因", + "uploading":"上传", + "uploadDataTip":"本操作将上传锁内数据到服务器,过程可能需要几分钟,请耐心等待", + "importOtherLockDataTip":"请选择要从哪把锁导入", + "haveNewVersion":"有新版本", + "currentVersion":"当前版本", + "newVersion":"新版本", + "upgrade":"升级", + "leisure":"空闲", + "checkedIn":"已入住", + + "lanEnglish":"英文", + "lanChinese":"中文", + "multilingual":"多语言", + "addLock":"添加锁", + "gateway":"网关", + "message":"消息", + "supportStaff":"客服", + "set":"设置", + "moreServices":"更多服务", + + "moreSet":"更多设置", + "prompTone":"提示音", + "touchUnlock":"触摸开锁", + "pushNotification":"消息推送", + "lockUserManagement":"锁用户管理", + "authorizedAdmin":"授权管理员", + "lockGroup":"锁分组", + "transferSmartLock":"转移智能锁", + "transferGateway":"转移网关", + "multiLanguage":"多语言", + "lockScreen":"锁屏", + "closed":"已关闭", + "opened":"已开启", + "hideInvalidUnlockPermissions":"隐藏无效开锁权限", + "appUnlockRequiresMobilePhoneAccessToTheLock":"APP开锁时需手机连网的锁", + "valueAddedServices":"增值服务", + "about":"关于", + "userAgreement":"用户协议", + "privacyPolicy":"隐私政策", + "personalInformationCollectionList":"个人信息收集清单", + "applicationPermissionDescription":"应用权限说明", + "thirdPartyInformationSharingList":"第三方信息共享清单", + "logout":"退出", + "deleteAccount":"删除账号", + + "allLock":"所有锁", + "searchAllLockType":"搜索所有锁类型", + "doorLock":"门锁", + "padlock":"挂锁", + "safeLock":"保险箱锁", + "intelligentLockCore":"智能锁芯", + "parkingLock":"车位锁", + "bicycleLock":"自行车锁", + "longRangeControl":"远程控制", + "lightTouchScreen":"摸亮触摸屏", + "lightTouchScreenTip":"摸亮触摸屏,锁进入可添加状态,点击下一步", + "next":"下一步", + "nearbyLock":"附近的锁", + "addSuccessfullyPleaseRename":"添加成功,请重命名", + "whenAddingLockThePhoneMustBeNextToTheLock":"添加锁时,手机必须在锁旁边", + + "login":"登录", + "register":"注册", + "forgetPassword":"忘记密码", + "readAndAgree":"我已阅读并同意", + "verificationCode":"验证码", + "registerPasswordTip":"密码必须是8-20位,至少包括数字/字母/符号中的2种", + "iphone":"手机", + "email":"邮箱", + "countryAndRegion":"国家/地区", + "selet":"选择" +} \ No newline at end of file diff --git a/star_lock/images/main/icon_addDoorMagnetic_tip.png b/star_lock/images/main/icon_addDoorMagnetic_tip.png new file mode 100644 index 00000000..a2fadc4f Binary files /dev/null and b/star_lock/images/main/icon_addDoorMagnetic_tip.png differ diff --git a/star_lock/images/main/icon_addWirelessKeyboardTip.png b/star_lock/images/main/icon_addWirelessKeyboardTip.png new file mode 100644 index 00000000..e752b914 Binary files /dev/null and b/star_lock/images/main/icon_addWirelessKeyboardTip.png differ diff --git a/star_lock/images/main/icon_addWirelessKeyboardUnLightOnTip.png b/star_lock/images/main/icon_addWirelessKeyboardUnLightOnTip.png new file mode 100644 index 00000000..cd0ce2a4 Binary files /dev/null and b/star_lock/images/main/icon_addWirelessKeyboardUnLightOnTip.png differ diff --git a/star_lock/images/main/icon_main_addLock.png b/star_lock/images/main/icon_main_addLock.png new file mode 100644 index 00000000..9c640139 Binary files /dev/null and b/star_lock/images/main/icon_main_addLock.png differ diff --git a/star_lock/images/main/icon_main_authorizedAdmin.png b/star_lock/images/main/icon_main_authorizedAdmin.png new file mode 100644 index 00000000..cdf18471 Binary files /dev/null and b/star_lock/images/main/icon_main_authorizedAdmin.png differ diff --git a/star_lock/images/main/icon_main_cell.png b/star_lock/images/main/icon_main_cell.png new file mode 100644 index 00000000..ceeeb8dd Binary files /dev/null and b/star_lock/images/main/icon_main_cell.png differ diff --git a/star_lock/images/main/icon_main_clockingIn.png b/star_lock/images/main/icon_main_clockingIn.png new file mode 100644 index 00000000..d21ba58e Binary files /dev/null and b/star_lock/images/main/icon_main_clockingIn.png differ diff --git a/star_lock/images/main/icon_main_electronicKey.png b/star_lock/images/main/icon_main_electronicKey.png new file mode 100644 index 00000000..577e2336 Binary files /dev/null and b/star_lock/images/main/icon_main_electronicKey.png differ diff --git a/star_lock/images/main/icon_main_fingerprint.png b/star_lock/images/main/icon_main_fingerprint.png new file mode 100644 index 00000000..6e211f0a Binary files /dev/null and b/star_lock/images/main/icon_main_fingerprint.png differ diff --git a/star_lock/images/main/icon_main_icCard.png b/star_lock/images/main/icon_main_icCard.png new file mode 100644 index 00000000..68930543 Binary files /dev/null and b/star_lock/images/main/icon_main_icCard.png differ diff --git a/star_lock/images/main/icon_main_lockSet_lockEscalation.png b/star_lock/images/main/icon_main_lockSet_lockEscalation.png new file mode 100644 index 00000000..db64bb71 Binary files /dev/null and b/star_lock/images/main/icon_main_lockSet_lockEscalation.png differ diff --git a/star_lock/images/main/icon_main_openLockBtn.png b/star_lock/images/main/icon_main_openLockBtn.png new file mode 100644 index 00000000..52cf88e5 Binary files /dev/null and b/star_lock/images/main/icon_main_openLockBtn.png differ diff --git a/star_lock/images/main/icon_main_operatingRecord.png b/star_lock/images/main/icon_main_operatingRecord.png new file mode 100644 index 00000000..698e0eb2 Binary files /dev/null and b/star_lock/images/main/icon_main_operatingRecord.png differ diff --git a/star_lock/images/main/icon_main_password.png b/star_lock/images/main/icon_main_password.png new file mode 100644 index 00000000..a6cb4df3 Binary files /dev/null and b/star_lock/images/main/icon_main_password.png differ diff --git a/star_lock/images/main/icon_main_remoteControl.png b/star_lock/images/main/icon_main_remoteControl.png new file mode 100644 index 00000000..a71016d9 Binary files /dev/null and b/star_lock/images/main/icon_main_remoteControl.png differ diff --git a/star_lock/images/main/icon_main_remoteUnlocking.png b/star_lock/images/main/icon_main_remoteUnlocking.png new file mode 100644 index 00000000..46924b35 Binary files /dev/null and b/star_lock/images/main/icon_main_remoteUnlocking.png differ diff --git a/star_lock/images/main/icon_main_search.png b/star_lock/images/main/icon_main_search.png new file mode 100644 index 00000000..1128d404 Binary files /dev/null and b/star_lock/images/main/icon_main_search.png differ diff --git a/star_lock/images/main/icon_main_set.png b/star_lock/images/main/icon_main_set.png new file mode 100644 index 00000000..4f23cb4e Binary files /dev/null and b/star_lock/images/main/icon_main_set.png differ diff --git a/star_lock/images/main/mainLeft_menu_icon.png b/star_lock/images/main/mainLeft_menu_icon.png new file mode 100644 index 00000000..bff9ae26 Binary files /dev/null and b/star_lock/images/main/mainLeft_menu_icon.png differ diff --git a/star_lock/images/mine/icon_mine_main_addLock.png b/star_lock/images/mine/icon_mine_main_addLock.png new file mode 100644 index 00000000..627bd844 Binary files /dev/null and b/star_lock/images/mine/icon_mine_main_addLock.png differ diff --git a/star_lock/images/mine/icon_mine_main_defaultAvatar.png b/star_lock/images/mine/icon_mine_main_defaultAvatar.png new file mode 100644 index 00000000..1a1012d1 Binary files /dev/null and b/star_lock/images/mine/icon_mine_main_defaultAvatar.png differ diff --git a/star_lock/images/mine/icon_mine_main_gateway.png b/star_lock/images/mine/icon_mine_main_gateway.png new file mode 100644 index 00000000..9ed9ccd1 Binary files /dev/null and b/star_lock/images/mine/icon_mine_main_gateway.png differ diff --git a/star_lock/images/mine/icon_mine_main_message.png b/star_lock/images/mine/icon_mine_main_message.png new file mode 100644 index 00000000..4d486df2 Binary files /dev/null and b/star_lock/images/mine/icon_mine_main_message.png differ diff --git a/star_lock/images/mine/icon_mine_main_moreServices.png b/star_lock/images/mine/icon_mine_main_moreServices.png new file mode 100644 index 00000000..1da757a7 Binary files /dev/null and b/star_lock/images/mine/icon_mine_main_moreServices.png differ diff --git a/star_lock/images/mine/icon_mine_main_set.png b/star_lock/images/mine/icon_mine_main_set.png new file mode 100644 index 00000000..1663d2ff Binary files /dev/null and b/star_lock/images/mine/icon_mine_main_set.png differ diff --git a/star_lock/images/mine/icon_mine_main_supportStaff.png b/star_lock/images/mine/icon_mine_main_supportStaff.png new file mode 100644 index 00000000..0a0f0b2b Binary files /dev/null and b/star_lock/images/mine/icon_mine_main_supportStaff.png differ diff --git a/star_lock/images/tabbar/icon_tab_main_selet.png b/star_lock/images/tabbar/icon_tab_main_selet.png new file mode 100644 index 00000000..21552ddc Binary files /dev/null and b/star_lock/images/tabbar/icon_tab_main_selet.png differ diff --git a/star_lock/images/tabbar/icon_tab_main_unselet.png b/star_lock/images/tabbar/icon_tab_main_unselet.png new file mode 100644 index 00000000..b497c09e Binary files /dev/null and b/star_lock/images/tabbar/icon_tab_main_unselet.png differ diff --git a/star_lock/images/tabbar/icon_tab_my_selet.png b/star_lock/images/tabbar/icon_tab_my_selet.png new file mode 100644 index 00000000..f06eb894 Binary files /dev/null and b/star_lock/images/tabbar/icon_tab_my_selet.png differ diff --git a/star_lock/images/tabbar/icon_tab_my_unselet.png b/star_lock/images/tabbar/icon_tab_my_unselet.png new file mode 100644 index 00000000..7511da6e Binary files /dev/null and b/star_lock/images/tabbar/icon_tab_my_unselet.png differ diff --git a/star_lock/ios/.gitignore b/star_lock/ios/.gitignore new file mode 100644 index 00000000..7a7f9873 --- /dev/null +++ b/star_lock/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/star_lock/ios/Flutter/AppFrameworkInfo.plist b/star_lock/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..9625e105 --- /dev/null +++ b/star_lock/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 + + diff --git a/star_lock/ios/Flutter/Debug.xcconfig b/star_lock/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..ec97fc6f --- /dev/null +++ b/star_lock/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/star_lock/ios/Flutter/Release.xcconfig b/star_lock/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..c4855bfe --- /dev/null +++ b/star_lock/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/star_lock/ios/Podfile b/star_lock/ios/Podfile new file mode 100644 index 00000000..d207307f --- /dev/null +++ b/star_lock/ios/Podfile @@ -0,0 +1,38 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/star_lock/ios/Podfile.lock b/star_lock/ios/Podfile.lock new file mode 100644 index 00000000..9c90cf90 --- /dev/null +++ b/star_lock/ios/Podfile.lock @@ -0,0 +1,41 @@ +PODS: + - device_info_plus (0.0.1): + - Flutter + - Flutter (1.0.0) + - flutter_native_contact_picker (0.0.1): + - Flutter + - package_info_plus (0.4.5): + - Flutter + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) + - Flutter (from `Flutter`) + - flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) + +EXTERNAL SOURCES: + device_info_plus: + :path: ".symlinks/plugins/device_info_plus/ios" + Flutter: + :path: Flutter + flutter_native_contact_picker: + :path: ".symlinks/plugins/flutter_native_contact_picker/ios" + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/ios" + +SPEC CHECKSUMS: + device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 + package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e + path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8 + +PODFILE CHECKSUM: 663715e941f9adb426e33bf9376914006f9ea95b + +COCOAPODS: 1.12.1 diff --git a/star_lock/ios/Runner.xcodeproj/project.pbxproj b/star_lock/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..908be74a --- /dev/null +++ b/star_lock/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,532 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 3ED61D98CC08F93BC18EEFD0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B7537A79A618D0BBB434A17B /* libPods-Runner.a */; }; + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; + 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 99F6494C6B1A24363CCC6D32 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + B7537A79A618D0BBB434A17B /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + BDB5B400176768766E85D5EB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + DC20461C9C4624BEB2DCD779 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3ED61D98CC08F93BC18EEFD0 /* libPods-Runner.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 780FAA17A040B9755AD6154A /* Pods */ = { + isa = PBXGroup; + children = ( + DC20461C9C4624BEB2DCD779 /* Pods-Runner.debug.xcconfig */, + 99F6494C6B1A24363CCC6D32 /* Pods-Runner.release.xcconfig */, + BDB5B400176768766E85D5EB /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + 9304F75C378DB3447BB2408C /* Frameworks */ = { + isa = PBXGroup; + children = ( + B7537A79A618D0BBB434A17B /* libPods-Runner.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 780FAA17A040B9755AD6154A /* Pods */, + 9304F75C378DB3447BB2408C /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 97C146F21CF9000F007C117D /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 03BC065FC3064C0B6EE97546 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 03BC065FC3064C0B6EE97546 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, + 97C146F31CF9000F007C117D /* main.m in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 7NLFRKNVY3; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.starLock; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 7NLFRKNVY3; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.starLock; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 7NLFRKNVY3; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.starLock; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/star_lock/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/star_lock/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/star_lock/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/star_lock/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/star_lock/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/star_lock/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/star_lock/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/star_lock/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/star_lock/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/star_lock/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/star_lock/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..c87d15a3 --- /dev/null +++ b/star_lock/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/star_lock/ios/Runner.xcworkspace/contents.xcworkspacedata b/star_lock/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..21a3cc14 --- /dev/null +++ b/star_lock/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/star_lock/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/star_lock/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/star_lock/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/star_lock/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/star_lock/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/star_lock/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/star_lock/ios/Runner/AppDelegate.h b/star_lock/ios/Runner/AppDelegate.h new file mode 100644 index 00000000..36e21bbf --- /dev/null +++ b/star_lock/ios/Runner/AppDelegate.h @@ -0,0 +1,6 @@ +#import +#import + +@interface AppDelegate : FlutterAppDelegate + +@end diff --git a/star_lock/ios/Runner/AppDelegate.m b/star_lock/ios/Runner/AppDelegate.m new file mode 100644 index 00000000..70e83933 --- /dev/null +++ b/star_lock/ios/Runner/AppDelegate.m @@ -0,0 +1,13 @@ +#import "AppDelegate.h" +#import "GeneratedPluginRegistrant.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [GeneratedPluginRegistrant registerWithRegistry:self]; + // Override point for customization after application launch. + return [super application:application didFinishLaunchingWithOptions:launchOptions]; +} + +@end diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..28c6bf03 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..f091b6b0 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cde1211 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..d0ef06e7 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..dcdc2306 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..c8f9ed8f Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..75b2d164 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..c4df70d3 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..6a84f41e Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..d0e1f585 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/star_lock/ios/Runner/Base.lproj/LaunchScreen.storyboard b/star_lock/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/star_lock/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/star_lock/ios/Runner/Base.lproj/Main.storyboard b/star_lock/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/star_lock/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/star_lock/ios/Runner/Info.plist b/star_lock/ios/Runner/Info.plist new file mode 100644 index 00000000..9023ff34 --- /dev/null +++ b/star_lock/ios/Runner/Info.plist @@ -0,0 +1,53 @@ + + + + + NSContactsUsageDescription + Reason we need access to the contact list + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Star Lock + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + star_lock + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/star_lock/ios/Runner/main.m b/star_lock/ios/Runner/main.m new file mode 100644 index 00000000..dff6597e --- /dev/null +++ b/star_lock/ios/Runner/main.m @@ -0,0 +1,9 @@ +#import +#import +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart new file mode 100644 index 00000000..8b66f312 --- /dev/null +++ b/star_lock/lib/appRouters.dart @@ -0,0 +1,367 @@ + +import 'package:get/get.dart'; +import 'package:star_lock/mine/mineSet/mineSet_page.dart'; + +import 'login/forgetPassword/starLock_forgetPassword_page.dart'; +import 'login/login/starLock_login_page.dart'; +import 'login/register/starLock_register_page.dart'; +import 'login/seletCountryRegion/seletCountryRegion_page.dart'; +import 'main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart'; +import 'main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart'; +import 'main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart'; +import 'main/lockDetail/lcokSet/basicInformation/editLockName/editLockName_page.dart'; +import 'main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/lockSeletGrouping_page.dart'; +import 'main/lockDetail/lcokSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart'; +import 'main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_page.dart'; +import 'main/lockDetail/lcokSet/diagnose/diagnose_page.dart'; +import 'main/lockDetail/lcokSet/doorMagnetic/addDoorMagnetic/addDoorMagnetic_page.dart'; +import 'main/lockDetail/lcokSet/doorMagnetic/doorMagneticList/doorMagnetic_page.dart'; +import 'main/lockDetail/lcokSet/doorMagnetic/nearbyDoorMagnetic/nearbyDoorMagnetic_page.dart'; +import 'main/lockDetail/lcokSet/importOtherLockData/ImportOtherLockData_Page.dart'; +import 'main/lockDetail/lcokSet/lockEscalation/lockEscalation_page.dart'; +import 'main/lockDetail/lcokSet/lockSet/lockSet_page.dart'; +import 'main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart'; +import 'main/lockDetail/lcokSet/lockTime/lockTime_page.dart'; +import 'main/lockDetail/lcokSet/markedHouseState/markedHouseState_page.dart'; +import 'main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart'; +import 'main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_page.dart'; +import 'main/lockDetail/lcokSet/resetButton/resetButton_page.dart'; +import 'main/lockDetail/lcokSet/unlockQRCode/unlockQRCode_page.dart'; +import 'main/lockDetail/lcokSet/uploadData/uploadData_page.dart'; +import 'main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboard/addWirelessKeyboard_page.dart'; +import 'main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboardScreenNotLightOn/addWirelessKeyboardScreenNotLightOn_page.dart'; +import 'main/lockDetail/lcokSet/wirelessKeyboard/seletWirelessKeyboard/seletWirelessKeyboard_page.dart'; +import 'main/lockDetail/lcokSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart'; +import 'mine/addLock/addLock/addLock_page.dart'; +import 'main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart'; +import 'main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart'; +import 'main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart'; +import 'main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLockManage/volumeAuthorizationLockManage_page.dart'; +import 'main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart'; +import 'main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart'; +import 'main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart'; +import 'main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart'; +import 'main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart'; +import 'main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_page.dart'; +import 'main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart'; +import 'main/lockDetail/lockDetail/lockDetail_page.dart'; +import 'main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart'; +import 'main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart'; +import 'main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart'; +import 'main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_page.dart'; +import 'main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart'; +import 'main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart'; +import 'main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_page.dart'; +import 'main/lockMian/lockMain_page.dart'; +import 'mine/addLock/lockAddress/lockAddress_page.dart'; +import 'mine/addLock/nearbyLock/nearbyLock_page.dart'; +import 'mine/addLock/saveLock/saveLock_page.dart'; +import 'mine/addLock/seletLockType/seletLockType_page.dart'; +import 'mine/mineMultiLanguage/mineMultiLanguage_page.dart'; +import 'mine/mine_page.dart'; +import 'starLockApplication.dart'; + +abstract class Routers { + static const initial = '/';// 加载页 + static const starLockMain = '/StarLockMain';// 首页 + static const starLockMinePage = '/StarLockMinePage';// 我的 + static const seletLockTypePage = '/SeletLockTypePage';// 选择锁类型 + static const addLockPage = '/AddLockPage';// 选择锁类型 + static const nearbyLockPage = '/NearbyLockPage';// 附近的锁 + static const lockAddressPage = '/LockAddressPage';// 锁地址 + static const saveLockPage = '/SaveLockPage';// 保存锁 + static const lockDetailPage = '/LockDetailPage';// 锁详情 + static const electronicKeyListPage = '/ElectronicKeyListPage';// 电子钥匙列表 + static const electronicKeyDetailPage = '/ElectronicKeyDetailPage';// 电子钥匙详情 + static const electronicKeyDetailChangeDate = '/ElectronicKeyDetailChangeDate';// 修改有效期 + static const sendElectronicKeyManagePage = '/SendElectronicKeyManagePage';// 发送电子钥匙 + static const massSendElectronicKeyManagePage = '/MassSendElectronicKeyManagePage';// 群发钥匙 + static const electronicKeyPeriodValidityPage = '/ElectronicKeyPeriodValidityPage';// 电子钥匙有效期 + static const sendEmailNotificationPage = '/SendEmailNotificationPage';// 邮件通知 + static const passwordKeyListPage = '/PasswordKeyListPage';// 密码钥匙列表 + static const passwordKeyManagePage = '/PasswordKeyManagePage';// 密码钥匙 + static const passwordKeyDetailPage = '/PasswordKeyDetailPage';// 密码钥匙详情 + static const otherTypeKeyListPage = '/OtherTypeKeyListPage';// 卡、指纹、遥控钥匙列表 + static const otherTypeKeyDetailPage = '/OtherTypeKeyDetailPage';// 卡、指纹、遥控钥匙详情 + static const otherTypeKeyManagePage = '/OtherTypeKeyManagePage';// 卡、指纹、遥控钥匙添加 + static const authorizedAdminListPage = '/AuthorizedAdminListPage';// 授权管理员列表 + static const authorizedAdminDetailPage = '/AuthorizedAdminDetailPage';// 授权管理员详情 + static const authorizedAdminManagePage = '/AuthorizedAdminManagePage';// 授权管理员 + static const volumeAuthorizationLockManagePage = '/VolumeAuthorizationLockManagePage';// 批量授权锁 + static const lockOperatingRecordPage = '/LockOperatingRecordPage';// 操作记录 + static const lockSetPage = '/LockSetPage';// 锁设置 + static const basicInformationPage = '/BasicInformationPage';// 基本信息 + static const uploadElectricQuantityPage = '/UploadElectricQuantityPage';// 更新锁电量 + static const editLockNamePage = '/EditLockNamePage';// 修改锁名字 + static const lockSeletGroupingPage = '/LockSeletGroupingPage';// 锁选择分组 + static const adminOpenLockPasswordPage = '/AdminOpenLockPasswordPage';// 管理员开锁密码 + static const wirelessKeyboardPage = '/WirelessKeyboardPage';// 蓝牙键盘 + static const addWirelessKeyboardPage = '/AddWirelessKeyboardPage';// 添加蓝牙键盘 + static const addWirelessKeyboardScreenNotLightOnPage = '/AddWirelessKeyboardScreenNotLightOnPage';// 添加蓝牙键盘屏幕不亮时提示 + static const seletWirelessKeyboardPage = '/SeletWirelessKeyboardPage';// 选择蓝牙键盘 + static const doorMagneticPage = '/DoorMagneticPage';// 门磁列表 + static const addDoorMagneticPage = '/AddDoorMagneticPage';// 添加门磁 + static const nearbyDoorMagneticPage = '/NearbyDoorMagneticPage';// 附近的门磁 + static const remoteUnlockingPage = '/RemoteUnlockingPage';// 远程开锁 + static const automaticBlockingPage = '/AutomaticBlockingPage';// 自动闭锁 + static const normallyOpenModePage = '/NormallyOpenModePage';// 常开模式 + static const lockSoundSetPage = '/LockSoundSetPage';// 锁声音 + static const burglarAlarmPage = '/BurglarAlarmPage';// 防撬警报 + static const resetButtonPage = '/ResetButtonPage';// 锁重置键 + static const unlockQRCodePage = '/UnlockQRCodePage';// 开锁二维码 + static const lockTimePage = '/LockTimePage';// 锁时间 + static const diagnosePage = '/DiagnosePage';// 诊断 + static const uploadDataPage = '/UploadDataPage';// 上传数据 + static const importOtherLockDataPage = '/ImportOtherLockDataPage';// 导入其他锁数据 + static const lockEscalationPage = '/LockEscalationPage';// 锁升级 + static const markedHouseStatePage = '/MarkedHouseStatePage';// 标记房态 + + static const mineSetPage = '/MineSetPage';// 我的设置 + static const mineMultiLanguagePage = '/MineMultiLanguagePage';// 我的设置 + + static const starLockLoginPage = '/StarLockLoginPage';// 登录 + static const starLockRegisterPage = '/StarLockRegisterPage';// 注册 + static const starLockForgetPasswordPage = '/StarLockForgetPasswordPage';// 忘记密码 + static const seletCountryRegionPage = '/SeletCountryRegionPage';// 选择国家和地区 +} + +abstract class AppRouters { + static final routePages = [ + GetPage( + name: Routers.initial, + page: () => const StarLockApplication(), + ), + GetPage( + name: Routers.starLockMain, + page: () => const StarLockMain(), + ), + GetPage( + name: Routers.starLockMinePage, + page: () => const StarLockMinePage(), + ), + GetPage( + name: Routers.seletLockTypePage, + page: () => const SeletLockTypePage(), + ), + GetPage( + name: Routers.addLockPage, + page: () => const AddLockPage(), + ), + GetPage( + name: Routers.nearbyLockPage, + page: () => const NearbyLockPage(), + ), + GetPage( + name: Routers.saveLockPage, + page: () => const SaveLockPage(), + ), + GetPage( + name: Routers.lockDetailPage, + page: () => const LockDetailPage(), + ), + GetPage( + name: Routers.electronicKeyListPage, + page: () => const ElectronicKeyListPage(), + ), + GetPage( + name: Routers.electronicKeyDetailPage, + page: () => const ElectronicKeyDetailPage(), + ), + GetPage( + name: Routers.electronicKeyDetailChangeDate, + page: () => const ElectronicKeyDetailChangeDate(), + ), + GetPage( + name: Routers.sendElectronicKeyManagePage, + page: () => const SendElectronicKeyManagePage(), + ), + GetPage( + name: Routers.massSendElectronicKeyManagePage, + page: () => const MassSendElectronicKeyManagePage(), + ), + GetPage( + name: Routers.electronicKeyPeriodValidityPage, + page: () => const ElectronicKeyPeriodValidityPage(), + ), + GetPage( + name: Routers.sendEmailNotificationPage, + page: () => const SendEmailNotificationPage(), + ), + GetPage( + name: Routers.passwordKeyListPage, + page: () => const PasswordKeyListPage(), + ), + GetPage( + name: Routers.passwordKeyManagePage, + page: () => const PasswordKeyManagePage(), + ), + GetPage( + name: Routers.passwordKeyDetailPage, + page: () => const PasswordKeyDetailPage(), + ), + GetPage( + name: Routers.otherTypeKeyListPage, + page: () => const OtherTypeKeyListPage(), + ), + GetPage( + name: Routers.otherTypeKeyDetailPage, + page: () => const OtherTypeKeyDetailPage(), + ), + GetPage( + name: Routers.otherTypeKeyManagePage, + page: () => const OtherTypeKeyManagePage(), + ), + GetPage( + name: Routers.authorizedAdminListPage, + page: () => const AuthorizedAdminListPage(), + ), + GetPage( + name: Routers.authorizedAdminDetailPage, + page: () => const AuthorizedAdminDetailPage(), + ), + GetPage( + name: Routers.authorizedAdminManagePage, + page: () => const AuthorizedAdminManagePage(), + ), + GetPage( + name: Routers.lockOperatingRecordPage, + page: () => const LockOperatingRecordPage(), + ), + GetPage( + name: Routers.mineSetPage, + page: () => const MineSetPage(), + ), + GetPage( + name: Routers.volumeAuthorizationLockManagePage, + page: () => const VolumeAuthorizationLockManagePage(), + ), + GetPage( + name: Routers.mineMultiLanguagePage, + page: () => const MineMultiLanguagePage(), + ), + GetPage( + name: Routers.starLockLoginPage, + page: () => const StarLockLoginPage(), + ), + GetPage( + name: Routers.starLockRegisterPage, + page: () => const StarLockRegisterPage(), + ), + GetPage( + name: Routers.starLockForgetPasswordPage, + page: () => const StarLockForgetPasswordPage(), + ), + GetPage( + name: Routers.seletCountryRegionPage, + page: () => const SeletCountryRegionPage(), + ), + GetPage( + name: Routers.lockSetPage, + page: () => const LockSetPage(), + ), + GetPage( + name: Routers.basicInformationPage, + page: () => const BasicInformationPage(), + ), + GetPage( + name: Routers.uploadElectricQuantityPage, + page: () => const UploadElectricQuantityPage(), + ), + GetPage( + name: Routers.editLockNamePage, + page: () => const EditLockNamePage(), + ), + GetPage( + name: Routers.lockSeletGroupingPage, + page: () => const LockSeletGroupingPage(), + ), + GetPage( + name: Routers.adminOpenLockPasswordPage, + page: () => const AdminOpenLockPasswordPage(), + ), + GetPage( + name: Routers.wirelessKeyboardPage, + page: () => const WirelessKeyboardPage(), + ), + GetPage( + name: Routers.addWirelessKeyboardPage, + page: () => const AddWirelessKeyboardPage(), + ), + GetPage( + name: Routers.addWirelessKeyboardScreenNotLightOnPage, + page: () => const AddWirelessKeyboardScreenNotLightOnPage(), + ), + GetPage( + name: Routers.seletWirelessKeyboardPage, + page: () => const SeletWirelessKeyboardPage(), + ), + GetPage( + name: Routers.doorMagneticPage, + page: () => const DoorMagneticPage(), + ), + GetPage( + name: Routers.addDoorMagneticPage, + page: () => const AddDoorMagneticPage(), + ), + GetPage( + name: Routers.nearbyDoorMagneticPage, + page: () => const NearbyDoorMagneticPage(), + ), + GetPage( + name: Routers.lockAddressPage, + page: () => const LockAddressPage(), + ), + GetPage( + name: Routers.remoteUnlockingPage, + page: () => const RemoteUnlockingPage(), + ), + GetPage( + name: Routers.automaticBlockingPage, + page: () => const AutomaticBlockingPage(), + ), + GetPage( + name: Routers.normallyOpenModePage, + page: () => const NormallyOpenModePage(), + ), + GetPage( + name: Routers.lockSoundSetPage, + page: () => const LockSoundSetPage(), + ), + GetPage( + name: Routers.burglarAlarmPage, + page: () => const BurglarAlarmPage(), + ), + GetPage( + name: Routers.resetButtonPage, + page: () => const ResetButtonPage(), + ), + GetPage( + name: Routers.unlockQRCodePage, + page: () => const UnlockQRCodePage(), + ), + GetPage( + name: Routers.lockTimePage, + page: () => const LockTimePage(), + ),// 诊断 + GetPage( + name: Routers.diagnosePage, + page: () => const DiagnosePage(), + ), + GetPage( + name: Routers.uploadDataPage, + page: () => const UploadDataPage(), + ), + GetPage( + name: Routers.importOtherLockDataPage, + page: () => const ImportOtherLockDataPage(), + ), + GetPage( + name: Routers.lockEscalationPage, + page: () => const LockEscalationPage(), + ), + GetPage( + name: Routers.markedHouseStatePage, + page: () => const MarkedHouseStatePage(), + ), + ]; +} \ No newline at end of file diff --git a/star_lock/lib/app_settings/app_colors.dart b/star_lock/lib/app_settings/app_colors.dart new file mode 100644 index 00000000..c505b278 --- /dev/null +++ b/star_lock/lib/app_settings/app_colors.dart @@ -0,0 +1,122 @@ + +import 'dart:ui'; + +import 'package:flutter/material.dart'; + +class AppColors { + + // static Color mainColor = const Color(0xFF385DEA); + static Color mainColor = const Color(0xFF4777EE); + static Color mainBackgroundColor = const Color(0xFFF5F5F5); + + static Color primaryTopColor = const Color(0xFF021B38); + static Color primaryBottomColor = const Color(0xFF021229); + + static Color itemBgColor = const Color(0xFF063F71); + static Color itemDividerColor = const Color(0xFF042F58); + static Color appBarIconColor = const Color(0xFFFFFFFF); + + //button color + static Color buttonEnableColor = const Color(0xFF0093E5); + static Color buttonDisableColor = buttonEnableColor.withOpacity(0.4); + static Color buttonEnableTextColor = const Color(0xFFFFFFFF); + static Color buttonDisableTextColor = buttonEnableTextColor.withOpacity(0.6); + + + static Color deleteBtnBgColor = const Color(0xFFFF495C).withOpacity(0.7); + static Color touristColor = const Color(0xFFF58A22); + + //check box color + static Color checkBoxSelectedColor = touristColor; + static Color get checkBoxUnselectedColor => const Color(0xFFFFFFFF); + static Color checkBoxOverlayColor = checkBoxUnselectedColor.withOpacity(0.3); + + //dialog + static Color dialogBgColor = const Color(0xFFFFFFFF); + static Color dialogTextColor = const Color(0xFF000000); + static Color dialogInputBgColor = pickerItemSelectedBgColor; + static Color introduceDialogBgColor = const Color(0xFF112B4C); + + + static Color pickerTitleTextColor = const Color(0xFF000000); + static Color pickerInfoTextColor = pickerTitleTextColor.withOpacity(0.5); + static Color pickerItemSelectedTextColor = const Color(0xFF0093E5); + static Color pickerItemSelectedBgColor = const Color(0xFFE4E4E4); + static Color pickerItemUnselectTextColor = pickerTitleTextColor.withOpacity(0.5); + + static Color normalTextColor = const Color(0xFFFFFFFF); + static Color inputErrorTextColor = const Color(0xFFFF6666); + static Color errorImageColor = const Color(0xFFFF495C ); + + static Color inputTitleTextColor = const Color(0xFFFFFFFF).withOpacity(0.6); + static Color settingItemInfoTextColor = const Color(0xFFFFFFFF).withOpacity(0.6); + static Color dividerColor = const Color(0xFFFFFFFF).withOpacity(0.6); + + static Color textFieldEnableBorderColor = normalTextColor.withOpacity(0.2); + static Color textFieldFocusBorderColor = normalTextColor.withOpacity(0.2); + static Color textFieldHintTextColor = normalTextColor.withOpacity(0.4); + static Color textFieldTextColor = normalTextColor; + + static Color protocolTextColor = touristColor; + + + static Color topTabBarSelectedBgColor = buttonEnableColor; + static Color topTabBarUnselectedBgColor = buttonEnableTextColor; + static Color tapTabBarSelectedTextColor = buttonEnableTextColor; + static Color tapTabBarUnselectedTextColor = const Color(0xFF000000); + + static Color recordChartChargeColor = const Color(0xFF24DB6C); + static Color recordChartWorkingColor = const Color(0xFF0093E5); + static Color recordChartBgColor = const Color(0xFFFFFFFF).withOpacity(0.4); + + static Color wifiDisableColor = const Color(0xFFA8A8A8); + + + static Color get paginationColor => const Color(0xFF01295C).withOpacity(45); + static Color get paginationActiveColor => const Color(0xFFFFFFFF).withOpacity(65); + + static Color scanPointerLineColor = Colors.blue; + + static Color scanColor0 = const Color(0xFF0093E5).withOpacity(0.05); + static Color scanColor1 = const Color(0xFF0093E5).withOpacity(0.1); + static Color scanColor2 = const Color(0xFF0093E5).withOpacity(0.3); + static Color scanColor3 = const Color(0xFF0093E5).withOpacity(0.5); + static Color scanColor4 = const Color(0xFF0093E5).withOpacity(0.9); + + static Color scanCircleCenterColor0 = Colors.blue.withOpacity(0.9); + static Color scanCircleCenterColor1 = const Color(0xffE9F3FF).withOpacity(0.8); + + static Color starCenterColor = const Color(0xFF0093E5); + static Color starMiddleColor = const Color.fromRGBO(255, 255, 255,1); + static Color starBorderColor = const Color.fromRGBO(255, 255, 255,0.2); + static Color starOutsideColor = const Color.fromRGBO(255, 255, 255,0.01); + + + static Color workingStateInfoBgColor = const Color(0xFF20354E); + + static Color color_level_0 = const Color(0xFFFA6400); + static Color color_level_1 = const Color(0xFFFFFFFF); + static Color color_level_2 = const Color(0xFFF7B500); + + + static Color switchTrackSelectedColor = const Color(0xFF0093E5); + static Color switchTrackUnselectedColor = const Color(0xFF5A6676).withOpacity(0.5); + static Color switchThumbColor = const Color(0xFFFFFFFF); + + static Color popMenuItemUnselectedBg = const Color(0xFF112B4C); + static Color popMenuItemSelectedColor = const Color(0xFF063F71); + + static Color blackColor = const Color(0xFF000000); + + + static Color dateSelectedBgColor = const Color(0xFF0093E5); + static Color dateSelectedTextColor = const Color(0xFFFFFFFF); + static Color dateUnselectedTextColor = blackColor; + static Color dateUnselectedDialogBgColor = const Color(0xFFC9C9C9).withOpacity(0.5); + static Color dateUnselectedBgColor = const Color(0xFFFFFFFF); + + + static Color progressBgColor = const Color(0xFF022345); + static Color progressValueColor = const Color(0xFF0093E5); + +} \ No newline at end of file diff --git a/star_lock/lib/app_settings/app_settings.dart b/star_lock/lib/app_settings/app_settings.dart new file mode 100644 index 00000000..c43555c5 --- /dev/null +++ b/star_lock/lib/app_settings/app_settings.dart @@ -0,0 +1,119 @@ +import 'package:flutter/foundation.dart'; +import 'dart:io'; + +class AppLog { + static bool _printLog = false; + static bool _onlyError = false; + + static showLog({@required bool printLog, bool onlyError}){ + _printLog = printLog ?? false; + _onlyError = onlyError ?? false; + } + static log(String msg,{bool error}){ + if(!kDebugMode)return; + error = error ?? false; + if(!_printLog)return; + if(_onlyError && !error) return; + if(error){ + msg = '----->>> $msg'; + } + print(msg); + } +} + +class AppPlatform { + static bool isIOS = Platform.isIOS; + static bool isAndroid = Platform.isAndroid; + static String platformString(){ + String name = 'unknown'; + if(isIOS){ + name = 'iOS'; + } + if(isAndroid){ + name = 'Android'; + } + return name; + } + + static String _brand = 'unknown'; + static int _sdkInt = 23; + + static void setBrandString(String brand){ + _brand = brand; + } + static String getBrandString()=>_brand; + static void setSDKInt(int sdkInt){ + _sdkInt = sdkInt; + } + static bool isSamsung()=>_brand.toLowerCase().contains('samsung'); + static int getSdkIntValue()=>_sdkInt; + static bool onlyCanNetUpgrade()=>isSamsung() && (getSdkIntValue() >= 29); + +} + +class AppMowerCodes { + static int idCodeLength(){ + int len = 19; + return len; + } + static int fenceNameLength = 8; + static int registerCodeLength = 4; +} + +class AppDate { + static String dateString() { + return '${year()}-${month().toString().padLeft(2,'0')}-${day().toString() + .padLeft(2,'0')}'; + } + + static String calendarString() { + String temp = '${year()}${month().toString().padLeft(2,'0')}${day().toString() + .padLeft(2,'0')}${hour().toString().padLeft(2,'0')}${second() + .toString().padLeft(2,'0')}'; + return temp; + } + + static int year()=>DateTime.now().year; + static int month()=>DateTime.now().month; + static int day()=>DateTime.now().day; + static int hour()=>DateTime.now().hour; + static int minute()=>DateTime.now().minute; + static int second()=>DateTime.now().second; + static int weekDay()=>DateTime.now().weekday; + static int timeZeroOffset()=>DateTime.now().timeZoneOffset.inHours; + +} + +//TODO:错误类型 +enum ErrorType { + modeNotMatch, + notConnected, + mqttNotConnect, + timeOut, +} + +class AppErrorCode { + static int errorCode(ErrorType type){ + int code = 0; + switch(type){ + case ErrorType.modeNotMatch: + code = 1; + break; + case ErrorType.notConnected: + code = 2; + break; + case ErrorType.mqttNotConnect: + code = 3; + break; + case ErrorType.timeOut: + code = 4; + break; + } + return code; + } +} + + + + + diff --git a/star_lock/lib/app_settings/app_style.dart b/star_lock/lib/app_settings/app_style.dart new file mode 100644 index 00000000..b76482e9 --- /dev/null +++ b/star_lock/lib/app_settings/app_style.dart @@ -0,0 +1,226 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'app_colors.dart'; + +class AppStyle { + + static RoundedRectangleBorder get buttonShape_16 => RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16.0.h), + ); + + static RoundedRectangleBorder get buttonShape_11 => RoundedRectangleBorder( + borderRadius: BorderRadius.circular(11.0.h), + ); + + static Size get btnMinSize => Size(100.w, 60.h); + static Size get btnMinSize2 => Size(60.w, 44.h); + static Size get btnMinSize3 => Size(60.w, 53.h); + + static TextStyle textStyle({Color textColor,double fontSize,FontWeight fontWeight}) => TextStyle( + fontSize: fontSize ?? 18.sp, + color: textColor ?? AppColors.buttonEnableTextColor, + fontWeight: fontWeight ?? FontWeight.normal, + ); + + ///textButtonStyle + static ButtonStyle get textButtonStyle => ButtonStyle( + minimumSize: MaterialStateProperty.resolveWith((states) => btnMinSize), + shape: MaterialStateProperty.resolveWith((states) => buttonShape_16), + backgroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableColor; + return AppColors.buttonEnableColor; + }), + foregroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableTextColor; + return AppColors.buttonEnableTextColor; + }), + textStyle: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return textStyle(textColor: AppColors.buttonDisableColor); + return textStyle(); + }) + ); + + ///textButtonDeleteStyle + static ButtonStyle get textButtonDeleteStyle => ButtonStyle( + minimumSize: MaterialStateProperty.resolveWith((states) => btnMinSize), + shape: MaterialStateProperty.resolveWith((states) => buttonShape_16), + backgroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableColor; + return AppColors.deleteBtnBgColor; + }), + foregroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableTextColor; + return AppColors.buttonEnableTextColor; + }), + textStyle: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return textStyle(textColor: AppColors.buttonDisableColor); + return textStyle(); + }) + ); + + //textButtonStyle2 + static ButtonStyle get textButtonStyle2 => ButtonStyle( + minimumSize: MaterialStateProperty.resolveWith((states) => btnMinSize2), + shape: MaterialStateProperty.resolveWith((states) => buttonShape_11), + backgroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableColor; + return AppColors.buttonEnableColor; + }), + foregroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableTextColor; + return AppColors.buttonEnableTextColor; + }), + textStyle: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return textStyle(textColor: AppColors.buttonDisableColor,fontSize: 11.sp); + return textStyle(fontSize: 11.sp); + }) + ); + + static ButtonStyle get textButtonStyleOthers => ButtonStyle( + minimumSize: MaterialStateProperty.resolveWith((states) => btnMinSize), + shape: MaterialStateProperty.resolveWith((states) => buttonShape_16), + backgroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableTextColor; + return AppColors.buttonEnableTextColor; + }), + foregroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableColor; + return AppColors.buttonEnableColor; + }), + textStyle: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return textStyle(textColor: AppColors.buttonDisableColor); + return textStyle(textColor: AppColors.buttonEnableColor); + }) + ); + + static ButtonStyle get specialButtonStyle => ButtonStyle( + minimumSize: MaterialStateProperty.resolveWith((states) => btnMinSize3), + shape: MaterialStateProperty.resolveWith((states) => buttonShape_16), + backgroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableTextColor; + return AppColors.deleteBtnBgColor; + }), + foregroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableColor; + return AppColors.buttonEnableTextColor; + }), + textStyle: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return textStyle(textColor: AppColors.buttonDisableColor); + return textStyle(textColor: AppColors.buttonEnableColor); + }) + ); + + static ButtonStyle clearTextButtonStyle({Color textColor,Color bgColor,double fontSize,FontWeight fontWeight}) => ButtonStyle( + minimumSize: MaterialStateProperty.resolveWith((states) => btnMinSize), + shape: MaterialStateProperty.resolveWith((states) => buttonShape_16), + backgroundColor: MaterialStateProperty.resolveWith((states){ + bgColor ??= AppColors.normalTextColor; + if(states.contains(MaterialState.disabled)) return bgColor.withOpacity(0.6); + return bgColor; + }), + overlayColor: MaterialStateProperty.resolveWith((states){ + textColor ??= AppColors.buttonEnableColor; + if(states.contains(MaterialState.pressed)) return textColor.withOpacity(0.1); + return textColor.withOpacity(0.1); + }), + foregroundColor: MaterialStateProperty.resolveWith((states){ + textColor ??= AppColors.buttonEnableColor; + if(states.contains(MaterialState.disabled)) return textColor.withOpacity(0.4); + return textColor; + }), + textStyle: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return textStyle(fontSize: fontSize,fontWeight: fontWeight); + return textStyle(fontSize: fontSize,fontWeight: fontWeight); + }), + ); + + ///elevatedButtonButtonStyle + static ButtonStyle get elevatedButtonButtonStyle => ButtonStyle( + minimumSize: MaterialStateProperty.resolveWith((states) => btnMinSize), + shape: MaterialStateProperty.resolveWith((states) => buttonShape_16), + backgroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableColor; + return AppColors.buttonEnableColor; + }), + foregroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableTextColor; + return AppColors.buttonEnableTextColor; + }), + ); + + ///outlinedButtonButtonStyle + static ButtonStyle get outlinedButtonButtonStyle => ButtonStyle( + minimumSize: MaterialStateProperty.resolveWith((states) => btnMinSize), + shape: MaterialStateProperty.resolveWith((states) => buttonShape_16), + backgroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableColor; + return AppColors.buttonEnableColor; + }), + foregroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableTextColor; + return AppColors.buttonEnableTextColor; + }), + ); + + + ///outlinedButtonButtonStyle2 + static ButtonStyle get outlinedButtonButtonStyle2_Selected => ButtonStyle( + minimumSize: MaterialStateProperty.resolveWith((states) => btnMinSize), + shape: MaterialStateProperty.resolveWith((states) => buttonShape_11), + backgroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableColor; + return AppColors.buttonEnableColor; + }), + foregroundColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.disabled)) return AppColors.buttonDisableTextColor; + return AppColors.buttonEnableTextColor; + }), + ); + + ///outlinedButtonButtonStyle2_Selected + static ButtonStyle get outlinedButtonButtonStyle2 => ButtonStyle( + shape: MaterialStateProperty.resolveWith((states) => buttonShape_11), + side: MaterialStateProperty.all(BorderSide( + width: 1.w, + color: AppColors.buttonEnableColor.withOpacity(0.5), + style: BorderStyle.solid, + )), + backgroundColor: MaterialStateProperty.all(Colors.transparent), + ); + + static TextStyle appTextStyle({ + Color textColor, + double fontSize, + }) => AppStyle.textStyle( + textColor: textColor, + fontSize: fontSize, + ); + + static InputBorder get textFieldEnableBorder => UnderlineInputBorder( + borderSide: BorderSide( + color: AppColors.textFieldEnableBorderColor, + width: 1.w, + style: BorderStyle.solid + ), + ); + + static TextStyle get textFieldTextStyle => appTextStyle( + textColor: AppColors.textFieldTextColor, + fontSize: 16.sp, + ); + + static TextStyle get textFieldHintTextStyle => appTextStyle( + textColor: AppColors.textFieldHintTextColor, + fontSize: 12.sp, + ); + + static InputBorder get textFieldFocusBorder => UnderlineInputBorder( + borderSide: BorderSide( + color: AppColors.textFieldFocusBorderColor, + width: 1.w, + style: BorderStyle.solid + ), + ); + +} \ No newline at end of file diff --git a/star_lock/lib/app_settings/app_theme.dart b/star_lock/lib/app_settings/app_theme.dart new file mode 100644 index 00000000..7e6c662b --- /dev/null +++ b/star_lock/lib/app_settings/app_theme.dart @@ -0,0 +1,132 @@ + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'app_colors.dart'; +import 'app_style.dart'; + +class AppTheme { + + static bool get isDarkMode => Get.isDarkMode; + + static ThemeData get appThemeData => ThemeData( + // fontFamily: , + primaryColor: AppColors.primaryTopColor, + navigationBarTheme: navigationBarThemeData, + checkboxTheme: checkBoxThemeData, + textButtonTheme: textButtonThemeData, + outlinedButtonTheme: outlinedButtonThemeData, + buttonTheme: buttonThemeData, + elevatedButtonTheme: elevatedButtonThemeData, + scaffoldBackgroundColor: Colors.transparent, + dialogBackgroundColor: AppColors.dialogBgColor, + // inputDecorationTheme: inputDecorationTheme, + dividerTheme: dividerTheme, + bottomNavigationBarTheme: bottomNavigationBarThemeData, + switchTheme: switchThemeData, + ); + + static SwitchThemeData get switchThemeData => SwitchThemeData( + trackColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.selected)){ + return AppColors.switchTrackSelectedColor; + } + return AppColors.switchTrackUnselectedColor; + }), + thumbColor: MaterialStateProperty.resolveWith((states){ + if(states.contains(MaterialState.selected)){ + return AppColors.switchThumbColor; + } + return AppColors.switchThumbColor; + }), + ); + + static NavigationBarThemeData get navigationBarThemeData => const NavigationBarThemeData( + backgroundColor: Colors.transparent, + ); + + static BottomNavigationBarThemeData get bottomNavigationBarThemeData => BottomNavigationBarThemeData( + elevation: 0, + backgroundColor: Colors.transparent, + selectedItemColor: AppColors.buttonEnableColor, + unselectedItemColor: AppColors.buttonEnableTextColor, + selectedLabelStyle: AppStyle.textStyle( + fontSize: 10, + ), + unselectedLabelStyle: AppStyle.textStyle( + fontSize: 11, + ), + selectedIconTheme: bottomBarSelectedIconTheme, + unselectedIconTheme: bottomBarUnselectedIconTheme, + landscapeLayout: BottomNavigationBarLandscapeLayout.centered, + ); + + static IconThemeData get bottomBarSelectedIconTheme => const IconThemeData( + size: 20, + ); + + static IconThemeData get bottomBarUnselectedIconTheme => const IconThemeData( + size: 21, + ); + + static DividerThemeData get dividerTheme => DividerThemeData( + color: AppColors.dividerColor, + ); + + static InputDecorationTheme get inputDecorationTheme => InputDecorationTheme( + hintStyle: AppStyle.textFieldHintTextStyle, + enabledBorder: AppStyle.textFieldEnableBorder, + focusedBorder: AppStyle.textFieldFocusBorder, + border: AppStyle.textFieldEnableBorder, + ); + + static AppBarTheme get appBarTheme => AppBarTheme( + backgroundColor: Colors.transparent, + iconTheme: IconThemeData( + color: AppColors.appBarIconColor, + ), + elevation: 0.0, + ); + + static CheckboxThemeData get checkBoxThemeData => CheckboxThemeData( + fillColor: MaterialStateProperty.resolveWith((states) { + if(states.contains(MaterialState.selected)){ + return AppColors.checkBoxSelectedColor; + } + return AppColors.checkBoxUnselectedColor; + }), + overlayColor: MaterialStateProperty.resolveWith((states) => AppColors.checkBoxOverlayColor), + ); + + static ElevatedButtonThemeData get elevatedButtonThemeData => ElevatedButtonThemeData( + style: AppStyle.elevatedButtonButtonStyle, + ); + + static TextButtonThemeData get textButtonThemeData => TextButtonThemeData( + style: AppStyle.textButtonStyle, + ); + + static OutlinedButtonThemeData get outlinedButtonThemeData => OutlinedButtonThemeData( + style: AppStyle.outlinedButtonButtonStyle, + ); + + static ButtonThemeData get buttonThemeData => const ButtonThemeData( + textTheme: ButtonTextTheme.primary, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(16.0)) + ), + height: 90, + ); + + +} + + +class NoShadowScrollBehavior extends ScrollBehavior { + + final AxisDirection axisDirection; + const NoShadowScrollBehavior({this.axisDirection = AxisDirection.up}):super(); + @override + Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) { + return GlowingOverscrollIndicator(axisDirection: axisDirection, color: Colors.red,showTrailing: false,showLeading: false,child: child,); + } +} \ No newline at end of file diff --git a/star_lock/lib/baseWidget.dart b/star_lock/lib/baseWidget.dart new file mode 100644 index 00000000..36640388 --- /dev/null +++ b/star_lock/lib/baseWidget.dart @@ -0,0 +1,47 @@ + + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/translations/trans_lib.dart'; + +mixin BaseWidget{ + double fs(double value) => value.sp; + double w(double width) => width.w; + double h(double height) => height.h; + + initUI(Widget widget) => ScreenUtilInit( + // designSize: const Size(750, 1334), + designSize: const Size(375, 812), + minTextAdapt: true, + splitScreenMode: true, + builder: (context , child) { + return widget; + }, + ); + + ///数据为空的视图 + Widget emptyView() { + return Container( + width: double.infinity, + height: double.infinity, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'images/icon_unHaveData.png', + height: 200.w, + width: 200.w, + ), + Padding( + padding: const EdgeInsets.only(top: 10), + child: Text(TranslationLoader.lanKeys.noData.tr, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w600)), + ) + ], + ), + ); + } + +} \ No newline at end of file diff --git a/star_lock/lib/login/forgetPassword/starLock_forgetPassword_page.dart b/star_lock/lib/login/forgetPassword/starLock_forgetPassword_page.dart new file mode 100644 index 00000000..798d0d0f --- /dev/null +++ b/star_lock/lib/login/forgetPassword/starLock_forgetPassword_page.dart @@ -0,0 +1,101 @@ + +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../appRouters.dart'; +import '../../app_settings/app_colors.dart'; +import '../../tools/forgetPwdInput.dart'; +import '../../tools/loginInput.dart'; +import '../../tools/submitBtn.dart'; +import '../../tools/titleAppBar.dart'; +import '../../translations/trans_lib.dart'; + +class StarLockForgetPasswordPage extends StatefulWidget { + const StarLockForgetPasswordPage({Key key}) : super(key: key); + + @override + State createState() => _StarLockForgetPasswordPageState(); +} + +class _StarLockForgetPasswordPageState extends State { + final TextEditingController _phoneController = TextEditingController(); + final TextEditingController _pwdController = TextEditingController(); + final TextEditingController _codeController = TextEditingController(); + + Timer _timer; + + int _seconds = 60; + + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFFFFFFFF), + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.reset.tr} ${TranslationLoader.lanKeys.password.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body:ListView( + padding: EdgeInsets.only( + top: 40.h, + left: 40.w, + right: 40.w + ), + children: [ + LoginInput(controller: _phoneController, leftImg:'images/main/icon_main_search.png', hintText: TranslationLoader.lanKeys.pleaseEnterNumberOrEmail.tr, keyboardType: TextInputType.number,inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 10.w), + LoginInput(controller: _pwdController, isPwd: true, leftImg:'images/main/icon_main_search.png', hintText: "${TranslationLoader.lanKeys.pleaseEnter.tr} ${TranslationLoader.lanKeys.password.tr}",inputFormatters: [ + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 15.w), + Text(TranslationLoader.lanKeys.registerPasswordTip.tr, style: TextStyle(color: const Color(0xFF999999), fontSize: 26.sp),), + SizedBox(height: 10.w), + LoginInput(controller: _pwdController, isPwd: true, leftImg:'images/main/icon_main_search.png', hintText: "${TranslationLoader.lanKeys.sure.tr} ${TranslationLoader.lanKeys.password.tr}",inputFormatters: [ + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 10.w), + ForgetPwdInput(controller: _codeController,hintText: '${TranslationLoader.lanKeys.pleaseEnter.tr} ${TranslationLoader.lanKeys.verificationCode.tr}',keyboardType: TextInputType.number,inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(6), + ],rightSlot: Container( + // margin: EdgeInsets.only(right: 30.w), + child: GestureDetector( + child: Container( + width: 180.w, + height: 60.h, + padding: EdgeInsets.all(5.h), + decoration: BoxDecoration( + color: AppColors.mainColor, + borderRadius: BorderRadius.circular(5) + ), + child: Center( + child: Text(_seconds==60?'${TranslationLoader.lanKeys.getTip.tr} ${TranslationLoader.lanKeys.verificationCode.tr}': (_seconds<10)?'0$_seconds s':'$_seconds s', textAlign:TextAlign.center, style: TextStyle( + color: Colors.white, + fontSize: 26.sp, + )), + ), + ), + onTap: (){ + if(_seconds==60){ + // _setVerify(); + }else{ + // Toast.show(msg: '正在获取验证码'); + } + }, + ), + )), + SizedBox(height: 50.w), + SubmitBtn(btnName: "${TranslationLoader.lanKeys.reset.tr} ${TranslationLoader.lanKeys.password.tr}", fontSize: 30.sp, borderRadius: 20.w, padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + ], + ) + ); + } + + +} \ No newline at end of file diff --git a/star_lock/lib/login/login/starLock_login_page.dart b/star_lock/lib/login/login/starLock_login_page.dart new file mode 100644 index 00000000..985af277 --- /dev/null +++ b/star_lock/lib/login/login/starLock_login_page.dart @@ -0,0 +1,139 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../appRouters.dart'; +import '../../app_settings/app_colors.dart'; +import '../../tools/loginInput.dart'; +import '../../tools/submitBtn.dart'; +import '../../tools/titleAppBar.dart'; +import '../../translations/trans_lib.dart'; + +class StarLockLoginPage extends StatefulWidget { + const StarLockLoginPage({Key key}) : super(key: key); + + @override + State createState() => _StarLockLoginPageState(); +} + +class _StarLockLoginPageState extends State { + final TextEditingController _phoneController = TextEditingController(); + final TextEditingController _pwdController = TextEditingController(); + + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFFFFFFFF), + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.login.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text(TranslationLoader.lanKeys.register.tr, style: TextStyle(color: Colors.white),), + onPressed: (){ + Navigator.pushNamed(context, Routers.starLockRegisterPage); + },), + ],), + body:ListView( + padding: EdgeInsets.only( + top: 120.h, + left: 40.w, + right: 40.w + ), + children: [ + Container( + padding: EdgeInsets.all(10.w), + child: Center( + child: Image.asset('images/icon_main_1024.png', width: 150.w, height: 150.w) + ) + ), + SizedBox(height: 50.w), + LoginInput(controller: _phoneController, leftImg:'images/main/icon_main_search.png', hintText: TranslationLoader.lanKeys.pleaseEnterNumberOrEmail.tr, keyboardType: TextInputType.number,inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 50.w), + LoginInput(controller: _pwdController, isPwd: true, leftImg:'images/main/icon_main_search.png', hintText: "${TranslationLoader.lanKeys.pleaseEnter.tr} ${TranslationLoader.lanKeys.password.tr}",inputFormatters: [ + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 20.h), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20.h, + width: 26.w, + child: Checkbox(value: false, onChanged: (value){ + + }) + ), + SizedBox(width: 15.w,), + Flexible( + child: RichText( + text: TextSpan( + text: TranslationLoader.lanKeys.readAndAgree.tr, + style: TextStyle( + color: const Color(0xff333333), + fontSize: 26.sp + ), + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + child: Text('《${TranslationLoader.lanKeys.userAgreement.tr}》',style: TextStyle( + color: AppColors.mainColor, + fontSize: 26.sp + )), + onTap: (){ + + }, + ) + ), + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + child: Text('《${TranslationLoader.lanKeys.privacyPolicy.tr}》',style: TextStyle( + color: AppColors.mainColor, + fontSize: 26.sp + )), + onTap: (){ + + }, + ) + ), + ], + ) + ), + ) + ], + ), + SizedBox(height: 50.w), + SubmitBtn(btnName: TranslationLoader.lanKeys.login.tr, fontSize: 28.sp, borderRadius: 20.w, padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + SizedBox(height: 50.w), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + child: SizedBox( + // width: 150.w, + height: 50.h, + // color: Colors.red, + child: Center( + child: Text('${TranslationLoader.lanKeys.forgetPassword.tr}?',style: TextStyle(fontSize: 24.sp)), + ), + ), + onTap: (){ + Navigator.pushNamed(context, Routers.starLockForgetPasswordPage); + }, + ) + ], + ), + ], + ) + ); + } + + +} diff --git a/star_lock/lib/login/register/starLock_register_page.dart b/star_lock/lib/login/register/starLock_register_page.dart new file mode 100644 index 00000000..572c19a4 --- /dev/null +++ b/star_lock/lib/login/register/starLock_register_page.dart @@ -0,0 +1,209 @@ + +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../appRouters.dart'; +import '../../app_settings/app_colors.dart'; +import '../../tools/forgetPwdInput.dart'; +import '../../tools/loginInput.dart'; +import '../../tools/submitBtn.dart'; +import '../../tools/titleAppBar.dart'; +import '../../translations/trans_lib.dart'; + +class StarLockRegisterPage extends StatefulWidget { + const StarLockRegisterPage({Key key}) : super(key: key); + + @override + State createState() => _StarLockRegisterPageState(); +} + +class _StarLockRegisterPageState extends State { + final TextEditingController _phoneController = TextEditingController(); + final TextEditingController _pwdController = TextEditingController(); + final TextEditingController _codeController = TextEditingController(); + + Timer _timer; + + int _seconds = 60; + + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFFFFFFFF), + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.register.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:ListView( + padding: EdgeInsets.only( + top: 40.h, + left: 40.w, + right: 40.w + ), + children: [ + topSeletCountryAndRegionWidget (), + middleTFWidget (), + SubmitBtn(btnName: "${TranslationLoader.lanKeys.reset.tr} ${TranslationLoader.lanKeys.password.tr}", fontSize: 30.sp, borderRadius: 20.w, padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + ], + ) + ); + } + + Widget topSeletCountryAndRegionWidget (){ + return Column( + children: [ + SizedBox(height:50.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 420.w, + height: 60.h, + // color: Colors.red, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(30.h)), + border: const Border( + top: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + left: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + right: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + bottom: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + ) + ), + child: Row( + children: [ + GestureDetector( + onTap: (){ + + }, + child: Container( + width: 210.w, + height: 60.h, + // color: Colors.red, + decoration: BoxDecoration( + color: AppColors.mainColor, + borderRadius: BorderRadius.all(Radius.circular(30.h)), + border: const Border( + top: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + left: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + right: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + bottom: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + ) + ), + child: Center(child: Text(TranslationLoader.lanKeys.iphone.tr, style: TextStyle(color: Colors.white),)) + ), + ), + Expanded( + child: GestureDetector( + onTap: (){ + + }, + child: Container( + height: 60.h, + // color: Colors.red, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all(Radius.circular(30.h)), + // border: const Border( + // top: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + // left: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + // right: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + // bottom: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), + // ) + // ), + child: Center(child: Text(TranslationLoader.lanKeys.email.tr, style: const TextStyle(color: Colors.black),)) + ), + ), + ), + ], + ), + ), + + ], + ), + SizedBox(height:60.h), + GestureDetector( + onTap: (){ + Navigator.pushNamed(context, Routers.seletCountryRegionPage); + }, + child: Container( + height: 70.h, + // color: Colors.red, + // padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + child: Row( + children: [ + SizedBox(width:5.w), + Expanded(child: Text(TranslationLoader.lanKeys.countryAndRegion.tr, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w500))), + SizedBox(width:20.w), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text("中国+86", textAlign: TextAlign.end, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w500),) + ], + ), + SizedBox(width:5.w), + Image.asset('images/icon_right.png', width: 50.w, height: 50.w,), + ], + ), + ), + ), + Container(height: 0.5.h, color: Colors.grey,) + ], + ); + } + + Widget middleTFWidget (){ + return Column( + children: [ + LoginInput(controller: _phoneController, leftImg:'images/main/icon_main_search.png', hintText: TranslationLoader.lanKeys.pleaseEnterNumberOrEmail.tr, keyboardType: TextInputType.number,inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 10.w), + LoginInput(controller: _pwdController, isPwd: true, leftImg:'images/main/icon_main_search.png', hintText: "${TranslationLoader.lanKeys.pleaseEnter.tr} ${TranslationLoader.lanKeys.password.tr}",inputFormatters: [ + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 15.w), + Text(TranslationLoader.lanKeys.registerPasswordTip.tr, style: TextStyle(color: const Color(0xFF999999), fontSize: 26.sp),), + SizedBox(height: 10.w), + LoginInput(controller: _pwdController, isPwd: true, leftImg:'images/main/icon_main_search.png', hintText: "${TranslationLoader.lanKeys.sure.tr} ${TranslationLoader.lanKeys.password.tr}",inputFormatters: [ + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 10.w), + ForgetPwdInput(controller: _codeController,hintText: '${TranslationLoader.lanKeys.pleaseEnter.tr} ${TranslationLoader.lanKeys.verificationCode.tr}',keyboardType: TextInputType.number,inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(6), + ],rightSlot: Container( + // margin: EdgeInsets.only(right: 30.w), + child: GestureDetector( + child: Container( + width: 180.w, + height: 60.h, + padding: EdgeInsets.all(5.h), + decoration: BoxDecoration( + color: AppColors.mainColor, + borderRadius: BorderRadius.circular(5) + ), + child: Center( + child: Text(_seconds==60?'${TranslationLoader.lanKeys.getTip.tr} ${TranslationLoader.lanKeys.verificationCode.tr}': (_seconds<10)?'0$_seconds s':'$_seconds s',textAlign:TextAlign.center, style: TextStyle( + color: Colors.white, + fontSize: 26.sp + )), + ), + ), + onTap: (){ + if(_seconds==60){ + // _setVerify(); + }else{ + // Toast.show(msg: '正在获取验证码'); + } + }, + ), + )), + SizedBox(height: 50.w), + ], + ); + } +} diff --git a/star_lock/lib/login/seletCountryRegion/seletCountryRegion_page.dart b/star_lock/lib/login/seletCountryRegion/seletCountryRegion_page.dart new file mode 100644 index 00000000..0054b485 --- /dev/null +++ b/star_lock/lib/login/seletCountryRegion/seletCountryRegion_page.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../app_settings/app_colors.dart'; +import '../../tools/titleAppBar.dart'; +import '../../translations/trans_lib.dart'; + +class SeletCountryRegionPage extends StatefulWidget { + const SeletCountryRegionPage({Key key}) : super(key: key); + + @override + State createState() => _SeletCountryRegionPageState(); +} + +class _SeletCountryRegionPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFFFFFFFF), + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.selet.tr} ${TranslationLoader.lanKeys.countryAndRegion.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body:ListView( + padding: EdgeInsets.only(top: 40.h, left: 40.w, right: 40.w), + children: [ + + ], + ) + ); + } +} diff --git a/star_lock/lib/main.dart b/star_lock/lib/main.dart new file mode 100644 index 00000000..b0f37178 --- /dev/null +++ b/star_lock/lib/main.dart @@ -0,0 +1,136 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:get/get_core/src/get_main.dart'; +import 'package:star_lock/tools/app_manager.dart'; +import 'package:star_lock/tools/device_info_service.dart'; +import 'package:star_lock/tools/platform_info_services.dart'; +import 'package:star_lock/tools/store_service.dart'; +import 'package:star_lock/translations/app_dept.dart'; +import 'package:star_lock/translations/trans_lib.dart'; + +import 'appRouters.dart'; +import 'baseWidget.dart'; + +void main() async { + _setCommonServices(); + + // 设置国际化信息 + await _initTranslation(); + + runApp(MyApp()); +} + +class MyApp extends StatefulWidget { + const MyApp({GlobalKey key}):super(key: key); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { + + @override + Widget build(BuildContext context) { + return ScreenUtilInit( + designSize: const Size(750, 1334), + builder: (w, a) => _initMaterialApp()); + } + + GetMaterialApp _initMaterialApp() => GetMaterialApp( + title: 'Star Lock', + translations: TranslationMessage(), + supportedLocales: appDept.deptSupportedLocales, + localizationsDelegates: const [ + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], + localeResolutionCallback: (locale,supportedLocales){ + if(!supportedLocales.contains(locale)) { + int idx = appSupportedLocales.indexWhere((element) => element.languageCode == locale.languageCode); + if(idx != -1) { + locale = appSupportedLocales[idx]; + }else { + locale = const Locale('zh', 'CN'); + } + } + // print("localelocalelocalelocalelocale locale:${locale} locale.languageCode:${locale.languageCode} locale.countryCode:${locale.countryCode} supportedLocales:${supportedLocales}"); + AppManager().setLanCode(code: '${locale.languageCode}_${locale.countryCode}'); + return locale; + }, + // locale: StoreService.to.getLanguageCode().isNotEmpty ? appDept.deptSupportedLocales.where((element) => element.languageCode == StoreService.to.getLanguageCode()).first : Get.deviceLocale, + locale: Get.deviceLocale, + fallbackLocale: const Locale('zh', 'CN'), + theme: ThemeData( + scaffoldBackgroundColor: const Color(0xFFF6F6F6), + backgroundColor: const Color(0xFFF6F6F6), + primaryColor: const Color(0xFFFFFFFF), + textTheme: TextTheme( + //用在非Material组件上的文字显示, + bodyText1: TextStyle( + fontSize: 28.sp, color: const Color(0xff2E2B2B)), + //Material组件上的文字显示 + bodyText2: TextStyle( + fontSize: 28.sp, color: const Color(0xff2E2B2B)), + button: TextStyle(fontSize: 28.sp)), + iconTheme: + IconThemeData(size: 28.sp, color: const Color(0xff2E2B2B)), + appBarTheme: AppBarTheme( + backgroundColor: const Color(0xFFFFFFFF), + elevation: 0, + centerTitle: true, + iconTheme: + IconThemeData(color: const Color(0xff333333), size: 36.sp), + titleTextStyle: TextStyle( + color: const Color(0xff333333), + fontWeight: FontWeight.w400, + fontSize: 36.sp), + ), + splashColor: Colors.transparent, // 点击时的高亮效果设置为透明 + highlightColor: Colors.transparent, + ), + debugShowCheckedModeBanner: false, + getPages: AppRouters.routePages, + initialRoute: '/' + ); + + @override + void initState() { + super.initState(); + WidgetsBinding.instance?.addObserver(this); + } + + @override + void dispose() { + WidgetsBinding.instance?.removeObserver(this); + super.dispose(); + } + + void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.resumed) { + // 应用进入前台 + print("应用进入前台"); + } else if (state == AppLifecycleState.paused) { + // 应用进入后台 + print("应用进入后台"); + } + } + +} + +// 设置国际化信息 +Future _initTranslation() async => TranslationLoader.loadTranslation( + zhSource: "images/lan/lan_zh.json", + enSource: "images/lan/lan_en.json", + keySource: "images/lan/lan_keys.json", +); + +// 设置包名服务设备信息 +Future _setCommonServices() async { + await Get.putAsync(() => StoreService().init()); + await Get.putAsync(() => PlatformInfoService().init()); + await Get.putAsync(() => DeviceInfoService().init()); + Get.log(PlatformInfoService.to.info.version); +} diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart new file mode 100644 index 00000000..5d46c307 --- /dev/null +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart @@ -0,0 +1,32 @@ + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; +import 'authorizedAdminManage_tabbar.dart'; + +class AuthorizedAdminManagePage extends StatefulWidget { + const AuthorizedAdminManagePage({Key key}) : super(key: key); + + @override + State createState() => _AuthorizedAdminManagePageState(); +} + +class _AuthorizedAdminManagePageState extends State { + var index=0; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.authorizedAdmin.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + AuthorizedAdminManageTabbar(initialIndex: index,), + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_tabbar.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_tabbar.dart new file mode 100644 index 00000000..08394bd9 --- /dev/null +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_tabbar.dart @@ -0,0 +1,89 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/CustomUnderlineTabIndicator.dart'; +import '../../../../../translations/trans_lib.dart'; +import '../../../electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart'; +import '../authorizedAdmin_page.dart'; + +class AuthorizedAdminManageTabbar extends StatefulWidget { + var initialIndex=1; + + AuthorizedAdminManageTabbar({Key key, @required this.initialIndex}) : super(key: key); + + @override + State createState() => _AuthorizedAdminManageTabbarState(); +} + +class _AuthorizedAdminManageTabbarState extends State with SingleTickerProviderStateMixin { + TabController _tabController; + + final List _itemTabs= [ + ItemView(title: TranslationLoader.lanKeys.timeLimit.tr, type: "0"), + ItemView(title: TranslationLoader.lanKeys.permanent.tr, type: "1"), + ]; + + @override + void initState() { + // TODO: implement initState + super.initState(); + _tabController = TabController(vsync: this, length: _itemTabs.length,initialIndex: widget.initialIndex); + } + + @override + Widget build(BuildContext context) { + return Expanded( + child: Column( + children: [ + _tabBar(), + _pageWidget(), + ], + ) + ); + } + + TabBar _tabBar(){ + return TabBar( + controller: _tabController, + tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(), + isScrollable: true, + indicatorColor: Colors.red, + unselectedLabelColor: Colors.black, + unselectedLabelStyle: TextStyle(color:AppColors.mainColor,fontSize: 28.sp,), + automaticIndicatorColorAdjustment:true, + labelColor: AppColors.mainColor, + labelStyle: TextStyle(color: AppColors.mainColor,fontSize: 32.sp,fontWeight: FontWeight.w600), + indicator: CustomUnderlineTabIndicator(borderSide: BorderSide(color: AppColors.mainColor,width: 10.w),strokeCap: StrokeCap.round,width: 0.w), + ); + } + + Tab _tab(ItemView item) { + return Tab( + // text: item.title, + child: Container( + width: 1.sw/4, + margin: EdgeInsets.all(10.w), + // color: Colors.red, + child: Text(item.title, textAlign: TextAlign.center,), + ), + ); + } + + Widget _pageWidget(){ + return Expanded( + child: TabBarView( + controller: _tabController, + children: _itemTabs.map((ItemView item) => AuthorizedAdminPage(type: item.type,)).toList(), + ), + ); + } +} + +class ItemView { + const ItemView({@required this.title, @required this.type}); + + final String title; + final String type; +} diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart new file mode 100644 index 00000000..8e0d16d7 --- /dev/null +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart @@ -0,0 +1,242 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../translations/trans_lib.dart'; + +class AuthorizedAdminPage extends StatefulWidget { + final String type; + AuthorizedAdminPage({Key key, @required this.type}) : super(key: key); + + @override + State createState() => _AuthorizedAdminPageState(); +} + +class _AuthorizedAdminPageState extends State { + final FlutterContactPicker _contactPicker = FlutterContactPicker(); + Contact _contact; + + @override + Widget build(BuildContext context) { + return indexChangeWidget(); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + + } + + Widget indexChangeWidget(){ + switch (int.parse(widget.type)) { + case 0: + { + // 限时 + // return sendElectronicKeySucceed(); + return Column( + children: [ + keyInfoWidget(), + keyTimeWidget(), + keyRealNameWidget(), + keyBottomWidget(TranslationLoader.lanKeys.authorizedAdminTip.tr) + ], + ); + } + break; + case 1: + { + // 永久 + return Column( + children: [ + keyInfoWidget(), + keyRealNameWidget(), + keyBottomWidget(TranslationLoader.lanKeys.authorizedAdminTip.tr) + ], + ); + } + break; + default: + break; + } + } + + // 顶部钥匙信息widget + Widget keyInfoWidget(){ + return Column( + children: [ + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.receiver.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget(true, TranslationLoader.lanKeys.pleaseEnterNumberOrEmail.tr)), + CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: getTFWidget(false, TranslationLoader.lanKeys.pleaseEnter.tr)), + Container(height: 10.h), + ], + ); + } + + // 生效失效时间 + Widget keyTimeWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"2020.06.20 11:49", isHaveLine: true, isHaveDirection: true, action:(){ + // _showDatePicker(); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, action:(){ + // _showDatePicker(); + }), + Container(height: 10.h), + ], + ); + } + + // 实名认证 + Widget keyRealNameWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.realNameAuthentication.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch()), action:(){ + + }), + Container(height: 10.h), + ], + ); + } + + Widget keyBottomWidget(String tipStr){ + return Column( + children: [ + Container( + padding: EdgeInsets.all(20.w), + child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: Text(tipStr, textAlign: TextAlign.start,)), + ], + ), + ), + SubmitBtn(btnName: TranslationLoader.lanKeys.sender.tr, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + + } + ), + Container( + padding: EdgeInsets.only(right:30.w), + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton(onPressed: (){ + Navigator.pushNamed(context, Routers.volumeAuthorizationLockManagePage); + }, child: Text(TranslationLoader.lanKeys.volumeAuthorizationLock.tr, style: TextStyle(color: AppColors.mainColor, fontWeight: FontWeight.w500),)), + ], + ), + ), + ], + ); + } + + // 发送电子钥匙成功 + Widget sendElectronicKeySucceed(){ + return Column( + children: [ + Container( + height: 250.h, + width: 1.sw, + color: Colors.white, + child: Column( + children: [ + SizedBox(height: 30.h,), + Image.asset('images/main/icon_main_addLock.png', width: 150.w, height: 150.w, color: AppColors.mainColor,), + SizedBox(height: 20.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("发送成功",style: TextStyle(fontSize: 32.sp, color: Colors.black, fontWeight: FontWeight.w500),), + ], + ), + ], + ), + ), + SizedBox(height: 20.h,), + SubmitBtn(btnName: '完成', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + SubmitBtn(btnName: '邮件通知', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + Navigator.pushNamed(context, Routers.sendEmailNotificationPage); + }), + SubmitBtn(btnName: '微信通知', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + SubmitBtn(btnName: '标记为已入住', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + ], + ); + } + + // 接受者信息输入框 + Widget getTFWidget(bool isHaveBtn, String tfStr){ + return Container( + height: 50.h, + width: 500.w, + child: Row( + children: [ + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + textAlign:TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + SizedBox(width: 10.w,), + isHaveBtn?Container( + width: 50.w, + height: 50.w, + decoration: const BoxDecoration( + color: Colors.white, + image: DecorationImage( + image: AssetImage('images/icon_lock.png'), + fit: BoxFit.fill + ), + ), + alignment: Alignment.center, + child: InkWell( + onTap: () async { + Contact contact = await _contactPicker.selectContact(); + setState(() { + _contact = contact; + // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}"); + }); + }, + ), + ):Container() + ], + ), + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart new file mode 100644 index 00000000..bb170c8f --- /dev/null +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart @@ -0,0 +1,176 @@ + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class AuthorizedAdminDetailPage extends StatefulWidget { + const AuthorizedAdminDetailPage({Key key}) : super(key: key); + + @override + State createState() => _AuthorizedAdminDetailPageState(); +} + +class _AuthorizedAdminDetailPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.authorizedAdmin.tr}${TranslationLoader.lanKeys.detail.tr}", haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text(TranslationLoader.lanKeys.share.tr, style: TextStyle(color: Colors.white),), + onPressed: (){ + + },), + ],), + body: Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.password.tr, rightTitle:"98765432", isHaveDirection: true, isHaveLine: true, action:(){ + showCupertinoAlertDialog(context); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"你好", isHaveDirection: true, isHaveLine: true, action:(){ + showCupertinoAlertDialog(context); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"永久", isHaveDirection: true, action:(){ + Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate); + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.sender.tr, rightTitle:"15080825640", action:(){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.senderTime.tr, rightTitle:"2020.06.21 11:49", action:(){ + + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.operatingRecord.tr, rightTitle:"", isHaveDirection: true, action:(){ + + }), + Container(height: 40.h), + SubmitBtn( + btnName: TranslationLoader.lanKeys.delete.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + + } + ), + ], + ), + ); + } + + Widget commonItem(String leftTitle, String rightTitle, {bool isHaveDirection = false, bool isHaveLine = false, bool isHaveRightWidget = false, Widget rightWidget,Function action}){ + return GestureDetector( + onTap: action, + child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // height: 80.h, + color: Colors.white, + padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + child: Row( + children: [ + SizedBox(width:20.w), + Text(leftTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + SizedBox(width:20.w), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + isHaveRightWidget?rightWidget:Text(rightTitle, textAlign: TextAlign.end,style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),) + ], + ), + ), + SizedBox(width:5.w), + isHaveDirection?Image.asset('images/icon_right.png', width: 50.w, height: 50.w,):SizedBox(width:10.w), + // SizedBox(width:10.w), + ], + ), + ), + isHaveLine?Container(height: 0.5.h, color: Colors.grey,):Container() + ], + ), + ); + } + + void showCupertinoAlertDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return Card( + color: const Color(0x00FFFFFF), + child: CupertinoAlertDialog( + title: const Text("修改密码"), + content: Column( + children: [ + const SizedBox(height: 10,), + Container( + height: 80.h, + // color: Colors.white, + margin: EdgeInsets.all(10.w), + child: const TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + // contentPadding: const EdgeInsets.only( + // top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), + hintText: "请输入要修改的名字", + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + // icon: Padding( + // padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + // child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + // ), + // //右边图标设置 + // suffixIcon: GestureDetector( + // onTap: () { + // //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次 + // // SchedulerBinding.instance.addPostFrameCallback((_) { + // // _controller.text = ""; + // // }); + // }, + // child: Padding( + // padding: EdgeInsets.all(8), + // child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), + // ), + // ) + ), + ), + ) + ], + ), + actions: [ + CupertinoDialogAction( + child: const Text("取消"), + onPressed: () { + Navigator.pop(context); + // print("取消"); + }, + ), + CupertinoDialogAction( + child: const Text("确定"), + onPressed: () { + Navigator.pop(context); + // print("确定"); + }, + ), + ], + ), + ); + }); + } + +} diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart new file mode 100644 index 00000000..5f9c7f97 --- /dev/null +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart @@ -0,0 +1,133 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class AuthorizedAdminListPage extends StatefulWidget { + const AuthorizedAdminListPage({Key key}) : super(key: key); + + @override + State createState() => _AuthorizedAdminListPageState(); +} + +class _AuthorizedAdminListPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.authorizedAdmin.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text(TranslationLoader.lanKeys.reset.tr, style: TextStyle(color: Colors.white),), + onPressed: (){ + + },), + ],), + body: Column( + children: [ + _searchWidget(), + Expanded(child: _buildMainUI()), + SubmitBtn( + btnName: TranslationLoader.lanKeys.authorizedAdmin.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + Navigator.pushNamed(context, Routers.authorizedAdminManagePage); + } + ), + ], + ), + ); + } + + Widget _searchWidget(){ + return Container( + height: 80.h, + margin: EdgeInsets.only(top:20.w, left: 20.w, right: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5)), + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only( + top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), + hintText: TranslationLoader.lanKeys.pleaseEnter.tr, + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + icon: Padding( + padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + ), + ), + ), + ); + } + + Widget _buildMainUI(){ + return ListView.builder( + itemCount:10, + itemBuilder: (c, index){ + return _electronicKeyItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + Navigator.pushNamed(context, Routers.authorizedAdminDetailPage); + }); + } + ); + } + + Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 100.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10.w), + ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width: 30.w,), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + ], + ), + SizedBox(height:5.h), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("2023.6.21 11.15 永久", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLockManage/volumeAuthorizationLockManage_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLockManage/volumeAuthorizationLockManage_page.dart new file mode 100644 index 00000000..625033a0 --- /dev/null +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLockManage/volumeAuthorizationLockManage_page.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLockManage/volumeAuthorizationLockManage_tabbar.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class VolumeAuthorizationLockManagePage extends StatefulWidget { + const VolumeAuthorizationLockManagePage({Key key}):super(key:key); + + @override + State createState() => _VolumeAuthorizationLockManagePageState(); +} + +class _VolumeAuthorizationLockManagePageState extends State { + var index=0; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.add.tr} ${TranslationLoader.lanKeys.authorizedAdmin.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + VolumeAuthorizationLockManageTabbar(initialIndex: index,), + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLockManage/volumeAuthorizationLockManage_tabbar.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLockManage/volumeAuthorizationLockManage_tabbar.dart new file mode 100644 index 00000000..1dca45ca --- /dev/null +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLockManage/volumeAuthorizationLockManage_tabbar.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/CustomUnderlineTabIndicator.dart'; +import '../../../../../translations/trans_lib.dart'; +import '../volumeAuthorizationLock_page.dart'; + +class VolumeAuthorizationLockManageTabbar extends StatefulWidget { + var initialIndex=1; + + VolumeAuthorizationLockManageTabbar({Key key, @required this.initialIndex}) : super(key: key); + + @override + State createState() => _VolumeAuthorizationLockManageTabbarState(); +} + +class _VolumeAuthorizationLockManageTabbarState extends State with SingleTickerProviderStateMixin { + TabController _tabController; + + final List _itemTabs= [ + ItemView(title: TranslationLoader.lanKeys.permanent.tr, type: "0"), + ItemView(title: TranslationLoader.lanKeys.timeLimit.tr, type: "1"), + ]; + + @override + void initState() { + // TODO: implement initState + super.initState(); + _tabController = TabController(vsync: this, length: _itemTabs.length,initialIndex: widget.initialIndex); + } + + @override + Widget build(BuildContext context) { + return Expanded( + child: Column( + children: [ + _tabBar(), + _pageWidget(), + ], + ) + ); + } + + TabBar _tabBar(){ + return TabBar( + controller: _tabController, + tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(), + isScrollable: true, + indicatorColor: Colors.red, + unselectedLabelColor: Colors.black, + unselectedLabelStyle: TextStyle(color:AppColors.mainColor,fontSize: 28.sp,), + automaticIndicatorColorAdjustment:true, + labelColor: AppColors.mainColor, + labelStyle: TextStyle(color: AppColors.mainColor,fontSize: 32.sp,fontWeight: FontWeight.w600), + indicator: CustomUnderlineTabIndicator(borderSide: BorderSide(color: AppColors.mainColor,width: 10.w),strokeCap: StrokeCap.round,width: 0.w), + ); + } + + Tab _tab(ItemView item) { + return Tab( + // text: item.title, + child: Container( + width: 1.sw/4, + margin: EdgeInsets.all(10.w), + // color: Colors.red, + child: Text(item.title, textAlign: TextAlign.center,), + ), + ); + } + + Widget _pageWidget(){ + return Expanded( + child: TabBarView( + controller: _tabController, + children: _itemTabs.map((ItemView item) => VolumeAuthorizationLockPage(type: item.type,)).toList(), + ), + ); + } +} + +class ItemView { + const ItemView({@required this.title, @required this.type}); + + final String title; + final String type; +} diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart new file mode 100644 index 00000000..47ec6af3 --- /dev/null +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart @@ -0,0 +1,186 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../translations/trans_lib.dart'; + +class VolumeAuthorizationLockPage extends StatefulWidget { + final String type; + + const VolumeAuthorizationLockPage({Key key, @required this.type}):super(key:key); + + @override + State createState() => _VolumeAuthorizationLockPageState(); +} + +class _VolumeAuthorizationLockPageState extends State { + final FlutterContactPicker _contactPicker = FlutterContactPicker(); + Contact _contact; + + @override + Widget build(BuildContext context) { + return indexChangeWidget(); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + + } + + Widget indexChangeWidget(){ + switch (int.parse(widget.type)) { + case 0: + { + // 永久 + return Column( + children: [ + keyInfoWidget(), + remoteUnlockingWidget(), + keyBottomWidget() + ], + ); + } + break; + case 1: + { + // 限时 + return Column( + children: [ + keyInfoWidget(), + keyTimeWidget(), + remoteUnlockingWidget(), + keyBottomWidget() + ], + ); + } + break; + default: + break; + } + } + + // 顶部钥匙信息widget + Widget keyInfoWidget(){ + return Column( + children: [ + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.number.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget(true, TranslationLoader.lanKeys.pleaseEnterNumberOrEmail.tr)), + CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: getTFWidget(false, TranslationLoader.lanKeys.pleaseEnter.tr)), + Container(height: 10.h), + ], + ); + } + + // 生效失效时间 + Widget keyTimeWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"2020.06.20 11:49", isHaveLine: true), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"2020.06.20 11:49", ), + Container(height: 10.h), + ], + ); + } + + // 远程开锁 + Widget remoteUnlockingWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.lock.tr, rightTitle:TranslationLoader.lanKeys.pleaseSelet.tr, isHaveDirection: true, action: (){ + + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.remoteUnlockingAllowed.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch()), action:(){ + + }), + Container(height: 10.h), + ], + ); + } + + Widget keyBottomWidget(){ + return Column( + children: [ + SubmitBtn( + btnName: TranslationLoader.lanKeys.sure.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + // Navigator.pushNamed(context, Routers.nearbyLockPage); + } + ), + ], + ); + } + + // 接受者信息输入框 + Widget getTFWidget(bool isHaveBtn, String tfStr){ + return Container( + height: 50.h, + width: 500.w, + child: Row( + children: [ + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + textAlign:TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + SizedBox(width: 10.w,), + isHaveBtn?Container( + width: 50.w, + height: 50.w, + decoration: const BoxDecoration( + color: Colors.white, + image: DecorationImage( + image: AssetImage('images/icon_lock.png'), + fit: BoxFit.fill + ), + ), + alignment: Alignment.center, + child: InkWell( + onTap: () async { + Contact contact = await _contactPicker.selectContact(); + setState(() { + _contact = contact; + // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}"); + }); + }, + ), + ):Container() + ], + ), + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart new file mode 100644 index 00000000..7db1eb95 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart @@ -0,0 +1,191 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class ElectronicKeyDetailPage extends StatefulWidget { + const ElectronicKeyDetailPage({Key key}) : super(key: key); + + @override + State createState() => _ElectronicKeyDetailPageState(); +} + +class _ElectronicKeyDetailPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.keyDetail.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"魏", isHaveDirection: true, isHaveLine: true, action:(){ + showCupertinoAlertDialog(context); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, allHeight: 90.h,rightTitle:"2020.06.20 11:49\n2020.06.21 11:49", isHaveDirection: true, action:(){ + Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate); + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.receiver.tr, rightTitle:"786612630@qq.com",action:(){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.sender.tr, rightTitle:"15080825640", action:(){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.senderTime.tr, rightTitle:"2020.06.21 11:49", action:(){ + + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.realNameAuthentication.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w,child: _switch()), action:(){ + + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.operatingRecord.tr, rightTitle:"", isHaveDirection: true, action:(){ + + }), + Container(height: 40.h), + SubmitBtn( + btnName: TranslationLoader.lanKeys.delete, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + + } + ), + ], + ), + ); + } + + Widget commonItem(String leftTitle, String rightTitle, {bool isHaveDirection = false, bool isHaveLine = false, bool isHaveRightWidget = false, Widget rightWidget,Function action}){ + return GestureDetector( + onTap: action, + child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // height: 80.h, + color: Colors.white, + padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + child: Row( + children: [ + SizedBox(width:20.w), + Text(leftTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + SizedBox(width:20.w), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + isHaveRightWidget?rightWidget:Text(rightTitle, textAlign: TextAlign.end,style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),) + ], + ), + ), + SizedBox(width:5.w), + isHaveDirection?Image.asset('images/icon_right.png', width: 50.w, height: 50.w,):SizedBox(width:10.w), + // SizedBox(width:10.w), + ], + ), + ), + isHaveLine?Container(height: 0.5.h, color: Colors.grey,):Container() + ], + ), + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } + + void showCupertinoAlertDialog(BuildContext context) { + + showDialog( + context: context, + builder: (BuildContext context) { + return Card( + color: const Color(0x00FFFFFF), + child: CupertinoAlertDialog( + title: const Text("修改密码"), + content: Column( + children: [ + const SizedBox(height: 10,), + Container( + height: 50.h, + // color: Colors.white, + // padding: EdgeInsets.only(left:20.w, right: 110.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15.w) + ), + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: EdgeInsets.only(top: 20.h, left: 15.0, bottom: 13.h), + hintText: "请输入要修改的名字", + hintStyle:TextStyle(fontSize: 28.sp), + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + // icon: Padding( + // padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + // child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + // ), + // //右边图标设置 + // suffixIcon: GestureDetector( + // onTap: () { + // //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次 + // // SchedulerBinding.instance.addPostFrameCallback((_) { + // // _controller.text = ""; + // // }); + // }, + // child: Padding( + // padding: EdgeInsets.all(8), + // child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), + // ), + // ) + ), + ), + ) + ], + ), + actions: [ + CupertinoDialogAction( + child: Text("取消"), + onPressed: () { + Navigator.pop(context); + print("取消"); + }, + ), + CupertinoDialogAction( + child: Text("确定"), + onPressed: () { + Navigator.pop(context); + print("确定"); + }, + ), + ], + ), + ); + }); + } + +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart new file mode 100644 index 00000000..7bcfcd49 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart @@ -0,0 +1,107 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class ElectronicKeyDetailChangeDate extends StatefulWidget { + const ElectronicKeyDetailChangeDate({Key key}) : super(key: key); + + @override + State createState() => _ElectronicKeyDetailChangeDateState(); +} + +class _ElectronicKeyDetailChangeDateState extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.amend.tr} ${TranslationLoader.lanKeys.periodValidity.tr}", haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton(child: Text(TranslationLoader.lanKeys.sure.tr, style: const TextStyle(color: Colors.white),), onPressed: (){ + + },), + ],), + body: buildMainUI(), + ); + } + + Widget buildMainUI(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, isHaveLine: true, action:(){ + _showDatePicker(); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, action:(){ + _showDatePicker(); + }), + ], + ); + } + + void _showDatePicker() { + String MIN_DATETIME = '1900-01-01 00:00'; + String MAX_DATETIME = '2100-01-01 00:00'; + String INIT_DATETIME = getNowDate(); + DateTime _dateTime = DateTime.parse(INIT_DATETIME); + DateTimePickerLocale _locale = DateTimePickerLocale.zh_cn; + String _format = 'yyyy-MMMM-dd HH:mm'; + + DatePicker.showDatePicker( + context, + onMonthChangeStartWithFirstDate: true, + pickerTheme:const DateTimePickerTheme( + cancel: Text('取消', style: TextStyle(color: Colors.black)), + showTitle: true, + confirm: Text('确认', style: TextStyle(color: Colors.black)), + ), + minDateTime: DateTime.parse(MIN_DATETIME), + maxDateTime: DateTime.parse(MAX_DATETIME), + initialDateTime: _dateTime, + dateFormat: _format, + locale: _locale, + onClose: () { + + }, + onCancel: () { + + }, + onChange: (dateTime, List index) { + setState(() { + _dateTime = dateTime; + }); + }, + onConfirm: (dateTime, List index) { + setState(() { + _dateTime = dateTime; + }); + }, + ); + } + + String getNowDate(){ + // 获取当前时间对象 + DateTime today = DateTime.now(); + String dateSlug ="${today.year.toString()}-${today.month.toString().padLeft(2,'0')}-${today.day.toString().padLeft(2,'0')} ${today.hour.toString().padLeft(2,'0')}:${today.minute.toString().padLeft(2,'0')}"; + + // //获取当前时间的年 + // int year = now.year; + // //获取当前时间的月 + // int month = now.month; + // //获取当前时间的日 + // int day = now.day; + // //获取当前时间的时 + // int hour = now.hour; + // //获取当前时间的分 + // int minute = now.minute; + // //获取当前时间的秒 + // int millisecond = now.millisecond; + + // print("组合 $year-$month-$day $hour:$minute:$millisecond"); + return dateSlug; + } +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart new file mode 100644 index 00000000..5314256b --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart @@ -0,0 +1,137 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class ElectronicKeyListPage extends StatefulWidget { + const ElectronicKeyListPage({Key key}) : super(key: key); + + @override + State createState() => _ElectronicKeyListPageState(); +} + +class _ElectronicKeyListPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.electronicKey.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text(TranslationLoader.lanKeys.reset.tr, style: const TextStyle(color: Colors.white),), + onPressed: (){ + + },), + ],), + body: Column( + children: [ + _searchWidget(), + Expanded(child: _buildMainUI()), + SubmitBtn( + btnName: TranslationLoader.lanKeys.sendKey.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + Navigator.pushNamed(context, Routers.sendElectronicKeyManagePage); + } + ), + ], + ), + ); + } + + Widget _searchWidget(){ + return Container( + height: 80.h, + margin: EdgeInsets.only(top:20.w, left: 20.w, right: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5)), + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only( + top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), + hintText: TranslationLoader.lanKeys.pleaseEnter.tr, + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + icon: Padding( + padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + ), + ), + ), + ); + } + + Widget _buildMainUI(){ + return ListView.builder( + itemCount:10, + itemBuilder: (c, index){ + return _electronicKeyItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + Navigator.pushNamed(context, Routers.electronicKeyDetailPage); + }); + } + ); + } + + Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 100.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10.w), + ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width: 30.w,), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + SizedBox(width:20.w), + Text("待接收", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.w), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("2023.6.21 11.15-2023.6.21 11.15", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart new file mode 100644 index 00000000..2b37b35d --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart @@ -0,0 +1,140 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class ElectronicKeyPeriodValidityPage extends StatefulWidget { + const ElectronicKeyPeriodValidityPage({Key key}) : super(key: key); + + @override + State createState() => _ElectronicKeyPeriodValidityPageState(); +} + +class _ElectronicKeyPeriodValidityPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.periodValidity.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + topWidget(), + SizedBox(height: 10.h,), + bottomWidget() + ], + ) + ); + } + + Widget topWidget(){ + return Container( + height: 150.h, + width: 1.sw, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 60.h, + // color: Colors.red, + padding: EdgeInsets.only(left:15.h, top: 15.h), + child: Text(TranslationLoader.lanKeys.periodValidity.tr, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w600)) + ), + Container( + height: 90.h, + child: GridView.builder( + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 7, + childAspectRatio: 1.0 + ), + itemCount: 7, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context,index){ + return btnItem(index); + }) + ) + ], + ), + ); + } + + Widget btnItem(int index){ + String dateStr; + switch (index) { + case 0: + dateStr = TranslationLoader.lanKeys.Sunday.tr; + break; + case 1: + dateStr = TranslationLoader.lanKeys.Monday.tr; + break; + case 2: + dateStr = TranslationLoader.lanKeys.Tuesday.tr; + break; + case 3: + dateStr = TranslationLoader.lanKeys.Wednesday.tr; + break; + case 4: + dateStr = TranslationLoader.lanKeys.Thursday.tr; + break; + case 5: + dateStr = TranslationLoader.lanKeys.Friday.tr; + break; + case 6: + dateStr = TranslationLoader.lanKeys.Saturday.tr; + break; + default: + break; + } + return GestureDetector( + onTap: (){ + + }, + child: Container( + width: 70.h, + height: 70.h, + margin: EdgeInsets.all(10.h), + decoration: BoxDecoration( + // color: Colors.blue, + border: Border.all(width: 1, color: Colors.grey), + borderRadius: BorderRadius.circular(60.w), + ), + child: Center(child: Text(dateStr)), + ), + ); + } + + Widget bottomWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"", isHaveDirection: true, isHaveLine: true, action:(){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"", isHaveDirection: true, action:(){ + + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveDate.tr, rightTitle:"", isHaveDirection: true, isHaveLine: true, action:(){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureDate.tr, rightTitle:"", isHaveDirection: true, action:(){ + + }), + Container(height: 40.h), + SubmitBtn( + btnName: TranslationLoader.lanKeys.sure.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + // Navigator.pushNamed(context, Routers.nearbyLockPage); + } + ), + ], + ); + } +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey_page.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey_page.dart new file mode 100644 index 00000000..5ec0d561 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey_page.dart @@ -0,0 +1,162 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart'; + +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../appRouters.dart'; +import '../../../../translations/trans_lib.dart'; + +class MassSendElectronicKeyPage extends StatefulWidget { + final String type; + + const MassSendElectronicKeyPage({Key key, @required this.type}) : super(key: key); + + @override + State createState() => _MassSendElectronicKeyPageState(); +} + +class _MassSendElectronicKeyPageState extends State { + final FlutterContactPicker _contactPicker = FlutterContactPicker(); + Contact _contact; + + @override + Widget build(BuildContext context) { + return indexChangeWidget(); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + + } + + Widget indexChangeWidget(){ + switch (int.parse(widget.type)) { + case 0: + { + // 限时 + return Column( + children: [ + keyInfoWidget(), + keyTimeWidget(), + remoteUnlockingWidget(), + keyBottomWidget() + ], + ); + } + break; + case 1: + { + // 永久 + return Column( + children: [ + keyInfoWidget(), + remoteUnlockingWidget(), + keyBottomWidget() + ], + ); + } + break; + case 2: + { + // 单次 + return Column( + children: [ + keyInfoWidget(), + periodValidityWidget(), + remoteUnlockingWidget(), + keyBottomWidget() + ], + ); + } + break; + default: + break; + } + } + + // 顶部钥匙信息widget + Widget keyInfoWidget(){ + return Column( + children: [ + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.receiver.tr, rightTitle:TranslationLoader.lanKeys.pleaseAdd.tr, isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.lock.tr, rightTitle:TranslationLoader.lanKeys.pleaseSelet.tr, isHaveDirection: true, action: (){ + + }), + Container(height: 10.h), + ], + ); + } + + // 生效失效时间 + Widget keyTimeWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"2020.06.20 11:49", isHaveLine: true), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"2020.06.20 11:49", ), + Container(height: 10.h), + ], + ); + } + + // 远程开锁 + Widget remoteUnlockingWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.remoteUnlockingAllowed.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch()), action:(){ + + }), + Container(height: 10.h), + ], + ); + } + + // 有效期 + Widget periodValidityWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.periodValidity.tr, rightTitle:"", isHaveDirection: true, action:(){ + Navigator.pushNamed(context, Routers.electronicKeyPeriodValidityPage); + }), + Container(height: 10.h), + ], + ); + } + + Widget keyBottomWidget(){ + return Column( + children: [ + SubmitBtn( + btnName: TranslationLoader.lanKeys.send.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + // Navigator.pushNamed(context, Routers.nearbyLockPage); + } + ), + ], + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart new file mode 100644 index 00000000..e69fcc33 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; +import 'massSendElectronicKeyManage_tabbar.dart'; + +class MassSendElectronicKeyManagePage extends StatefulWidget { + const MassSendElectronicKeyManagePage({Key key}) : super(key: key); + + @override + State createState() => _MassSendElectronicKeyManagePageState(); +} + +class _MassSendElectronicKeyManagePageState extends State { + var index=0; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.sendGroupKey.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + MassSendElectronicKeyManageTabbar(initialIndex: index,), + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_tabbar.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_tabbar.dart new file mode 100644 index 00000000..34488c75 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_tabbar.dart @@ -0,0 +1,89 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/CustomUnderlineTabIndicator.dart'; +import '../../../../../translations/trans_lib.dart'; +import '../massSendElectronicKey_page.dart'; + +class MassSendElectronicKeyManageTabbar extends StatefulWidget { + var initialIndex=1; + + MassSendElectronicKeyManageTabbar({Key key, @required this.initialIndex}) : super(key: key); + + @override + State createState() => _MassSendElectronicKeyManageTabbarState(); +} + +class _MassSendElectronicKeyManageTabbarState extends State with SingleTickerProviderStateMixin { + TabController _tabController; + + final List _itemTabs = [ + ItemView(title: TranslationLoader.lanKeys.timeLimit.tr, type: "0"), + ItemView(title: TranslationLoader.lanKeys.permanent.tr, type: "1"), + ItemView(title: TranslationLoader.lanKeys.circulation.tr, type: "2"), + ]; + + @override + void initState() { + // TODO: implement initState + super.initState(); + _tabController = TabController(vsync: this, length: _itemTabs.length,initialIndex: widget.initialIndex); + } + + @override + Widget build(BuildContext context) { + return Expanded( + child: Column( + children: [ + _tabBar(), + _pageWidget(), + ], + ) + ); + } + + TabBar _tabBar(){ + return TabBar( + controller: _tabController, + tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(), + isScrollable: true, + indicatorColor: Colors.red, + unselectedLabelColor: Colors.black, + unselectedLabelStyle: TextStyle(color:AppColors.mainColor,fontSize: 28.sp,), + automaticIndicatorColorAdjustment:true, + labelColor: AppColors.mainColor, + labelStyle: TextStyle(color: AppColors.mainColor,fontSize: 32.sp,fontWeight: FontWeight.w600), + indicator: CustomUnderlineTabIndicator(borderSide: BorderSide(color: AppColors.mainColor,width: 10.w),strokeCap: StrokeCap.round,width: 0.w), + ); + } + + Tab _tab(ItemView item) { + return Tab( + // text: item.title, + child: Container( + width: 1.sw/8, + margin: EdgeInsets.all(10.w), + // color: Colors.red, + child: Text(item.title, textAlign: TextAlign.center,), + ), + ); + } + + Widget _pageWidget(){ + return Expanded( + child: TabBarView( + controller: _tabController, + children: _itemTabs.map((ItemView item) => MassSendElectronicKeyPage(type: item.type,)).toList(), + ), + ); + } +} + +class ItemView { + const ItemView({@required this.title, @required this.type}); + + final String title; + final String type; +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart new file mode 100644 index 00000000..f960f527 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart @@ -0,0 +1,280 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../translations/trans_lib.dart'; + +class SendElectronicKeyPage extends StatefulWidget { + final String type; + + SendElectronicKeyPage({Key key, @required this.type}) : super(key: key); + + @override + State createState() => _SendElectronicKeyPageState(); +} + +class _SendElectronicKeyPageState extends State { + final FlutterContactPicker _contactPicker = FlutterContactPicker(); + Contact _contact; + + @override + Widget build(BuildContext context) { + return indexChangeWidget(); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + + } + + Widget indexChangeWidget(){ + switch (int.parse(widget.type)) { + case 0: + { + // 限时 + // return sendElectronicKeySucceed(); + return Column( + children: [ + keyInfoWidget(), + keyTimeWidget(), + keyRealNameWidget(), + keyBottomWidget() + ], + ); + } + break; + case 1: + { + // 永久 + return Column( + children: [ + keyInfoWidget(), + keyRealNameWidget(), + keyBottomWidget() + ], + ); + } + break; + case 2: + { + // 单次 + return Column( + children: [ + keyInfoWidget(), + keyRealNameWidget(), + keyBottomWidget() + ], + ); + } + break; + case 3: + { + // 循环 + return Column( + children: [ + keyInfoWidget(), + keyRealNameWidget(), + keyPeriodValidityWidget(), + keyBottomWidget() + ], + ); + } + break; + default: + break; + } + } + + // 顶部钥匙信息widget + Widget keyInfoWidget(){ + return Column( + children: [ + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.receiver.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget(true, TranslationLoader.lanKeys.pleaseEnterNumberOrEmail.tr)), + CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: getTFWidget(false, TranslationLoader.lanKeys.enterYourName.tr)), + Container(height: 10.h), + ], + ); + } + + // 生效失效时间 + Widget keyTimeWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"2020.06.20 11:49", isHaveLine: true, isHaveDirection: true, action:(){ + // _showDatePicker(); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, action:(){ + // _showDatePicker(); + }), + Container(height: 10.h), + ], + ); + } + + // 实名认证 + Widget keyRealNameWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.realNameAuthentication.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch()), action:(){ + + }), + Container(height: 10.h), + ], + ); + } + + // 有效期 + Widget keyPeriodValidityWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.periodValidity.tr, rightTitle:"", isHaveDirection: true, action:(){ + Navigator.pushNamed(context, Routers.electronicKeyPeriodValidityPage); + }), + ], + ); + } + + Widget keyBottomWidget(){ + return Column( + children: [ + Container( + padding: EdgeInsets.all(20.w), + child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.sendKeyBottomTip.tr, textAlign: TextAlign.start,)), + ], + ), + ), + SubmitBtn(btnName: TranslationLoader.lanKeys.send.tr, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + + } + ), + Container( + padding: EdgeInsets.only(right:30.w), + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton(onPressed: (){ + Navigator.pushNamed(context, Routers.massSendElectronicKeyManagePage); + }, child: Text(TranslationLoader.lanKeys.sendGroupKey.tr, style: TextStyle(color: AppColors.mainColor, fontWeight: FontWeight.w500),)), + ], + ), + ), + ], + ); + } + + // 发送电子钥匙成功 + Widget sendElectronicKeySucceed(){ + return Column( + children: [ + Container( + height: 250.h, + width: 1.sw, + color: Colors.white, + child: Column( + children: [ + SizedBox(height: 30.h,), + Image.asset('images/main/icon_main_addLock.png', width: 150.w, height: 150.w, color: AppColors.mainColor,), + SizedBox(height: 20.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("发送成功",style: TextStyle(fontSize: 32.sp, color: Colors.black, fontWeight: FontWeight.w500),), + ], + ), + ], + ), + ), + SizedBox(height: 20.h,), + SubmitBtn(btnName: '完成', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + SubmitBtn(btnName: '邮件通知', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + Navigator.pushNamed(context, Routers.sendEmailNotificationPage); + }), + SubmitBtn(btnName: '微信通知', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + SubmitBtn(btnName: '标记为已入住', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + ], + ); + } + + // 接受者信息输入框 + Widget getTFWidget(bool isHaveBtn, String tfStr){ + return Container( + height: 50.h, + width: 500.w, + child: Row( + children: [ + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + textAlign:TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + SizedBox(width: 10.w,), + isHaveBtn?Container( + width: 50.w, + height: 50.w, + decoration: const BoxDecoration( + color: Colors.white, + image: DecorationImage( + image: AssetImage('images/icon_lock.png'), + fit: BoxFit.fill + ), + ), + alignment: Alignment.center, + child: InkWell( + onTap: () async { + Contact contact = await _contactPicker.selectContact(); + setState(() { + _contact = contact; + // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}"); + }); + }, + ), + ):Container() + ], + ), + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_page.dart b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_page.dart new file mode 100644 index 00000000..8a924585 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_page.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; +import 'sendElectronicKeyManage_tabbar.dart'; + +class SendElectronicKeyManagePage extends StatefulWidget { + const SendElectronicKeyManagePage({Key key}) : super(key: key); + + @override + State createState() => _SendElectronicKeyManagePageState(); +} + +class _SendElectronicKeyManagePageState extends State { + var index=0; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.sendKey.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + SendElectronicKeyManageTabbar(initialIndex: index,), + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_tabbar.dart b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_tabbar.dart new file mode 100644 index 00000000..68a96392 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_tabbar.dart @@ -0,0 +1,90 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/CustomUnderlineTabIndicator.dart'; +import '../../../../../translations/trans_lib.dart'; +import '../sendElectronicKey/sendElectronicKey_page.dart'; + +class SendElectronicKeyManageTabbar extends StatefulWidget { + var initialIndex=1; + + SendElectronicKeyManageTabbar({Key key, @required this.initialIndex}) : super(key: key); + + @override + State createState() => _SendElectronicKeyManageTabbarState(); +} + +class _SendElectronicKeyManageTabbarState extends State with SingleTickerProviderStateMixin { + TabController _tabController; + + final List _itemTabs = [ + ItemView(title: TranslationLoader.lanKeys.timeLimit.tr, type: "0"), + ItemView(title: TranslationLoader.lanKeys.permanent.tr, type: "1"), + ItemView(title: TranslationLoader.lanKeys.once.tr, type: "2"), + ItemView(title: TranslationLoader.lanKeys.circulation.tr, type: "3"), + ]; + + @override + void initState() { + // TODO: implement initState + super.initState(); + _tabController = TabController(vsync: this, length: _itemTabs.length,initialIndex: widget.initialIndex); + } + + @override + Widget build(BuildContext context) { + return Expanded( + child: Column( + children: [ + _tabBar(), + _pageWidget(), + ], + ) + ); + } + + TabBar _tabBar(){ + return TabBar( + controller: _tabController, + tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(), + isScrollable: true, + indicatorColor: Colors.red, + unselectedLabelColor: Colors.black, + unselectedLabelStyle: TextStyle(color:AppColors.mainColor,fontSize: 28.sp,), + automaticIndicatorColorAdjustment:true, + labelColor: AppColors.mainColor, + labelStyle: TextStyle(color: AppColors.mainColor,fontSize: 32.sp,fontWeight: FontWeight.w600), + indicator: CustomUnderlineTabIndicator(borderSide: BorderSide(color: AppColors.mainColor,width: 10.w),strokeCap: StrokeCap.round,width: 0.w), + ); + } + + Tab _tab(ItemView item) { + return Tab( + // text: item.title, + child: Container( + width: 1.sw/8, + margin: EdgeInsets.all(10.w), + // color: Colors.red, + child: Text(item.title, textAlign: TextAlign.center,), + ), + ); + } + + Widget _pageWidget(){ + return Expanded( + child: TabBarView( + controller: _tabController, + children: _itemTabs.map((ItemView item) => SendElectronicKeyPage(type: item.type,)).toList(), + ), + ); + } +} + +class ItemView { + const ItemView({@required this.title, @required this.type}); + + final String title; + final String type; +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart b/star_lock/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart new file mode 100644 index 00000000..d7b67bba --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart @@ -0,0 +1,76 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; + +class SendEmailNotificationPage extends StatefulWidget { + const SendEmailNotificationPage({Key key}) : super(key: key); + + @override + State createState() => _SendEmailNotificationPageState(); +} + +class _SendEmailNotificationPageState extends State { + final TextEditingController _emailController = TextEditingController(); + + @override + Widget build(BuildContext context) { + _emailController.text = "请爱的用户 \n\n你收到电子钥匙,请试用APP(www.baidu.com)或小程序开锁 \n\n星锁"; + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "邮件通知", haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + CommonItem(leftTitel:"接收者", rightTitle:"786612630@qq.com", isHaveLine: true,), + CommonItem(leftTitel:"类型", rightTitle:"个人邮件", isHaveDirection: true,), + Container(height: 10.h), + CommonItem(leftTitel:"模板", rightTitle:"默认模板", isHaveDirection: true, isHaveLine:true), + Container( + height: 360.h, + color: Colors.white, + padding: EdgeInsets.only(left:20.w, right: 20.w, top: 20.h), + child:TextField( + maxLines:8, + maxLength:1000, + textAlign: TextAlign.start, + controller: _emailController, + style: TextStyle(color: Colors.black,fontSize: 28.sp,), + decoration: InputDecoration( + border: OutlineInputBorder( + ///设置边框四个角的弧度 + borderRadius: BorderRadius.all(Radius.circular(20.h)), + ///用来配置边框的样式 + borderSide: const BorderSide( + ///设置边框的颜色 + color: Color(0xffB2B2B2), + ///设置边框的粗细 + width: 0.5, + ), + ), + ///用来配置输入框获取焦点时的颜色 + focusedBorder: OutlineInputBorder( + ///设置边框四个角的弧度 + borderRadius: BorderRadius.all(Radius.circular(20.h)), + ///用来配置边框的样式 + borderSide: const BorderSide( + ///设置边框的颜色 + color: Color(0xffB2B2B2), + ///设置边框的粗细 + width: 1, + ), + ), + ), + ), + ), + Container(height: 40.h), + SubmitBtn(btnName: '发送', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart new file mode 100644 index 00000000..4f7dd08f --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart @@ -0,0 +1,113 @@ + +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/showBottomSheetTool.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class AutomaticBlockingPage extends StatefulWidget { + const AutomaticBlockingPage({Key key}) : super(key: key); + + @override + State createState() => _AutomaticBlockingPageState(); +} + +class _AutomaticBlockingPageState extends State { + final TextEditingController _timeController = TextEditingController(); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.automaticBlocking.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:ListView( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.automaticBlocking.tr, rightTitle:"", isHaveLine: false, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), + Container(height: 10.h,), + Builder( + builder: (context) { + return CommonItem(leftTitel:TranslationLoader.lanKeys.delayTime.tr, rightTitle:"5s", isHaveLine: false, isHaveDirection: true, action: (){ + var list = ["5S", "10S", "15S", "30S", "60S", TranslationLoader.lanKeys.custom.tr]; + ShowBottomSheetTool().showSingleRowPicker( + //上下文 + context, + //默认的索引 + normalIndex: 2, + title: TranslationLoader.lanKeys.time.tr, + cancelTitle: TranslationLoader.lanKeys.cancel.tr, + sureTitle: TranslationLoader.lanKeys.sure.tr, + //要显示的列表 + //可自定义数据适配器 + //adapter: PickerAdapter(), + data: list, + //选择事件的回调 + clickCallBack: (int index, var str) { + + }); + }); + } + ), + Container(height: 10.h,), + Visibility( + visible: true, + child: Container( + color: Colors.white, + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + Row( + children: [Text("${TranslationLoader.lanKeys.pleaseEnter.tr}${TranslationLoader.lanKeys.time.tr}(S)"),], + ), + TextField( + //输入框一行 + maxLines: 1, + controller: _timeController, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only( + top: 12.0, bottom: 8.0), + hintText: "${TranslationLoader.lanKeys.pleaseEnter.tr}${TranslationLoader.lanKeys.time.tr}(S)", + hintStyle: TextStyle(fontSize: 30.sp), + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + Container(height: 0.5.h, color: Colors.grey,), + ], + ), + ) + ), + Container( + padding: EdgeInsets.all(30.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.automaticBlockingTip.tr)), + ], + ), + ) + ], + ) + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart new file mode 100644 index 00000000..9048d5f3 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart @@ -0,0 +1,59 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class AdminOpenLockPasswordPage extends StatefulWidget { + const AdminOpenLockPasswordPage({Key key}) : super(key: key); + + @override + State createState() => _AdminOpenLockPasswordPageState(); +} + +class _AdminOpenLockPasswordPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.adminOpenLockPassword.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.password.tr, rightTitle:"189934", isHaveLine: false, isHaveDirection: true, action: (){ + + }), + Container( + margin: EdgeInsets.all(30.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.adminOpenLockPasswordTip.tr)), + ], + ), + SizedBox(height:10.h,), + GestureDetector( + onTap: (){ + + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.updateLockAdminPassword.tr, style: TextStyle(color: AppColors.mainColor),)), + ], + ), + ), + ], + ), + ), + + ], + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart new file mode 100644 index 00000000..623ddfc7 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart @@ -0,0 +1,55 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class BasicInformationPage extends StatefulWidget { + const BasicInformationPage({Key key}) : super(key: key); + + @override + State createState() => _BasicInformationPageState(); +} + +class _BasicInformationPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.basicInformation.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Column( + children: [ + Expanded( + child: ListView( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.lockNumber.tr, rightTitle:"MCBN0c_8f3106", allHeight:70.h, isHaveLine: false), + CommonItem(leftTitel:"MAC/ID", rightTitle:"53:66:9F:06:31:8F/9418481", allHeight:70.h, isHaveLine: false), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.electricQuantity.tr, rightTitle:"100%", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.uploadElectricQuantityPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.periodValidity.tr, rightTitle:"永久", allHeight:70.h, isHaveLine: false), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.lockName.tr, rightTitle:"MCBN0c_8f3106", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.editLockNamePage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.lockGrouping.tr, rightTitle:"202307", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.lockSeletGroupingPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.adminOpenLockPassword.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.adminOpenLockPasswordPage); + }), + ], + ), + ), + ], + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/basicInformation/editLockName/editLockName_page.dart b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/editLockName/editLockName_page.dart new file mode 100644 index 00000000..27ac0aad --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/editLockName/editLockName_page.dart @@ -0,0 +1,45 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/loginInput.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class EditLockNamePage extends StatefulWidget { + const EditLockNamePage({Key key}) : super(key: key); + + @override + State createState() => _EditLockNamePageState(); +} + +class _EditLockNamePageState extends State { + final TextEditingController _changeLockNameController = TextEditingController(); + + @override + void initState() { + super.initState(); + _changeLockNameController.text = "MCBN0c_8f3106"; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.basicInformation.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text(TranslationLoader.lanKeys.sure.tr, style: const TextStyle(color: Colors.white),), + onPressed: (){ + + },), + ],), + body:Container( + child: LoginInput(controller: _changeLockNameController, leftImg:'', hintText: TranslationLoader.lanKeys.pleaseEnterNumberOrEmail.tr, inputFormatters: [ + LengthLimitingTextInputFormatter(20), + ]), + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/lockSeletGrouping_page.dart b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/lockSeletGrouping_page.dart new file mode 100644 index 00000000..6d3aeb78 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/lockSeletGrouping_page.dart @@ -0,0 +1,53 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class LockSeletGroupingPage extends StatefulWidget { + const LockSeletGroupingPage({Key key}) : super(key: key); + + @override + State createState() => _LockSeletGroupingPageState(); +} + +class _LockSeletGroupingPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.basicInformation.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Column( + children: [ + Expanded(child: _buildMainUI()), + SubmitBtn( + btnName: TranslationLoader.lanKeys.sure.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + // Navigator.pushNamed(context, Routers.sendElectronicKeyManagePage); + } + ), + ], + ), + ); + } + + Widget _buildMainUI(){ + return ListView.builder( + itemCount:2, + itemBuilder: (c, index){ + return CommonItem(leftTitel:"202307", rightTitle:"", allHeight: 70.h, isHaveLine: true, isHaveDirection:false, isHaveRightWidget: true, rightWidget: Image(image: const AssetImage("images/icon_item_checked.png"),width:30.w,height:30.w, fit: BoxFit.contain,), action: (){ + // logic.changeLanguage(e); + }); + } + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart new file mode 100644 index 00000000..0e259402 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class UploadElectricQuantityPage extends StatefulWidget { + const UploadElectricQuantityPage({Key key}) : super(key: key); + + @override + State createState() => _UploadElectricQuantityPageState(); +} + +class _UploadElectricQuantityPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.electricQuantity.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.updateElectricQuantityTip.tr)), + ], + ), + SizedBox(height: 20.h,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text("${TranslationLoader.lanKeys.electricQuantity.tr} 100%")), + ], + ), + SizedBox(height: 30.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.update.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_page.dart b/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_page.dart new file mode 100644 index 00000000..84a517f2 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_page.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class BurglarAlarmPage extends StatefulWidget { + const BurglarAlarmPage({Key key}) : super(key: key); + + @override + State createState() => _BurglarAlarmPageState(); +} + +class _BurglarAlarmPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.burglarAlarm.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.burglarAlarmTip.tr)), + ], + ), + SizedBox(height: 20.h,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text("${TranslationLoader.lanKeys.currentMode.tr} : ${TranslationLoader.lanKeys.opened.tr}", style: TextStyle(fontWeight: FontWeight.w600),)), + ], + ), + SizedBox(height: 30.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.closed.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/diagnose/diagnose_page.dart b/star_lock/lib/main/lockDetail/lcokSet/diagnose/diagnose_page.dart new file mode 100644 index 00000000..a919c81a --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/diagnose/diagnose_page.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class DiagnosePage extends StatefulWidget { + const DiagnosePage({Key key}) : super(key: key); + + @override + State createState() => _DiagnosePageState(); +} + +class _DiagnosePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.diagnose.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.diagnoseTip.tr)), + ], + ), + SizedBox(height: 30.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.uploading.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/doorMagnetic/addDoorMagnetic/addDoorMagnetic_page.dart b/star_lock/lib/main/lockDetail/lcokSet/doorMagnetic/addDoorMagnetic/addDoorMagnetic_page.dart new file mode 100644 index 00000000..37361ffe --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/doorMagnetic/addDoorMagnetic/addDoorMagnetic_page.dart @@ -0,0 +1,73 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class AddDoorMagneticPage extends StatefulWidget { + const AddDoorMagneticPage({Key key}) : super(key: key); + + @override + State createState() => _AddDoorMagneticPageState(); +} + +class _AddDoorMagneticPageState extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.add.tr} ${TranslationLoader.lanKeys.doorMagnetic.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body: ListView( + children: [ + SizedBox(height: 100.h,), + Container( + // color: Colors.red, + margin: EdgeInsets.only(left: 20.w, right: 20.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.pressAndHoldTheResetButtonTwoSeconds.tr, textAlign:TextAlign.center, style: TextStyle(fontSize: 34.sp, fontWeight: FontWeight.w500),)), + ], + ), + ), + SizedBox(height: 90.h,), + Image.asset('images/main/icon_addDoorMagnetic_tip.png', width: 300.w, height: 300.w,), + SizedBox(height: 90.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.whenScreenFlashesClickNext.tr, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 90.h,), + SubmitBtn( + btnName: TranslationLoader.lanKeys.next.tr, + borderRadius: 10.w, + fontSize: 28.sp, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 15.w, bottom: 15.w), + onClick: (){ + Navigator.pushNamed(context, Routers.nearbyDoorMagneticPage); + } + ) + ], + ), + ); + } + + + void onShow(){ + + } + + void onHide(){ + + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/doorMagnetic/doorMagneticList/doorMagnetic_page.dart b/star_lock/lib/main/lockDetail/lcokSet/doorMagnetic/doorMagneticList/doorMagnetic_page.dart new file mode 100644 index 00000000..f821de90 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/doorMagnetic/doorMagneticList/doorMagnetic_page.dart @@ -0,0 +1,114 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../baseWidget.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class DoorMagneticPage extends StatefulWidget { + const DoorMagneticPage({Key key}) : super(key: key); + + @override + State createState() => _DoorMagneticPageState(); +} + +class _DoorMagneticPageState extends State with BaseWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.doorMagnetic.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + Container( + // color: Colors.red, + margin: EdgeInsets.all(20.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.doorMagneticListTopTip.tr, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),)), + ], + ), + ), + Expanded(child: _buildMainUI()), + SubmitBtn( + btnName: "${TranslationLoader.lanKeys.add.tr} ${TranslationLoader.lanKeys.doorMagnetic.tr}", + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + Navigator.pushNamed(context, Routers.addDoorMagneticPage); + } + ), + ], + ), + ); + } + + Widget _buildMainUI(){ + // return ListView.builder( + // itemCount:10, + // itemBuilder: (c, index){ + // return _electronicKeyItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + // // Navigator.pushNamed(context, Routers.electronicKeyDetailPage); + // }); + // } + // ); + return emptyView(); + } + + Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 100.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10.w), + ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width: 30.w,), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + // SizedBox(width:20.w), + // Text("待接收", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.w), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("2023.6.21 11.15", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/doorMagnetic/nearbyDoorMagnetic/nearbyDoorMagnetic_page.dart b/star_lock/lib/main/lockDetail/lcokSet/doorMagnetic/nearbyDoorMagnetic/nearbyDoorMagnetic_page.dart new file mode 100644 index 00000000..9f5c5e2c --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/doorMagnetic/nearbyDoorMagnetic/nearbyDoorMagnetic_page.dart @@ -0,0 +1,74 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class NearbyDoorMagneticPage extends StatefulWidget { + const NearbyDoorMagneticPage({Key key}) : super(key: key); + + @override + State createState() => _NearbyDoorMagneticPageState(); +} + +class _NearbyDoorMagneticPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.nearbyEquipment.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: ListView.builder( + itemCount:20, + itemBuilder: (c, index){ + return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", (){ + // Navigator.pushNamed(context, Routers.saveLockPage); + }); + } + ), + ); + } + + Widget nearbyLockItem(String lockTypeIcon, String lockTypeTitle, Function action){ + return GestureDetector( + onTap: action, + child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 80.h, + color: Colors.white, + child: Row( + children: [ + // SizedBox(width:20.w), + // Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width:20.w), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.w), + Image.asset('images/main/icon_main_addLock.png', width: 50.w, height: 50.w,), + SizedBox(width:30.w), + ], + ), + ), + Container(height: 0.5.h, color: Colors.grey,) + ], + ), + ); + } + + void onShow(){ + } + + void onHide(){ + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/importOtherLockData/ImportOtherLockData_page.dart b/star_lock/lib/main/lockDetail/lcokSet/importOtherLockData/ImportOtherLockData_page.dart new file mode 100644 index 00000000..3acf470a --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/importOtherLockData/ImportOtherLockData_page.dart @@ -0,0 +1,143 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class ImportOtherLockDataPage extends StatefulWidget { + const ImportOtherLockDataPage({Key key}) : super(key: key); + + @override + State createState() => _ImportOtherLockDataPageState(); +} + +class _ImportOtherLockDataPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.importOtherLockData.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.importOtherLockDataTip.tr)), + ], + ), + SizedBox(height: 20.h,), + _searchWidget(), + SizedBox(height: 10.h,), + Expanded(child: _buildMainUI()), + SubmitBtn(btnName: TranslationLoader.lanKeys.sure.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ) + ); + } + + Widget _searchWidget(){ + return Container( + height: 70.h, + // margin: EdgeInsets.only(top:20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5)), + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: EdgeInsets.only( + top: 8.h, left: -25.0.h, right: -15.0.h, bottom: 8.0.h), + hintText: TranslationLoader.lanKeys.pleaseEnter.tr, + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + icon: Padding( + padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + ), + ), + ), + ); + } + + Widget _buildMainUI(){ + return ListView.builder( + itemCount:20, + itemBuilder: (c, index){ + return _electronicKeyItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + // Navigator.pushNamed(context, Routers.electronicKeyDetailPage); + }); + } + ); + } + + Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 100.h, + margin: EdgeInsets.only(top: 15.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10.w), + ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width: 30.w,), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + SizedBox(width:20.w), + Text("待接收", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.w), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("2023.6.21 11.15-2023.6.21 11.15", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockEscalation/lockEscalation_page.dart b/star_lock/lib/main/lockDetail/lcokSet/lockEscalation/lockEscalation_page.dart new file mode 100644 index 00000000..17f9d435 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/lockEscalation/lockEscalation_page.dart @@ -0,0 +1,56 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class LockEscalationPage extends StatefulWidget { + const LockEscalationPage({Key key}) : super(key: key); + + @override + State createState() => _LockEscalationPageState(); +} + +class _LockEscalationPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.lockEscalation.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + SizedBox(height: 60.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('images/main/icon_main_lockSet_lockEscalation.png', width: 40.w, height: 40.w,), + SizedBox(width: 10.w,), + Text(TranslationLoader.lanKeys.haveNewVersion.tr, style: TextStyle(fontSize: 36.sp, fontWeight: FontWeight.w600),) + ], + ), + SizedBox(height: 30.h,), + Text("${TranslationLoader.lanKeys.currentVersion.tr}:1.0.0"), + SizedBox(height: 10.h,), + Text("${TranslationLoader.lanKeys.newVersion.tr}:1.0.1", style: TextStyle(color: AppColors.mainColor),), + SizedBox(height: 30.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.upgrade.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart new file mode 100644 index 00000000..2ab120f2 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart @@ -0,0 +1,121 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class LockSetPage extends StatefulWidget { + const LockSetPage({Key key}) : super(key: key); + + @override + State createState() => _LockSetPageState(); +} + +class _LockSetPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.set.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Column( + children: [ + Expanded( + child: ListView( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.basicInformation.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.basicInformationPage); + }), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.wirelessKeyboard.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.wirelessKeyboardPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.doorMagnetic.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.doorMagneticPage); + }), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.remoteUnlocking.tr, rightTitle:TranslationLoader.lanKeys.closed.tr, isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.remoteUnlockingPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.automaticBlocking.tr, rightTitle:"5s", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.automaticBlockingPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.normallyOpenMode.tr, rightTitle:TranslationLoader.lanKeys.closed.tr, isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.normallyOpenModePage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.lockSound.tr, rightTitle:"高", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.lockSoundSetPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.burglarAlarm.tr, rightTitle:TranslationLoader.lanKeys.opened.tr, isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.burglarAlarmPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.resetButton.tr, rightTitle:TranslationLoader.lanKeys.opened.tr, isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.resetButtonPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.unlockQRCode.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.unlockQRCodePage); + }), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.lockTime.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.lockTimePage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.diagnose.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.diagnosePage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.uploadData.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.uploadDataPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.importOtherLockData.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.importOtherLockDataPage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.lockEscalation.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.lockEscalationPage); + }), + SizedBox(height: 10.h,), + CommonItem(leftTitel:"Amazon Alexa", rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:"Google Home", rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.markedHouseState.tr, rightTitle:"空闲", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.markedHouseStatePage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.checkingIn.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), + CommonItem(leftTitel:TranslationLoader.lanKeys.unlockReminder.tr, rightTitle:"", isHaveLine: false, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), + SizedBox(height: 30.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.delete.tr, + borderRadius: 20.w, + fontSize: 32.sp, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ), + ], + ) + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart new file mode 100644 index 00000000..3df0bf74 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart @@ -0,0 +1,113 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class LockSoundSetPage extends StatefulWidget { + const LockSoundSetPage({Key key}) : super(key: key); + + @override + State createState() => _LockSoundSetPageState(); +} + +class _LockSoundSetPageState extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.lockSound.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:ListView( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.lockSound.tr, rightTitle:"", isHaveLine: false, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), + Container(height: 10.h,), + Container( + padding: EdgeInsets.all(30.w), + color: Colors.white, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.lockSoundTip.tr)), + ], + ), + ), + SizedBox(height: 10.h,), + Visibility( + visible: true, + child: Container( + color: Colors.white, + child: Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.pleaseSeletLockVolume.tr, rightTitle:"", isHaveLine: true), + CommonItem(leftTitel:TranslationLoader.lanKeys.low.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:TranslationLoader.lanKeys.lower.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:TranslationLoader.lanKeys.medium.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:TranslationLoader.lanKeys.higher.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:TranslationLoader.lanKeys.high.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + ], + ), + ) + ), + SubmitBtn( + btnName: TranslationLoader.lanKeys.save.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + // Navigator.pushNamed(context, Routers.nearbyLockPage); + } + ), + ], + ) + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_page.dart b/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_page.dart new file mode 100644 index 00000000..b992af54 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_page.dart @@ -0,0 +1,60 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class LockTimePage extends StatefulWidget { + const LockTimePage({Key key}) : super(key: key); + + @override + State createState() => _LockTimePageState(); +} + +class _LockTimePageState extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.lockTime.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + SizedBox(height: 50.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("2023.07.10 11.47.33", style: TextStyle(fontSize: 36.sp)), + ], + ), + SizedBox(height: 60.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.calibrationTime.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + SizedBox(height: 40.h,), + GestureDetector( + onTap: (){ + + }, + child: Container( + child: Text(TranslationLoader.lanKeys.setTheDSTMode.tr, style: TextStyle(fontSize: 30.sp, color: AppColors.mainColor)) + ), + ), + ], + ), + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/markedHouseState/markedHouseState_page.dart b/star_lock/lib/main/lockDetail/lcokSet/markedHouseState/markedHouseState_page.dart new file mode 100644 index 00000000..9015519d --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/markedHouseState/markedHouseState_page.dart @@ -0,0 +1,57 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class MarkedHouseStatePage extends StatefulWidget { + const MarkedHouseStatePage({Key key}) : super(key: key); + + @override + State createState() => _MarkedHouseStatePageState(); +} + +class _MarkedHouseStatePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.markedHouseState.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + child: Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.leisure.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:TranslationLoader.lanKeys.checkingIn.tr, rightTitle:"", isHaveLine: false, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + SizedBox(height: 60.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.sure.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart b/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart new file mode 100644 index 00000000..fcccf500 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart @@ -0,0 +1,197 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class NormallyOpenModePage extends StatefulWidget { + const NormallyOpenModePage({Key key}) : super(key: key); + + @override + State createState() => _NormallyOpenModePageState(); +} + +class _NormallyOpenModePageState extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.normallyOpenMode.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:ListView( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.normallyOpenMode.tr, rightTitle:"", isHaveLine: false, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), + Container(height: 10.h,), + Container( + padding: EdgeInsets.all(30.w), + color: Colors.white, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.normallyOpenModeTip.tr)), + ], + ), + ), + SizedBox(height: 10.h,), + Visibility( + visible: true, + child: Container( + color: Colors.white, + child: Column( + children: [ + topWidget(), + SizedBox(height: 10.h,), + bottomWidget() + ], + ), + ) + ), + SubmitBtn( + btnName: TranslationLoader.lanKeys.save.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + // Navigator.pushNamed(context, Routers.nearbyLockPage); + } + ), + ], + ) + ); + } + + Widget topWidget(){ + return Container( + height: 150.h, + width: 1.sw, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 60.h, + // color: Colors.red, + padding: EdgeInsets.only(left:20.h, top: 15.h), + child: Text("${TranslationLoader.lanKeys.normallyOpen.tr} ${TranslationLoader.lanKeys.date.tr}", style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w600)) + ), + Container( + height: 90.h, + padding: EdgeInsets.only(left:10.w, right: 10.w), + child: GridView.builder( + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 7, + childAspectRatio: 1.0 + ), + itemCount: 7, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context,index){ + return btnItem(index); + }) + ), + ], + ), + ); + } + + Widget btnItem(int index){ + String dateStr; + switch (index) { + case 0: + dateStr = TranslationLoader.lanKeys.Sunday.tr; + break; + case 1: + dateStr = TranslationLoader.lanKeys.Monday.tr; + break; + case 2: + dateStr = TranslationLoader.lanKeys.Tuesday.tr; + break; + case 3: + dateStr = TranslationLoader.lanKeys.Wednesday.tr; + break; + case 4: + dateStr = TranslationLoader.lanKeys.Thursday.tr; + break; + case 5: + dateStr = TranslationLoader.lanKeys.Friday.tr; + break; + case 6: + dateStr = TranslationLoader.lanKeys.Saturday.tr; + break; + default: + break; + } + return GestureDetector( + onTap: (){ + + }, + child: Container( + width: 70.h, + height: 70.h, + margin: EdgeInsets.all(10.h), + decoration: BoxDecoration( + // color: Colors.blue, + border: Border.all(width: 1, color: Colors.grey), + borderRadius: BorderRadius.circular(60.w), + ), + child: Center(child: Text(dateStr)), + ), + ); + } + + Widget bottomWidget(){ + return Column( + children: [ + Container(color: AppColors.mainBackgroundColor, height: 10.h,), + CommonItem(leftTitel:"${TranslationLoader.lanKeys.normallyOpen.tr} ${TranslationLoader.lanKeys.time.tr}", rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row( + children: [ + Text(TranslationLoader.lanKeys.allDay.tr), + SizedBox(width: 5.w,), + Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,), + ], + ), + )), + Visibility( + visible: true, + child: Container( + color: Colors.white, + child: Column( + children: [ + CommonItem(leftTitel:"${TranslationLoader.lanKeys.begin.tr} ${TranslationLoader.lanKeys.time.tr}", rightTitle:"", isHaveDirection: true, isHaveLine: true, action:(){ + + }), + CommonItem(leftTitel:"${TranslationLoader.lanKeys.end.tr} ${TranslationLoader.lanKeys.time.tr}", rightTitle:"", isHaveDirection: true, action:(){ + + }), + Container(height: 10.h), + ], + ), + ) + ), + + ], + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_page.dart b/star_lock/lib/main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_page.dart new file mode 100644 index 00000000..31c206c1 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_page.dart @@ -0,0 +1,56 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class RemoteUnlockingPage extends StatefulWidget { + const RemoteUnlockingPage({Key key}) : super(key: key); + + @override + State createState() => _RemoteUnlockingPageState(); +} + +class _RemoteUnlockingPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.remoteUnlocking.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.remoteUnlockingPageTip.tr)), + ], + ), + SizedBox(height: 20.h,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text("${TranslationLoader.lanKeys.currentMode.tr} : ${TranslationLoader.lanKeys.opened.tr}", style: TextStyle(fontWeight: FontWeight.w600),)), + ], + ), + SizedBox(height: 30.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.closed.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_page.dart b/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_page.dart new file mode 100644 index 00000000..53bb0a8e --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_page.dart @@ -0,0 +1,57 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class ResetButtonPage extends StatefulWidget { + const ResetButtonPage({Key key}) : super(key: key); + + @override + State createState() => _ResetButtonPageState(); +} + +class _ResetButtonPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.resetButton.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.resetButtonTip.tr)), + ], + ), + SizedBox(height: 20.h,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text("${TranslationLoader.lanKeys.currentMode.tr} : ${TranslationLoader.lanKeys.opened.tr}", style: TextStyle(fontWeight: FontWeight.w600),)), + ], + ), + SizedBox(height: 30.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.closed.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ) + ); + } +} + diff --git a/star_lock/lib/main/lockDetail/lcokSet/unlockQRCode/unlockQRCode_page.dart b/star_lock/lib/main/lockDetail/lcokSet/unlockQRCode/unlockQRCode_page.dart new file mode 100644 index 00000000..71454639 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/unlockQRCode/unlockQRCode_page.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; +import 'package:qr_flutter/qr_flutter.dart'; + +class UnlockQRCodePage extends StatefulWidget { + const UnlockQRCodePage({Key key}) : super(key: key); + + @override + State createState() => _UnlockQRCodePageState(); +} + +class _UnlockQRCodePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.burglarAlarm.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Column( + children: [ + Container( + padding: EdgeInsets.all(25.w), + margin: EdgeInsets.all(25.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(10.h)), + ), + child: Text("拥有电子钥匙的人,通过微信扫一扫这个二维码,即可开门。每把锁的二维码都不相同,你可以将其打印出来贴在对应的锁旁边") + ), + Container( + width: 1.sw, + padding: EdgeInsets.only(top:50.w), + margin: EdgeInsets.only(left: 25.w, right: 25.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(10.h)), + ), + child: Column( + children: [ + // Image.asset('images/main/icon_addDoorMagnetic_tip.png', width: 300.w, height: 300.w,), + // QrImageView( + // data:'二维码', + // size:300, + // ), + QrImage(data: 'www.baidu.com', size: 300.w), + SizedBox(height: 50.w,), + SubmitBtn(btnName: TranslationLoader.lanKeys.share.tr, + borderRadius: 20.w, + fontSize: 32.sp, + width: 250.w, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + SizedBox(height: 60.w,) + ], + ) + ), + ], + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/uploadData/uploadData_page.dart b/star_lock/lib/main/lockDetail/lcokSet/uploadData/uploadData_page.dart new file mode 100644 index 00000000..4b9a277f --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/uploadData/uploadData_page.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class UploadDataPage extends StatefulWidget { + const UploadDataPage({Key key}) : super(key: key); + + @override + State createState() => _UploadDataPageState(); +} + +class _UploadDataPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.uploadData.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Container( + padding: EdgeInsets.all(30.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded(child: Text(TranslationLoader.lanKeys.uploadDataTip.tr)), + ], + ), + SizedBox(height: 30.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.begin.tr, + borderRadius: 20.w, + fontSize: 32.sp, + // margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ) + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboard/addWirelessKeyboard_page.dart b/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboard/addWirelessKeyboard_page.dart new file mode 100644 index 00000000..6d59ff5c --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboard/addWirelessKeyboard_page.dart @@ -0,0 +1,81 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class AddWirelessKeyboardPage extends StatefulWidget { + const AddWirelessKeyboardPage({Key key}) : super(key: key); + + @override + State createState() => _AddWirelessKeyboardPageState(); +} + +class _AddWirelessKeyboardPageState extends State { + +@override +Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.add.tr} ${TranslationLoader.lanKeys.wirelessKeyboard.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body: ListView( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.lightTouchScreen.tr, style: TextStyle(fontSize: 36.sp, fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 90.h,), + Image.asset('images/main/icon_addWirelessKeyboardTip.png', width: 300.w, height: 300.w,), + SizedBox(height: 90.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.whenScreenFlashesClickNext.tr, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 90.h,), + SubmitBtn( + btnName: TranslationLoader.lanKeys.next.tr, + borderRadius: 10.w, + fontSize: 28.sp, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 15.w, bottom: 15.w), + onClick: (){ + Navigator.pushNamed(context, Routers.seletWirelessKeyboardPage); + } + ), + // SizedBox(height: 20.h,), + SubmitBtn( + btnName:TranslationLoader.lanKeys.theScreenNeverFlickered.tr, + borderRadius: 10.w, + fontSize: 28.sp, + margin: EdgeInsets.only(left: 30.w, right: 30.w), + padding: EdgeInsets.only(top: 15.w, bottom: 15.w), + onClick: (){ + Navigator.pushNamed(context, Routers.addWirelessKeyboardScreenNotLightOnPage); + } + ), + ], + ), + ); +} + + +void onShow(){ + +} + +void onHide(){ + +} +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboardScreenNotLightOn/addWirelessKeyboardScreenNotLightOn_page.dart b/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboardScreenNotLightOn/addWirelessKeyboardScreenNotLightOn_page.dart new file mode 100644 index 00000000..359e7795 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboardScreenNotLightOn/addWirelessKeyboardScreenNotLightOn_page.dart @@ -0,0 +1,76 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class AddWirelessKeyboardScreenNotLightOnPage extends StatefulWidget { + const AddWirelessKeyboardScreenNotLightOnPage({Key key}) : super(key: key); + + @override + State createState() => _AddWirelessKeyboardScreenNotLightOnPageState(); +} + +class _AddWirelessKeyboardScreenNotLightOnPageState extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.add.tr} ${TranslationLoader.lanKeys.wirelessKeyboard.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body: ListView( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.enterNumberOrPressSet.tr, style: TextStyle(fontSize: 36.sp, fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 20.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("(${TranslationLoader.lanKeys.theLocationOfTheSetKeyWillBeDifferent.tr})", style: TextStyle(fontSize: 26.sp, fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 90.h,), + Image.asset('images/main/icon_addWirelessKeyboardUnLightOnTip.png', width: 300.w, height: 300.w,), + SizedBox(height: 90.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.whenScreenFlashesClickNext.tr, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 90.h,), + SubmitBtn( + btnName: TranslationLoader.lanKeys.next.tr, + borderRadius: 10.w, + fontSize: 28.sp, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 15.w, bottom: 15.w), + onClick: (){ + Navigator.pushNamed(context, Routers.seletWirelessKeyboardPage); + } + ), + ], + ), + ); + } + + void onShow(){ + + } + + void onHide(){ + + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/seletWirelessKeyboard/seletWirelessKeyboard_page.dart b/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/seletWirelessKeyboard/seletWirelessKeyboard_page.dart new file mode 100644 index 00000000..319ddf56 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/seletWirelessKeyboard/seletWirelessKeyboard_page.dart @@ -0,0 +1,74 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class SeletWirelessKeyboardPage extends StatefulWidget { + const SeletWirelessKeyboardPage({Key key}) : super(key: key); + + @override + State createState() => _SeletWirelessKeyboardPageState(); +} + +class _SeletWirelessKeyboardPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.selet.tr} ${TranslationLoader.lanKeys.wirelessKeyboard.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body: ListView.builder( + itemCount:20, + itemBuilder: (c, index){ + return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", (){ + // Navigator.pushNamed(context, Routers.saveLockPage); + }); + } + ), + ); + } + + Widget nearbyLockItem(String lockTypeIcon, String lockTypeTitle, Function action){ + return GestureDetector( + onTap: action, + child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 80.h, + color: Colors.white, + child: Row( + children: [ + // SizedBox(width:20.w), + // Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width:20.w), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.w), + Image.asset('images/main/icon_main_addLock.png', width: 50.w, height: 50.w,), + SizedBox(width:30.w), + ], + ), + ), + Container(height: 0.5.h, color: Colors.grey,) + ], + ), + ); + } + + void onShow(){ + } + + void onHide(){ + } +} diff --git a/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart b/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart new file mode 100644 index 00000000..af5f56a4 --- /dev/null +++ b/star_lock/lib/main/lockDetail/lcokSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart @@ -0,0 +1,108 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class WirelessKeyboardPage extends StatefulWidget { + const WirelessKeyboardPage({Key key}) : super(key: key); + + @override + State createState() => _WirelessKeyboardPageState(); +} + +class _WirelessKeyboardPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.wirelessKeyboard.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text(TranslationLoader.lanKeys.reset.tr, style: const TextStyle(color: Colors.white),), + onPressed: (){ + + },), + ],), + body: Column( + children: [ + Expanded(child: _buildMainUI()), + SubmitBtn( + btnName: "${TranslationLoader.lanKeys.add.tr} ${TranslationLoader.lanKeys.wirelessKeyboard.tr}", + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + Navigator.pushNamed(context, Routers.addWirelessKeyboardPage); + } + ), + ], + ), + ); + } + + Widget _buildMainUI(){ + return ListView.builder( + itemCount:10, + itemBuilder: (c, index){ + return _electronicKeyItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + // Navigator.pushNamed(context, Routers.electronicKeyDetailPage); + }); + } + ); + } + + Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 100.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10.w), + ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width: 30.w,), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + // SizedBox(width:20.w), + // Text("待接收", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.w), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("2023.6.21 11.15", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart new file mode 100644 index 00000000..eed584dc --- /dev/null +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -0,0 +1,150 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../appRouters.dart'; +import '../../../app_settings/app_colors.dart'; +import '../../../tools/titleAppBar.dart'; +import '../../../translations/trans_lib.dart'; + +class LockDetailPage extends StatefulWidget { + const LockDetailPage({Key key}) : super(key: key); + + @override + State createState() => _LockDetailPageState(); +} + +class _LockDetailPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.starLock.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + topWidget(), + Expanded(child: bottomWidget()) + ], + ), + ); + } + + Widget topWidget(){ + return Column( + children: [ + SizedBox(height:40.h), + Stack( + alignment: Alignment.centerRight, + children: [ + Align( + alignment:Alignment.center, + child: Text("MCBN01-ea9240", style: TextStyle(fontSize: 36.sp, fontWeight: FontWeight.w500),) + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text("100%", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ), + SizedBox(width:5.w), + Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), + SizedBox(width:30.w), + ], + ), + ], + ), + SizedBox(height: 40.h), + Container( + width: 1.sw, + height: 280.w, + child: Stack( + children: [ + Center(child: Image.asset('images/main/icon_main_openLockBtn.png', width: 280.w, height: 280.w)), + Align( + alignment: const Alignment(0.5, 1), + child: Image.asset('images/main/icon_main_remoteUnlocking.png', width: 90.w, height: 90.w,) + ), + ], + ), + ), + SizedBox(height: 40.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.clickUnlockAndHoldDownClose.tr,style: TextStyle(fontSize: 28.sp, color: const Color(0xFFB3B3B3), fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 40.h,), + Container(height: 0.5.h, color: Colors.grey,) + ], + ); + } + + Widget bottomWidget(){ + return Container( + margin: EdgeInsets.only(left:10.w, right:10.w, top: 25.h), + // color: Colors.blue, + child: SizedBox( + child:GridView.count( + crossAxisCount: 4, + // childAspectRatio: 3, + crossAxisSpacing: 20.w, + mainAxisSpacing: 10.h, + physics: const NeverScrollableScrollPhysics(), + children: [ + bottomItem('images/main/icon_main_clockingIn.png', TranslationLoader.lanKeys.checkingIn.tr, (){ + + }), + bottomItem('images/main/icon_main_electronicKey.png', TranslationLoader.lanKeys.electronicKey.tr, (){ + Navigator.pushNamed(context, Routers.electronicKeyListPage); + }), + bottomItem('images/main/icon_main_password.png', TranslationLoader.lanKeys.password.tr, (){ + Navigator.pushNamed(context, Routers.passwordKeyListPage); + }), + bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys.card.tr, (){ + Navigator.pushNamed(context, Routers.otherTypeKeyListPage, arguments: 0); + }), + bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys.fingerprint.tr, (){ + Navigator.pushNamed(context, Routers.otherTypeKeyListPage, arguments: 1); + }), + bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys.remoteControl.tr, (){ + Navigator.pushNamed(context, Routers.otherTypeKeyListPage, arguments: 2); + }), + bottomItem('images/main/icon_main_authorizedAdmin.png', TranslationLoader.lanKeys.authorizedAdmin.tr, (){ + Navigator.pushNamed(context, Routers.authorizedAdminListPage); + }), + bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys.operatingRecord.tr, (){ + Navigator.pushNamed(context, Routers.lockOperatingRecordPage); + }), + bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys.set.tr, (){ + Navigator.pushNamed(context, Routers.lockSetPage); + }), + ], + ), + ), + ); + } + + Widget bottomItem(String iconUrl,String name, Function onClick){ + var width = 65.w; + var height = 70.h; + return GestureDetector( + onTap:onClick, + child: Container( + // height: 300.h, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: width, + height: height, + child: Image.asset(iconUrl, width: width,height: height,fit: BoxFit.fitWidth), + ), + SizedBox(height: 15.w), + Expanded(child: Text(name,style: TextStyle(fontSize: 25.sp, color:const Color(0xff333333)),textAlign: TextAlign.center)) + ], + ) + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart b/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart new file mode 100644 index 00000000..8521bd2a --- /dev/null +++ b/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart @@ -0,0 +1,156 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../app_settings/app_colors.dart'; +import '../../../tools/jh_pop_menus.dart'; +import '../../../tools/titleAppBar.dart'; +import '../../../translations/trans_lib.dart'; + +class LockOperatingRecordPage extends StatefulWidget { + const LockOperatingRecordPage({Key key}) : super(key: key); + + @override + State createState() => _LockOperatingRecordPageState(); +} + +class _LockOperatingRecordPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle:TranslationLoader.lanKeys.operatingRecord.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: const Text("操作", style: TextStyle(color: Colors.white),), + onPressed: (){ + JhPopMenus.showLinePop(context, clickCallback: (index, selText) { + print('选中index: $index'); + print('选中text: $selText'); + + if (selText == '添加朋友') { + // JhNavUtils.pushNamed(context, 'WxAddFriendPage'); + } + if (selText == '扫一扫') { + // _scan(); + } + }); + },), + ],), + body: Column( + children: [ + Container( + // crossAxisAlignment: CrossAxisAlignment.start, + padding: EdgeInsets.all(20.h), + child: Text(TranslationLoader.lanKeys.lockOperatingRecordTip.tr, textAlign: TextAlign.start,), + ), + _searchWidget(), + Expanded(child: _buildMainUI()), + ], + ), + ); + } + + Widget _searchWidget(){ + return Container( + height: 60.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5)), + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only( + top: 12.0, left: -22.0, right: -15.0, bottom: 10.0), + hintText: TranslationLoader.lanKeys.pleaseEnter.tr, + hintStyle: TextStyle(fontSize: 28.sp), + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + icon: Padding( + padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + ), + ), + ), + ); + } + + Widget _buildMainUI(){ + return ListView.builder( + itemCount:20, + itemBuilder: (c, index){ + if(index%2 == 0){ + return _dateItem("2023-06-29"); + }else{ + return _operatingRecordItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + // Navigator.pushNamed(context, Routers.electronicKeyDetailPage); + }); + } + } + ); + } + + Widget _dateItem(String lockDate){ + return Container( + height: 70.h, + // color: Colors.red, + padding: EdgeInsets.only(left:20.h, right: 20.h), + child: Row( + children: [ + Text(lockDate, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + ], + ), + ); + } + + Widget _operatingRecordItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 110.h, + padding: EdgeInsets.only(left: 20.w, right: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10.w), + ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width: 30.w,), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + ], + ), + SizedBox(height:10.h), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("2023.6.21 11.15-2023.6.21 11.15", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_page.dart new file mode 100644 index 00000000..f63c8e33 --- /dev/null +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_page.dart @@ -0,0 +1,200 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../translations/trans_lib.dart'; + +class OtherTypeAddKeyPage extends StatefulWidget { + final String seletType; + final int lockType; + const OtherTypeAddKeyPage({Key key, @required this.seletType, @required this.lockType}) : super(key: key); + + @override + State createState() => _OtherTypeAddKeyPageState(); +} + +class _OtherTypeAddKeyPageState extends State { + + final TextEditingController _controller = TextEditingController(); + + @override + Widget build(BuildContext context) { + return indexChangeWidget(); + } + + Widget indexChangeWidget(){ + switch (int.parse(widget.seletType)) { + case 0: + { + // 永久 + // return sendElectronicKeySucceed(); + return Column( + children: [ + perpetualKeyWidget(TranslationLoader.lanKeys.name.tr, TranslationLoader.lanKeys.pleaseEnter.tr, _controller), + keyBottomWidget() + ], + ); + } + break; + case 1: + { + // 限时 + return Column( + children: [ + perpetualKeyWidget(TranslationLoader.lanKeys.name.tr, TranslationLoader.lanKeys.pleaseEnter.tr, _controller), + keyTimeLimitWidget(), + keyBottomWidget() + ], + ); + } + break; + case 2: + { + // 循环 + return Column( + children: [ + perpetualKeyWidget(TranslationLoader.lanKeys.name.tr, TranslationLoader.lanKeys.pleaseEnter.tr, _controller), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"", isHaveDirection: true, action:(){ + // _showDatePicker(); + }), + keyBottomWidget() + ], + ); + } + break; + default: + break; + } + } + + // 密码命名输入框 + Widget perpetualKeyWidget(String titleStr, String rightTitle, TextEditingController controller){ + return Column( + children: [ + Container(height: 10.h), + CommonItem(leftTitel:titleStr, rightTitle:"", isHaveRightWidget: true, rightWidget: getTFWidget(rightTitle)), + Container(height: 10.h), + ], + ); + } + + // 限时顶部选择日期 + Widget keyTimeLimitWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"2020.06.20 11:49", isHaveLine: true, isHaveDirection: true, action:(){ + // _showDatePicker(); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, action:(){ + // _showDatePicker(); + }), + Container(height: 10.h), + ], + ); + } + + Widget keyBottomWidget(){ + return Column( + children: [ + // Container( + // padding: EdgeInsets.all(20.w), + // child: Row( + // // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Expanded(child: Text(tipStr, textAlign: TextAlign.start,)), + // ], + // ), + // ), + SubmitBtn(btnName: '${TranslationLoader.lanKeys.getTip.tr} ${getAppBarTitle(widget.lockType)}', borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + + } + ), + ], + ); + } + + // 发送电子钥匙成功 + Widget sendElectronicKeySucceed(){ + return Column( + children: [ + Container( + height: 300.h, + width: 1.sw, + color: Colors.white, + child: Column( + children: [ + SizedBox(height: 30.h,), + Image.asset('images/main/icon_main_addLock.png', width: 150.w, height: 150.w, color: AppColors.mainColor,), + SizedBox(height: 20.h,), + Text("操作成功,密码为",style: TextStyle(fontSize: 32.sp, color: Colors.black, fontWeight: FontWeight.w500),), + SizedBox(height: 10.h,), + Text("62689876",style: TextStyle(fontSize: 60.sp, color: Colors.black, fontWeight: FontWeight.w500),), + ], + ), + ), + SizedBox(height: 20.h,), + SubmitBtn(btnName: '完成', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + SubmitBtn(btnName: '分享', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + SubmitBtn(btnName: '标记为:已入住', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + ], + ); + } + + String getAppBarTitle(int type){ + String title; + switch (type) { + case 0: + title = TranslationLoader.lanKeys.card.tr; + break; + case 1: + title = TranslationLoader.lanKeys.fingerprint.tr; + break; + case 2: + title = TranslationLoader.lanKeys.remoteControl.tr; + break; + default: + break; + } + return title; + } + + // 接受者信息输入框 + Widget getTFWidget(String tfStr){ + return Container( + height: 50.h, + width: 500.w, + child: Row( + children: [ + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + textAlign:TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + SizedBox(width: 10.w,), + ], + ), + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart new file mode 100644 index 00000000..43b5f48c --- /dev/null +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart @@ -0,0 +1,195 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class OtherTypeKeyDetailPage extends StatefulWidget { + const OtherTypeKeyDetailPage({Key key}) : super(key: key); + + @override + State createState() => _OtherTypeKeyDetailPageState(); +} + +class _OtherTypeKeyDetailPageState extends State { + @override + Widget build(BuildContext context) { + var type = ModalRoute.of(context)?.settings?.arguments; + + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${getAppBarTitle(type)}${TranslationLoader.lanKeys.number.tr}", haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text(TranslationLoader.lanKeys.share.tr, style: const TextStyle(color: Colors.white),), + onPressed: (){ + + },), + ],), + body: Column( + children: [ + CommonItem(leftTitel:"${getAppBarTitle(type)}${TranslationLoader.lanKeys.number.tr}", rightTitle:"98765432", isHaveDirection: true, isHaveLine: true, action:(){ + showCupertinoAlertDialog(context); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"你好", isHaveDirection: true, isHaveLine: true, action:(){ + showCupertinoAlertDialog(context); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.periodValidity.tr, rightTitle:"永久", isHaveDirection: true, action:(){ + Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate); + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.additive.tr, rightTitle:"15080825640", action:(){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.addTime.tr, rightTitle:"2020.06.21 11:49", action:(){ + + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.operatingRecord.tr, rightTitle:"", isHaveDirection: true, action:(){ + + }), + Container(height: 40.h), + SubmitBtn( + btnName: TranslationLoader.lanKeys.delete.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + + } + ), + ], + ), + ); + } + + String getAppBarTitle(int type){ + String title; + switch (type) { + case 0: + title = TranslationLoader.lanKeys.card.tr; + break; + case 1: + title = TranslationLoader.lanKeys.fingerprint.tr; + break; + case 2: + title = TranslationLoader.lanKeys.remoteControl.tr; + break; + default: + break; + } + return title; + } + + Widget commonItem(String leftTitle, String rightTitle, {bool isHaveDirection = false, bool isHaveLine = false, bool isHaveRightWidget = false, Widget rightWidget,Function action}){ + return GestureDetector( + onTap: action, + child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // height: 80.h, + color: Colors.white, + padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + child: Row( + children: [ + SizedBox(width:20.w), + Text(leftTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + SizedBox(width:20.w), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + isHaveRightWidget?rightWidget:Text(rightTitle, textAlign: TextAlign.end,style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),) + ], + ), + ), + SizedBox(width:5.w), + isHaveDirection?Image.asset('images/icon_right.png', width: 50.w, height: 50.w,):SizedBox(width:10.w), + // SizedBox(width:10.w), + ], + ), + ), + isHaveLine?Container(height: 0.5.h, color: Colors.grey,):Container() + ], + ), + ); + } + + void showCupertinoAlertDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return Card( + color: const Color(0x00FFFFFF), + child: CupertinoAlertDialog( + title: const Text("修改密码"), + content: Column( + children: [ + const SizedBox(height: 10,), + Container( + height: 80.h, + // color: Colors.white, + margin: EdgeInsets.all(10.w), + child: const TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + // contentPadding: const EdgeInsets.only( + // top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), + hintText: "请输入要修改的名字", + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + // icon: Padding( + // padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + // child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + // ), + // //右边图标设置 + // suffixIcon: GestureDetector( + // onTap: () { + // //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次 + // // SchedulerBinding.instance.addPostFrameCallback((_) { + // // _controller.text = ""; + // // }); + // }, + // child: Padding( + // padding: EdgeInsets.all(8), + // child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), + // ), + // ) + ), + ), + ) + ], + ), + actions: [ + CupertinoDialogAction( + child: const Text("取消"), + onPressed: () { + Navigator.pop(context); + // print("取消"); + }, + ), + CupertinoDialogAction( + child: const Text("确定"), + onPressed: () { + Navigator.pop(context); + // print("确定"); + }, + ), + ], + ), + ); + }); + } + +} diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart new file mode 100644 index 00000000..25767677 --- /dev/null +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart @@ -0,0 +1,153 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class OtherTypeKeyListPage extends StatefulWidget { + const OtherTypeKeyListPage({Key key}) : super(key: key); + + @override + State createState() => _OtherTypeKeyListPageState(); +} + +class _OtherTypeKeyListPageState extends State { + + @override + Widget build(BuildContext context) { + var type = ModalRoute.of(context)?.settings?.arguments; + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: getAppBarTitle(type), haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text(TranslationLoader.lanKeys.reset.tr, style: const TextStyle(color: Colors.white),), + onPressed: (){ + + },), + ],), + body: Column( + children: [ + _searchWidget(), + Expanded(child: _buildMainUI(type)), + SubmitBtn( + btnName: '${TranslationLoader.lanKeys.getTip.tr} ${getAppBarTitle(type)}', + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + Navigator.pushNamed(context, Routers.otherTypeKeyManagePage, arguments: type); + } + ), + ], + ), + ); + } + + String getAppBarTitle(int type){ + String title; + switch (type) { + case 0: + title = TranslationLoader.lanKeys.card.tr; + break; + case 1: + title = TranslationLoader.lanKeys.fingerprint.tr; + break; + case 2: + title = TranslationLoader.lanKeys.remoteControl.tr; + break; + default: + break; + } + return title; + } + + Widget _searchWidget(){ + return Container( + height: 80.h, + margin: EdgeInsets.only(top:20.w, left: 20.w, right: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5)), + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only( + top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), + hintText: TranslationLoader.lanKeys.pleaseEnter.tr, + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + icon: Padding( + padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + ), + ), + ), + ); + } + + Widget _buildMainUI(int type){ + return ListView.builder( + itemCount:10, + itemBuilder: (c, index){ + return _electronicKeyItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + Navigator.pushNamed(context, Routers.otherTypeKeyDetailPage, arguments: type); + }); + } + ); + } + + Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 100.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10.w), + ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width: 30.w,), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + ], + ), + SizedBox(height:5.h), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("2023.6.21 11.15 永久", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_page.dart new file mode 100644 index 00000000..1c9fccde --- /dev/null +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_page.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; +import 'otherTypeKeyManage_tabbar.dart'; + +class OtherTypeKeyManagePage extends StatefulWidget { + const OtherTypeKeyManagePage({Key key}) : super(key: key); + + @override + State createState() => _OtherTypeKeyManagePageState(); +} + +class _OtherTypeKeyManagePageState extends State { + var index=0; + + @override + Widget build(BuildContext context) { + var lockType = ModalRoute.of(context)?.settings?.arguments; + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.addTip.tr} ${getAppBarTitle(lockType)}", haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + OtherTypeKeyManageTabbar(initialIndex: index, lockType: lockType), + ], + ), + ); + } + + String getAppBarTitle(int type){ + String title; + switch (type) { + case 0: + title = TranslationLoader.lanKeys.card.tr; + break; + case 1: + title = TranslationLoader.lanKeys.fingerprint.tr; + break; + case 2: + title = TranslationLoader.lanKeys.remoteControl.tr; + break; + default: + break; + } + return title; + } + +} diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_tabbar.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_tabbar.dart new file mode 100644 index 00000000..1dbcc2ec --- /dev/null +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_tabbar.dart @@ -0,0 +1,81 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/CustomUnderlineTabIndicator.dart'; +import '../../../../translations/trans_lib.dart'; +import '../otherTypeAddKey/otherTypeAddKey_page.dart'; + +class OtherTypeKeyManageTabbar extends StatefulWidget { + var initialIndex=1; + var lockType=0; + OtherTypeKeyManageTabbar({Key key, @required this.initialIndex, @required this.lockType}) : super(key: key); + + @override + State createState() => _OtherTypeKeyManageTabbarState(); +} + +class _OtherTypeKeyManageTabbarState extends State with SingleTickerProviderStateMixin { + TabController _tabController; + + final List _itemTabs = [ + ItemView(title: TranslationLoader.lanKeys.permanent.tr, seletType: "0"), + ItemView(title: TranslationLoader.lanKeys.timeLimit.tr, seletType: "1"), + ItemView(title: TranslationLoader.lanKeys.circulation.tr, seletType: "2"), + ]; + + @override + void initState() { + // TODO: implement initState + super.initState(); + _tabController = TabController(vsync: this, length: _itemTabs.length,initialIndex: widget.initialIndex); + } + + @override + Widget build(BuildContext context) { + return Expanded( + child: Column( + children: [ + _tabBar(), + _pageWidget(), + ], + ) + ); + } + + TabBar _tabBar(){ + return TabBar( + controller: _tabController, + tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(), + isScrollable: true, + indicatorColor: Colors.red, + unselectedLabelColor: Colors.black, + unselectedLabelStyle: TextStyle(color:AppColors.mainColor,fontSize: 28.sp,), + automaticIndicatorColorAdjustment:true, + labelColor: AppColors.mainColor, + labelStyle: TextStyle(color: AppColors.mainColor,fontSize: 28.sp,fontWeight: FontWeight.w600), + indicator: CustomUnderlineTabIndicator(borderSide: BorderSide(color: AppColors.mainColor,width: 10.w),strokeCap: StrokeCap.round,width: 0.w), + ); + } + + Tab _tab(ItemView item) { + return Tab(child: SizedBox(width: 1.sw/5, child: Text(item.title, textAlign: TextAlign.center))); + } + + Widget _pageWidget(){ + return Expanded( + child: TabBarView( + controller: _tabController, + children: _itemTabs.map((ItemView item) => OtherTypeAddKeyPage(seletType: item.seletType, lockType: widget.lockType,)).toList(), + ), + ); + } +} + +class ItemView { + const ItemView({@required this.title, @required this.seletType}); + + final String title; + final String seletType; +} diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart new file mode 100644 index 00000000..511edd58 --- /dev/null +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart @@ -0,0 +1,175 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class PasswordKeyDetailPage extends StatefulWidget { + const PasswordKeyDetailPage({Key key}) : super(key: key); + + @override + State createState() => _PasswordKeyDetailPageState(); +} + +class _PasswordKeyDetailPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.passwordDetail.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: const Text("分享", style: TextStyle(color: Colors.white),), + onPressed: (){ + + },), + ],), + body: Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.password.tr, rightTitle:"98765432", isHaveDirection: true, isHaveLine: true, action:(){ + showCupertinoAlertDialog(context); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"你好", isHaveDirection: true, isHaveLine: true, action:(){ + showCupertinoAlertDialog(context); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"永久", isHaveDirection: true, action:(){ + Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate); + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.sender.tr, rightTitle:"15080825640", action:(){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.senderTime.tr, rightTitle:"2020.06.21 11:49", action:(){ + + }), + Container(height: 10.h), + CommonItem(leftTitel:TranslationLoader.lanKeys.operatingRecord.tr, rightTitle:"", isHaveDirection: true, action:(){ + + }), + Container(height: 40.h), + SubmitBtn( + btnName: TranslationLoader.lanKeys.delete.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + + } + ), + ], + ), + ); + } + + Widget commonItem(String leftTitle, String rightTitle, {bool isHaveDirection = false, bool isHaveLine = false, bool isHaveRightWidget = false, Widget rightWidget,Function action}){ + return GestureDetector( + onTap: action, + child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // height: 80.h, + color: Colors.white, + padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + child: Row( + children: [ + SizedBox(width:20.w), + Text(leftTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + SizedBox(width:20.w), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + isHaveRightWidget?rightWidget:Text(rightTitle, textAlign: TextAlign.end,style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),) + ], + ), + ), + SizedBox(width:5.w), + isHaveDirection?Image.asset('images/icon_right.png', width: 50.w, height: 50.w,):SizedBox(width:10.w), + // SizedBox(width:10.w), + ], + ), + ), + isHaveLine?Container(height: 0.5.h, color: Colors.grey,):Container() + ], + ), + ); + } + + void showCupertinoAlertDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return Card( + color: const Color(0x00FFFFFF), + child: CupertinoAlertDialog( + title: Text("${TranslationLoader.lanKeys.amend.tr} ${TranslationLoader.lanKeys.password.tr}"), + content: Column( + children: [ + const SizedBox(height: 10,), + Container( + height: 80.h, + // color: Colors.white, + margin: EdgeInsets.all(10.w), + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + // contentPadding: const EdgeInsets.only( + // top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), + hintText: TranslationLoader.lanKeys.pleaseEnter.tr, + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + // icon: Padding( + // padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + // child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + // ), + // //右边图标设置 + // suffixIcon: GestureDetector( + // onTap: () { + // //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次 + // // SchedulerBinding.instance.addPostFrameCallback((_) { + // // _controller.text = ""; + // // }); + // }, + // child: Padding( + // padding: EdgeInsets.all(8), + // child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), + // ), + // ) + ), + ), + ) + ], + ), + actions: [ + CupertinoDialogAction( + child: Text(TranslationLoader.lanKeys.cancel.tr), + onPressed: () { + Navigator.pop(context); + // print("取消"); + }, + ), + CupertinoDialogAction( + child: Text(TranslationLoader.lanKeys.sure.tr), + onPressed: () { + Navigator.pop(context); + // print("确定"); + }, + ), + ], + ), + ); + }); + } + +} diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart new file mode 100644 index 00000000..bac698bc --- /dev/null +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart @@ -0,0 +1,132 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class PasswordKeyListPage extends StatefulWidget { + const PasswordKeyListPage({Key key}) : super(key: key); + + @override + State createState() => _PasswordKeyListPageState(); +} + +class _PasswordKeyListPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.password.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text(TranslationLoader.lanKeys.reset.tr, style: TextStyle(color: Colors.white),), + onPressed: (){ + + },), + ],), + body: Column( + children: [ + _searchWidget(), + Expanded(child: _buildMainUI()), + SubmitBtn( + btnName: TranslationLoader.lanKeys.getPassword.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + Navigator.pushNamed(context, Routers.passwordKeyManagePage); + } + ), + ], + ), + ); + } + + Widget _searchWidget(){ + return Container( + height: 80.h, + margin: EdgeInsets.only(top:20.w, left: 20.w, right: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5)), + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only( + top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), + hintText: TranslationLoader.lanKeys.pleaseEnter.tr, + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + icon: Padding( + padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), + child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + ), + ), + ), + ); + } + + Widget _buildMainUI(){ + return ListView.builder( + itemCount:10, + itemBuilder: (c, index){ + return _electronicKeyItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + Navigator.pushNamed(context, Routers.passwordKeyDetailPage); + }); + } + ); + } + + Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 100.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10.w), + ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width: 30.w,), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + ], + ), + SizedBox(height:5.h), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("2023.6.21 11.15 永久", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_page.dart new file mode 100644 index 00000000..59c56bfc --- /dev/null +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_page.dart @@ -0,0 +1,32 @@ + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class PasswordKeyManagePage extends StatefulWidget { + const PasswordKeyManagePage({Key key}) : super(key: key); + + @override + State createState() => _PasswordKeyManagePageState(); +} + +class _PasswordKeyManagePageState extends State { + var index=0; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.getPassword.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + PasswordKeyManageTabbarPage(initialIndex: index,), + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart new file mode 100644 index 00000000..1741aa6b --- /dev/null +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart @@ -0,0 +1,91 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/CustomUnderlineTabIndicator.dart'; +import '../../../../translations/trans_lib.dart'; +import '../passwordKey_Perpetual/passwordKey_perpetual_page.dart'; + +class PasswordKeyManageTabbarPage extends StatefulWidget { + var initialIndex=1; + + PasswordKeyManageTabbarPage({Key key, @required this.initialIndex}) : super(key: key); + @override + State createState() => _PasswordKeyManageTabbarPageState(); +} + +class _PasswordKeyManageTabbarPageState extends State with SingleTickerProviderStateMixin { + TabController _tabController; + + final List _itemTabs = [ + ItemView(title: TranslationLoader.lanKeys.permanent.tr, type: "0"), + ItemView(title: TranslationLoader.lanKeys.timeLimit.tr, type: "1"), + ItemView(title: TranslationLoader.lanKeys.once.tr, type: "2"), + ItemView(title: TranslationLoader.lanKeys.custom.tr, type: "3"), + ItemView(title: TranslationLoader.lanKeys.circulation.tr, type: "4"), + ItemView(title: TranslationLoader.lanKeys.clearAll.tr, type: "5"), + ]; + + @override + void initState() { + // TODO: implement initState + super.initState(); + _tabController = TabController(vsync: this, length: _itemTabs.length,initialIndex: widget.initialIndex); + } + + @override + Widget build(BuildContext context) { + return Expanded( + child: Column( + children: [ + _tabBar(), + _pageWidget(), + ], + ) + ); + } + + TabBar _tabBar(){ + return TabBar( + controller: _tabController, + tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(), + isScrollable: true, + indicatorColor: Colors.red, + unselectedLabelColor: Colors.black, + unselectedLabelStyle: TextStyle(color:AppColors.mainColor,fontSize: 28.sp,), + automaticIndicatorColorAdjustment:true, + labelColor: AppColors.mainColor, + labelStyle: TextStyle(color: AppColors.mainColor,fontSize: 28.sp,fontWeight: FontWeight.w600), + indicator: CustomUnderlineTabIndicator(borderSide: BorderSide(color: AppColors.mainColor,width: 10.w),strokeCap: StrokeCap.round,width: 0.w), + ); + } + + Tab _tab(ItemView item) { + return Tab( + // text: item.title, + child: Container( + width: 1.sw/8, + // margin: EdgeInsets.all(10.w), + // color: Colors.red, + child: Text(item.title, textAlign: TextAlign.center,), + ), + ); + } + + Widget _pageWidget(){ + return Expanded( + child: TabBarView( + controller: _tabController, + children: _itemTabs.map((ItemView item) => PasswordKeyPerpetualPage(type: item.type,)).toList(), + ), + ); + } +} + +class ItemView { + const ItemView({@required this.title, @required this.type}); + + final String title; + final String type; +} diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart new file mode 100644 index 00000000..0e6d9168 --- /dev/null +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart @@ -0,0 +1,263 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../translations/trans_lib.dart'; + +class PasswordKeyPerpetualPage extends StatefulWidget { + final String type; + + const PasswordKeyPerpetualPage({Key key, @required this.type}) : super(key: key); + @override + State createState() => _PasswordKeyPerpetualPageState(); +} + +class _PasswordKeyPerpetualPageState extends State { + + final TextEditingController _controller = TextEditingController(); + + @override + Widget build(BuildContext context) { + return indexChangeWidget(); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + + } + + Widget indexChangeWidget(){ + switch (int.parse(widget.type)) { + case 0: + { + // 永久 + // return sendElectronicKeySucceed(); + return Column( + children: [ + perpetualKeyWidget(TranslationLoader.lanKeys.name.tr, TranslationLoader.lanKeys.pleaseNameYourPassword.tr, _controller), + keyBottomWidget(TranslationLoader.lanKeys.getPasswordTip1.tr) + ], + ); + } + break; + case 1: + { + // 限时 + return Column( + children: [ + keyTimeLimitWidget(), + perpetualKeyWidget(TranslationLoader.lanKeys.name.tr, TranslationLoader.lanKeys.pleaseNameYourPassword.tr, _controller), + keyBottomWidget(TranslationLoader.lanKeys.getPasswordTip2.tr) + ], + ); + } + break; + case 2: + { + // 单次 + return Column( + children: [ + perpetualKeyWidget(TranslationLoader.lanKeys.name.tr, TranslationLoader.lanKeys.pleaseNameYourPassword.tr, _controller), + keyBottomWidget(TranslationLoader.lanKeys.getPasswordTip3.tr) + ], + ); + } + break; + case 3: + { + // 自定义 + return Column( + children: [ + keyIfPerpetualWidget(), + perpetualKeyWidget(TranslationLoader.lanKeys.name.tr, TranslationLoader.lanKeys.pleaseNameYourPassword.tr, _controller), + perpetualKeyWidget(TranslationLoader.lanKeys.password.tr, "请输入6-9位数字", _controller), + keyBottomWidget(TranslationLoader.lanKeys.getPasswordTip4.tr) + ], + ); + } + break; + case 4: + { + // 循环 + return Column( + children: [ + keyCirculationWidget(), + perpetualKeyWidget(TranslationLoader.lanKeys.name.tr, TranslationLoader.lanKeys.pleaseNameYourPassword.tr, _controller), + keyBottomWidget(TranslationLoader.lanKeys.getPasswordTip5.tr) + ], + ); + } + break; + case 5: + { + // 清空 + return Column( + children: [ + perpetualKeyWidget(TranslationLoader.lanKeys.name.tr, TranslationLoader.lanKeys.pleaseNameYourPassword.tr, _controller), + keyBottomWidget(TranslationLoader.lanKeys.getPasswordTip6.tr) + ], + ); + } + break; + default: + break; + } + } + + // 密码命名输入框 + Widget perpetualKeyWidget(String titleStr, String rightTitle, TextEditingController controller){ + return Column( + children: [ + Container(height: 10.h), + CommonItem(leftTitel:titleStr, rightTitle:"", isHaveRightWidget: true, rightWidget: getTFWidget(rightTitle)), + Container(height: 10.h), + ], + ); + } + + // 限时顶部选择日期 + Widget keyTimeLimitWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"2020.06.20 11:49", isHaveLine: true, isHaveDirection: true, action:(){ + // _showDatePicker(); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, action:(){ + // _showDatePicker(); + }), + Container(height: 10.h), + ], + ); + } + + // 自定义是否永久 + Widget keyIfPerpetualWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.permanent.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch()), action:(){ + + }), + Container(height: 10.h), + ], + ); + } + + // 循环 + Widget keyCirculationWidget(){ + return Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.recursiveDevice.tr, rightTitle:"周末", isHaveLine: true, isHaveDirection: true, action:(){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"10:00", isHaveLine: true, isHaveDirection: true, action:(){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"11:00", isHaveDirection: true, action:(){ + + }), + ], + ); + } + + Widget keyBottomWidget(String tipStr){ + return Column( + children: [ + Container( + padding: EdgeInsets.all(20.w), + child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: Text(tipStr, textAlign: TextAlign.start,)), + ], + ), + ), + SubmitBtn(btnName: TranslationLoader.lanKeys.getPassword.tr, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + + } + ), + ], + ); + } + + // 发送电子钥匙成功 + Widget sendElectronicKeySucceed(){ + return Column( + children: [ + Container( + height: 300.h, + width: 1.sw, + color: Colors.white, + child: Column( + children: [ + SizedBox(height: 30.h,), + Image.asset('images/main/icon_main_addLock.png', width: 150.w, height: 150.w, color: AppColors.mainColor,), + SizedBox(height: 20.h,), + Text("操作成功,密码为",style: TextStyle(fontSize: 32.sp, color: Colors.black, fontWeight: FontWeight.w500),), + SizedBox(height: 10.h,), + Text("62689876",style: TextStyle(fontSize: 60.sp, color: Colors.black, fontWeight: FontWeight.w500),), + ], + ), + ), + SizedBox(height: 20.h,), + SubmitBtn(btnName: '完成', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + SubmitBtn(btnName: '分享', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + Navigator.pushNamed(context, Routers.sendEmailNotificationPage); + }), + SubmitBtn(btnName: '标记为:已入住', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ + + }), + ], + ); + } + + // 接受者信息输入框 + Widget getTFWidget(String tfStr){ + return Container( + height: 50.h, + width: 500.w, + child: Row( + children: [ + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + textAlign:TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + SizedBox(width: 10.w,), + ], + ), + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } + +} diff --git a/star_lock/lib/main/lockMian/lockMain_page.dart b/star_lock/lib/main/lockMian/lockMain_page.dart new file mode 100644 index 00000000..658eb44b --- /dev/null +++ b/star_lock/lib/main/lockMian/lockMain_page.dart @@ -0,0 +1,147 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:star_lock/mine/mineSet/mineSet_page.dart'; + +import '../../appRouters.dart'; +import '../../baseWidget.dart'; +import '../../mine/mine_page.dart'; +import '../../tools/titleAppBar.dart'; +import '../../translations/trans_lib.dart'; + +class StarLockMain extends StatefulWidget { + const StarLockMain({Key key}) : super(key: key); + + @override + State createState() => _StarLockMainState(); +} + +class _StarLockMainState extends State with BaseWidget{ + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xFFF5F5F5), + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.starLock.tr, haveBack:false, haveOtherLeftWidget: true, leftWidget: Builder( + builder: (context) => IconButton( + icon: Image.asset("images/main/mainLeft_menu_icon.png",color:Colors.white, width: 60.w, height: 60.w,), + onPressed: () { + Scaffold.of(context).openDrawer(); + }, + ) + ),backgroundColor: AppColors.mainColor), + drawer: Drawer( + width:1.sw/3*2, + child: StarLockMinePage(), + ), + body: getLockList(), + // body: unHaveData(), + ); + } + + Widget getLockList(){ + return ListView.builder( + itemCount:10, + itemBuilder: (c, index){ + return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", (){ + Navigator.pushNamed(context, Routers.lockDetailPage); + }); + } + ); + } + + Widget nearbyLockItem(String lockTypeIcon, String lockTypeTitle, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 150.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20.w), + ), + child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(height: 30.h,), + Row( + children: [ + SizedBox(width:20.w), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width:20.w), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.w), + Text("100%", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ), + SizedBox(width:5.w), + Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), + SizedBox(width:30.w), + ], + ), + SizedBox(height: 20.h,), + Row( + children: [ + SizedBox(width:30.w), + Text("永久/管理员", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ], + ), + ), + ); + } + + Widget unHaveData(){ + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border.all(width: 4, color: AppColors.mainColor), + borderRadius: BorderRadius.circular(75), + ), + child:InkWell( + child: Padding( + padding: const EdgeInsets.all(30.0), + child: Image.asset('images/main/icon_main_addLock.png', width: 150.w, height: 150.w,), + ), + onTap: () { + //实现回调函数 + Navigator.pushNamed(context, Routers.seletLockTypePage, + // arguments: { + // "url": ConstConfig.privacAgreementUrl, + // "title": '隐私政策' + // } + ); + }, + ) + ), + ], + ), + SizedBox(height: h(50.h),), + Container( + padding: EdgeInsets.all(30.w), + child: Text(TranslationLoader.lanKeys.whenAddingLockThePhoneMustBeNextToTheLock.tr, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w800, color: AppColors.mainColor),) + ) + ], + ); + } + + void onShow(){ + + } + + void onHide(){ + + } +} diff --git a/star_lock/lib/mine/addLock/addLock/addLock_page.dart b/star_lock/lib/mine/addLock/addLock/addLock_page.dart new file mode 100644 index 00000000..3f6385f6 --- /dev/null +++ b/star_lock/lib/mine/addLock/addLock/addLock_page.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../appRouters.dart'; +import '../../../app_settings/app_colors.dart'; +import '../../../baseWidget.dart'; +import '../../../tools/submitBtn.dart'; +import '../../../tools/titleAppBar.dart'; +import '../../../translations/trans_lib.dart'; + +class AddLockPage extends StatefulWidget { + const AddLockPage({Key key}) : super(key: key); + + @override + State createState() => _AddLockPageState(); +} + +class _AddLockPageState extends State with BaseWidget{ + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.addLock.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.lightTouchScreen.tr, style: TextStyle(fontSize: 36.sp, fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 120.h,), + Image.asset('images/main/icon_main_addLock.png', width: 150.w, height: 150.w,), + SizedBox(height: 120.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.lightTouchScreenTip.tr, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 120.h,), + SubmitBtn( + btnName: TranslationLoader.lanKeys.next.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + Navigator.pushNamed(context, Routers.nearbyLockPage); + } + ), + ], + ), + ); + } + + + void onShow(){ + + } + + void onHide(){ + + } +} diff --git a/star_lock/lib/mine/addLock/lockAddress/lockAddress_page.dart b/star_lock/lib/mine/addLock/lockAddress/lockAddress_page.dart new file mode 100644 index 00000000..c638ed5d --- /dev/null +++ b/star_lock/lib/mine/addLock/lockAddress/lockAddress_page.dart @@ -0,0 +1,32 @@ + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../../../appRouters.dart'; +import '../../../app_settings/app_colors.dart'; +import '../../../tools/titleAppBar.dart'; +import '../../../translations/trans_lib.dart'; + +class LockAddressPage extends StatefulWidget { + const LockAddressPage({Key key}) : super(key: key); + + @override + State createState() => _LockAddressPageState(); +} + +class _LockAddressPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "锁地址", haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + TextButton( + child: Text("保存", style: const TextStyle(color: Colors.white),), + onPressed: (){ + Navigator.pushNamed(context, Routers.saveLockPage); + },), + ],), + body:Container() + ); + } +} diff --git a/star_lock/lib/mine/addLock/nearbyLock/nearbyLock_page.dart b/star_lock/lib/mine/addLock/nearbyLock/nearbyLock_page.dart new file mode 100644 index 00000000..97a9f179 --- /dev/null +++ b/star_lock/lib/mine/addLock/nearbyLock/nearbyLock_page.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import '../../../appRouters.dart'; +import '../../../app_settings/app_colors.dart'; +import '../../../tools/titleAppBar.dart'; +import '../../../translations/trans_lib.dart'; + +class NearbyLockPage extends StatefulWidget { + const NearbyLockPage({Key key}) : super(key: key); + + @override + State createState() => _NearbyLockPageState(); +} + +class _NearbyLockPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.nearbyLock.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: ListView.builder( + itemCount:20, + itemBuilder: (c, index){ + return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", (){ + Navigator.pushNamed(context, Routers.lockAddressPage); + }); + } + ), + ); + } + + Widget nearbyLockItem(String lockTypeIcon, String lockTypeTitle, Function action){ + return GestureDetector( + onTap: action, + child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 80.h, + color: Colors.white, + child: Row( + children: [ + SizedBox(width:20.w), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width:20.w), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.w), + Image.asset('images/main/icon_main_addLock.png', width: 50.w, height: 50.w,), + SizedBox(width:30.w), + ], + ), + ), + Container(height: 0.5.h, color: Colors.grey,) + ], + ), + ); + } + + void onShow(){ + } + + void onHide(){ + } +} diff --git a/star_lock/lib/mine/addLock/saveLock/saveLock_page.dart b/star_lock/lib/mine/addLock/saveLock/saveLock_page.dart new file mode 100644 index 00000000..4160b52c --- /dev/null +++ b/star_lock/lib/mine/addLock/saveLock/saveLock_page.dart @@ -0,0 +1,100 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../app_settings/app_colors.dart'; +import '../../../tools/submitBtn.dart'; +import '../../../tools/titleAppBar.dart'; +import '../../../translations/trans_lib.dart'; + +class SaveLockPage extends StatefulWidget { + const SaveLockPage({Key key}) : super(key: key); + + @override + State createState() => _SaveLockPageState(); +} + +class _SaveLockPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.addLock.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 80.h,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.addSuccessfullyPleaseRename.tr, style: TextStyle(fontSize: 36.sp, fontWeight: FontWeight.w500),), + ], + ), + SizedBox(height: 80.h,), + Container( + height: 80.h, + // color: Colors.red, + padding: EdgeInsets.only(left: 50.w, right: 50.w), + child: TextField( + textAlign:TextAlign.center, + // style:TextStyle(height: 1.1, fontSize: 36.sp, fontWeight: FontWeight.w400, color:AppColors.mainColor), + decoration: InputDecoration( + hintText: '请填写信息', + hintStyle: TextStyle( + // height: 1.1, + fontSize: 30.sp, + fontWeight: FontWeight.w400, + color: const Color(0xFF999999) + ), + border: OutlineInputBorder( + ///设置边框四个角的弧度 + borderRadius: BorderRadius.all(Radius.circular(50.h)), + ///用来配置边框的样式 + borderSide: BorderSide( + ///设置边框的颜色 + color: AppColors.mainColor, + ///设置边框的粗细 + width: 1, + ), + ), + ///用来配置输入框获取焦点时的颜色 + focusedBorder: OutlineInputBorder( + ///设置边框四个角的弧度 + borderRadius: BorderRadius.all(Radius.circular(50.h)), + ///用来配置边框的样式 + borderSide: BorderSide( + ///设置边框的颜色 + color: AppColors.mainColor, + ///设置边框的粗细 + width: 1, + ), + ), + ) + ), + ), + SizedBox(height: 120.h,), + SubmitBtn( + btnName: TranslationLoader.lanKeys.sure.tr, + borderRadius: 20.w, + margin: EdgeInsets.only( + left: 50.w, + right: 50.w, + top: 30.w, + bottom: 30.w + ), + padding: EdgeInsets.only( + top: 25.w, + bottom: 25.w + ), + onClick: (){ + Navigator.pop(context); + } + ), + ], + ) + ); + } + + +} diff --git a/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart b/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart new file mode 100644 index 00000000..005445e2 --- /dev/null +++ b/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart @@ -0,0 +1,135 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../appRouters.dart'; +import '../../../app_settings/app_colors.dart'; +import '../../../baseWidget.dart'; +import '../../../tools/titleAppBar.dart'; +import '../../../translations/trans_lib.dart'; + +class SeletLockTypePage extends StatefulWidget { + const SeletLockTypePage({Key key}) : super(key: key); + + @override + State createState() => _SeletLockTypePageState(); +} + +class _SeletLockTypePageState extends State with BaseWidget{ + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.addLock.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + allLock(), + Expanded( + child: Container( + padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10), + child: GridView.count( + crossAxisCount: 2, + childAspectRatio: 3, + crossAxisSpacing: 10, + mainAxisSpacing: 10, + children: [ + lockTypeItem('images/icon_lock.png', TranslationLoader.lanKeys.doorLock.tr, (){ + Navigator.pushNamed(context, Routers.addLockPage); + }), + lockTypeItem('images/icon_lock.png', TranslationLoader.lanKeys.padlock.tr, (){ + Navigator.pushNamed(context, Routers.addLockPage); + }), + lockTypeItem('images/icon_lock.png', TranslationLoader.lanKeys.safeLock.tr, (){ + Navigator.pushNamed(context, Routers.addLockPage); + }), + lockTypeItem('images/icon_lock.png', TranslationLoader.lanKeys.intelligentLockCore.tr, (){ + Navigator.pushNamed(context, Routers.addLockPage); + }), + lockTypeItem('images/icon_lock.png', TranslationLoader.lanKeys.parkingLock.tr, (){ + Navigator.pushNamed(context, Routers.addLockPage); + }), + lockTypeItem('images/icon_lock.png', TranslationLoader.lanKeys.bicycleLock.tr, (){ + Navigator.pushNamed(context, Routers.addLockPage); + }), + lockTypeItem('images/icon_lock.png', TranslationLoader.lanKeys.longRangeControl.tr, (){ + Navigator.pushNamed(context, Routers.addLockPage); + }), + ], + ), + ), + ) + ], + ), + ); + } + + + Widget allLock(){ + return GestureDetector( + onTap: (){ + + }, + child: Container( + height: 150.h, + color: Colors.white, + margin: EdgeInsets.all(10), + child: Row( + children: [ + SizedBox(width:40.w), + Image.asset('images/icon_lock.png', width: 80.w, height: 100.w,), + SizedBox(width:40.w), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(TranslationLoader.lanKeys.allLock.tr, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w500)), + Text(TranslationLoader.lanKeys.searchAllLockType.tr, style: TextStyle(fontSize: 26.sp, fontWeight: FontWeight.w500)), + ], + ), + ), + SizedBox(width:40.w), + Image.asset('images/icon_right.png', width: 60.w, height: 60.w,), + SizedBox(width:40.w), + ], + ), + ), + ); + } + + Widget lockTypeItem(String lockTypeIcon, String lockTypeTitle, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 120.h, + color: Colors.white, + // margin: EdgeInsets.all(10), + child: Row( + children: [ + SizedBox(width:20.w), + Image.asset(lockTypeIcon, width: 40.w, height: 50.w,), + SizedBox(width:20.w), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w500)), + ], + ), + ), + SizedBox(width:20.w), + Image.asset('images/icon_right.png', width: 60.w, height: 60.w,), + SizedBox(width:20.w), + ], + ), + ), + ); + } + + void onShow(){ + } + + void onHide(){ + } +} diff --git a/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_logic.dart b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_logic.dart new file mode 100644 index 00000000..6d011497 --- /dev/null +++ b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_logic.dart @@ -0,0 +1,14 @@ + +import 'dart:ui'; +import 'package:get/get.dart'; +import 'mineMultiLanguage_state.dart'; + +class MineMultiLanguageLogic extends GetxController { + final MineMultiLanguageState state = MineMultiLanguageState(); + + void changeLanguage(Locale l) { + if(l == Get.locale)return; + Get.updateLocale(l); + state.resetLan(); + } +} \ No newline at end of file diff --git a/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart new file mode 100644 index 00000000..f1c8fb61 --- /dev/null +++ b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../app_settings/app_colors.dart'; +import '../../tools/commonItem.dart'; +import '../../tools/titleAppBar.dart'; +import '../../translations/app_dept.dart'; +import '../../translations/trans_lib.dart'; +import 'mineMultiLanguage_logic.dart'; + +class MineMultiLanguagePage extends StatefulWidget { + const MineMultiLanguagePage({Key key}) : super(key: key); + + @override + State createState() => _MineMultiLanguagePageState(); +} + +class _MineMultiLanguagePageState extends State { + + final logic = Get.put(MineMultiLanguageLogic()); + final state = Get.find().state; + + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.multilingual.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: _children(), + ) + ); + } + + List _children(){ + List l = []; + for(int i = 0; i < state.languages.length; i++){ + var e = state.languages[i]; + var lanType = ExtensionLanguageType.fromLanguageCode(e.languageCode); + l.add(CommonItem(leftTitel:lanType.lanTitle, rightTitle:"", allHeight: 70.h, isHaveLine: true, isHaveDirection:false, isHaveRightWidget: true, rightWidget: Obx(() => state.currentLanguageType.value == lanType ? Image(image: const AssetImage("images/icon_item_checked.png"),width:30.w,height:30.w, fit: BoxFit.contain,): Container()), action: (){ + logic.changeLanguage(e); + }),); + } + return l; + } +} diff --git a/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_state.dart b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_state.dart new file mode 100644 index 00000000..2b8d5737 --- /dev/null +++ b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_state.dart @@ -0,0 +1,24 @@ + +import 'dart:ui'; +import 'package:get/get.dart'; + +import '../../tools/store_service.dart'; +import '../../translations/app_dept.dart'; + +class MineMultiLanguageState { + + List get languages { + return appDept.deptSupportedLocales; + } + + var currentLanguageType = ExtensionLanguageType.fromLanguageCode(Get.locale.languageCode).obs; + + AppLanuageConfigState() { + resetLan(); + } + + void resetLan() { + currentLanguageType.value = ExtensionLanguageType.fromLanguageCode(Get.locale.languageCode); + StoreService.to.saveLanguageCode(Get.locale.languageCode); + } +} \ No newline at end of file diff --git a/star_lock/lib/mine/mineSet/mineSet_page.dart b/star_lock/lib/mine/mineSet/mineSet_page.dart new file mode 100644 index 00000000..3acd0c4d --- /dev/null +++ b/star_lock/lib/mine/mineSet/mineSet_page.dart @@ -0,0 +1,137 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../appRouters.dart'; +import '../../app_settings/app_colors.dart'; +import '../../tools/commonItem.dart'; +import '../../tools/submitBtn.dart'; +import '../../tools/titleAppBar.dart'; +import '../../translations/trans_lib.dart'; + +class MineSetPage extends StatefulWidget { + const MineSetPage({Key key}) : super(key: key); + + @override + State createState() => _MineSetPageState(); +} + +class _MineSetPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.moreSet.tr, haveBack:true, backgroundColor: AppColors.mainColor), + body:Column( + children: [ + Expanded( + child: ListView( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.prompTone.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), + CommonItem(leftTitel:TranslationLoader.lanKeys.touchUnlock.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), + CommonItem(leftTitel:TranslationLoader.lanKeys.pushNotification.tr, rightTitle:"", isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.lockUserManagement.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.authorizedAdmin.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.lockGroup.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.transferSmartLock.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.transferGateway.tr, rightTitle:"", isHaveDirection: true, action: (){ + + }), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.multiLanguage.tr, rightTitle:"简体中文", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.mineMultiLanguagePage); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.lockScreen.tr, rightTitle:TranslationLoader.lanKeys.opened.tr, isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.hideInvalidUnlockPermissions.tr, rightTitle:TranslationLoader.lanKeys.closed.tr, isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.appUnlockRequiresMobilePhoneAccessToTheLock.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.valueAddedServices.tr, rightTitle:"", isHaveDirection: true, action: (){ + + }), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.about.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + SizedBox(height: 10.h,), + CommonItem(leftTitel:TranslationLoader.lanKeys.userAgreement.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.privacyPolicy.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.personalInformationCollectionList.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.applicationPermissionDescription.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.thirdPartyInformationSharingList.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ + + }), + ], + ), + ), + keyBottomWidget() + ], + ) + ); + } + + Widget keyBottomWidget() { + return Column( + children: [ + SubmitBtn(btnName: TranslationLoader.lanKeys.logout.tr, + borderRadius: 20.w, + fontSize: 32.sp, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + Container( + padding: EdgeInsets.only(right: 30.w), + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + child: Text( TranslationLoader.lanKeys.deleteAccount.tr, style: TextStyle(color: AppColors.mainColor, fontWeight: FontWeight.w500),), + onPressed: () { + + }, + ), + ], + ), + ), + SizedBox(height: 30.h,) + ], + ); + } + + Switch _switch(){ + return Switch( + value: false, + onChanged: (value){ + // switchValue = !switchValue; + setState(() { + + }); + } + ); + } +} diff --git a/star_lock/lib/mine/mine_page.dart b/star_lock/lib/mine/mine_page.dart new file mode 100644 index 00000000..20691d1a --- /dev/null +++ b/star_lock/lib/mine/mine_page.dart @@ -0,0 +1,130 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../appRouters.dart'; +import '../app_settings/app_colors.dart'; +import '../baseWidget.dart'; +import '../tools/titleAppBar.dart'; +import '../translations/trans_lib.dart'; + +class StarLockMinePage extends StatefulWidget { + const StarLockMinePage({Key key}) : super(key: key); + + @override + State createState() => _StarLockMinePageState(); +} + +GlobalKey<_StarLockMinePageState> starLockMineKey = GlobalKey(); +class _StarLockMinePageState extends State with BaseWidget{ + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xFFFFFFFF), + // appBar: TitleAppBar(barTitle: "", haveBack:false, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + topWidget(), + bottomListWidget() + ], + ), + ); + } + + Widget topWidget(){ + return Container( + height: 450.h, + width: 1.sw, + color: AppColors.mainColor, + // color: Colors.red, + child: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 120.h,), + GestureDetector( + onTap: (){ + Navigator.pushNamed(context, Routers.starLockLoginPage); + }, + child: Container( + width: 150.w, height: 150.w, + decoration: BoxDecoration( + border: Border.all(width: 2, color: Colors.white), + borderRadius: BorderRadius.circular(60.h), + ), + padding: EdgeInsets.all(20.w), + child: Image.asset('images/mine/icon_mine_main_defaultAvatar.png', width: 100.w, height: 100.w) + ), + ), + SizedBox(height: 20.h,), + Text("15080825640", style: TextStyle(fontSize: 30.sp, color: Colors.white, fontWeight: FontWeight.w500)), + SizedBox(height: 10.h,), + Text("账号:15080825640", style: TextStyle(fontSize: 22.sp, color: Colors.white, fontWeight: FontWeight.w500)), + ], + ), + ); + } + + Widget bottomListWidget(){ + return Expanded( + child: ListView( + padding: EdgeInsets.only(left: 110.w, top: 80.h, right: 10.w), + children: [ + mineItem('images/mine/icon_mine_main_addLock.png', TranslationLoader.lanKeys.addLock.tr, (){ + Navigator.pushNamed(context, Routers.seletLockTypePage); + }), + mineItem('images/mine/icon_mine_main_gateway.png', TranslationLoader.lanKeys.gateway.tr, (){ + + }), + mineItem('images/mine/icon_mine_main_message.png', TranslationLoader.lanKeys.message.tr, (){ + + }), + mineItem('images/mine/icon_mine_main_supportStaff.png', TranslationLoader.lanKeys.supportStaff.tr, (){ + + }), + mineItem('images/mine/icon_mine_main_set.png', TranslationLoader.lanKeys.set.tr, (){ + Navigator.pushNamed(context, Routers.mineSetPage); + }), + mineItem('images/mine/icon_mine_main_moreServices.png', TranslationLoader.lanKeys.moreServices.tr, (){ + + }), + ], + ), + ); + } + + Widget mineItem(String lockTypeIcon, String lockTypeTitle, Function action){ + return GestureDetector( + onTap: action, + child: Row( + children: [ + Center( + child: Container( + height: 80.h, + width: 300.w, + color: Colors.white, + child: Row( + children: [ + SizedBox(width:20.w), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width:10.w), + Text(lockTypeTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + ), + Container(height: 0.5.h, color: Colors.grey,) + ], + ), + ); + } + + void onShow(){ + + } + + void onHide(){ + + } +} + diff --git a/star_lock/lib/navPages.dart b/star_lock/lib/navPages.dart new file mode 100644 index 00000000..4a3477f2 --- /dev/null +++ b/star_lock/lib/navPages.dart @@ -0,0 +1,83 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:star_lock/mine/mine_page.dart'; + +import 'app_settings/app_colors.dart'; +import 'main/lockMian/lockMain_page.dart'; + +class NavPages extends StatefulWidget { + const NavPages({Key key}) : super(key: key); + + @override + State createState() => _NavPagesState(); +} + +class _NavPagesState extends State { + int _currentIndex = 0; + final List _listPage = [ + StarLockMain(), + // StarLockMinePage(key: starLockMineKey), + ]; + + @override + Widget build(BuildContext context) { + var sp; + return Scaffold( + body: IndexedStack( + /// 在这里修改 + // index: _currentIndex, + children: _listPage, + ), + // bottomNavigationBar: BottomNavigationBar( + // elevation: 0.0, + // selectedFontSize: 24.sp, + // unselectedFontSize: 24.sp, + // type: BottomNavigationBarType.fixed, + // selectedItemColor: AppColors.mainColor, + // backgroundColor: Colors.white, + // currentIndex: _currentIndex, //对应点击/显示哪个底部导航栏按钮 + // onTap: (index) { + // //bottomNavigationBar的点击事件 + // if (_currentIndex == index) { + // return; + // } + // setState(() { + // _currentIndex = index; //将选中的下标进行替换 + // }); + // if (_currentIndex == 0) { + // starLockMainKey.currentState?.onShow(); + // starLockMineKey.currentState?.onHide(); + // } else if (_currentIndex == 1) { + // starLockMainKey.currentState?.onHide(); + // starLockMineKey.currentState?.onShow(); + // } + // }, + // items: [ + // BottomNavigationBarItem( + // icon: SizedBox( + // width: 56.w, + // height: 56.w, + // child: Image.asset( + // _currentIndex == 0 + // ? 'images/tabbar/icon_tab_main_selet.png' + // : 'images/tabbar/icon_tab_main_unselet.png', + // fit: BoxFit.cover), + // ), + // label: '首页'), + // BottomNavigationBarItem( + // icon: SizedBox( + // width: 56.w, + // height: 56.w, + // child: Image.asset( + // _currentIndex == 1 + // ? 'images/tabbar/icon_tab_my_selet.png' + // : 'images/tabbar/icon_tab_my_unselet.png', + // fit: BoxFit.cover), + // ), + // label: '我的'), + // ], + // ), + ); + } +} diff --git a/star_lock/lib/starLockApplication.dart b/star_lock/lib/starLockApplication.dart new file mode 100644 index 00000000..200b87ac --- /dev/null +++ b/star_lock/lib/starLockApplication.dart @@ -0,0 +1,20 @@ + +import 'package:flutter/material.dart'; + +import 'navPages.dart'; + +class StarLockApplication extends StatefulWidget { + const StarLockApplication({Key key}) : super(key: key); + + @override + State createState() => _StarLockApplicationState(); +} + +class _StarLockApplicationState extends State { + + + @override + Widget build(BuildContext context) { + return NavPages(); + } +} diff --git a/star_lock/lib/tools/CustomUnderlineTabIndicator.dart b/star_lock/lib/tools/CustomUnderlineTabIndicator.dart new file mode 100644 index 00000000..aa0fa653 --- /dev/null +++ b/star_lock/lib/tools/CustomUnderlineTabIndicator.dart @@ -0,0 +1,92 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +// ------------------------------------------------------ +// author:AllenSu +// date :2021/4/18 11:23 AM +// usage :自定义 UnderlineTabIndicator +// CSDN :https://blog.csdn.net/qq_42351033 +// ------------------------------------------------------ + +class CustomUnderlineTabIndicator extends Decoration { + final BorderSide borderSide; + final EdgeInsetsGeometry insets; + final StrokeCap strokeCap; // 控制器的边角形状 + final double width; // 控制器的宽度 + + const CustomUnderlineTabIndicator({ + this.borderSide = const BorderSide(width: 2, color: Colors.white), + this.insets = EdgeInsets.zero, + this.strokeCap: StrokeCap.square, + this.width: 20, + }) : assert(borderSide != null), + assert(insets != null); + + @override + Decoration lerpFrom(Decoration a, double t) { + if (a is CustomUnderlineTabIndicator) { + return CustomUnderlineTabIndicator( + borderSide: BorderSide.lerp(a.borderSide, borderSide, t), + insets: EdgeInsetsGeometry.lerp(a.insets, insets, t), + ); + } + return super.lerpFrom(a, t); + } + + @override + Decoration lerpTo(Decoration b, double t) { + if (b is CustomUnderlineTabIndicator) { + return CustomUnderlineTabIndicator( + borderSide: BorderSide.lerp(borderSide, b.borderSide, t), + insets: EdgeInsetsGeometry.lerp(insets, b.insets, t), + ); + } + return super.lerpTo(b, t); + } + + @override + _UnderlinePainter createBoxPainter([VoidCallback onChanged]) { + return _UnderlinePainter(this, onChanged); + } + + @override + Path getClipPath(Rect rect, TextDirection textDirection) { + return Path()..addRect(_indicatorRectFor(rect, textDirection)); + } + + Rect _indicatorRectFor(Rect rect, TextDirection textDirection) { + assert(rect != null); + assert(textDirection != null); + final Rect indicator = insets.resolve(textDirection).deflateRect(rect); + + // 希望的宽度 + double wantWidth = this.width; + // 取中间坐标 + double cw = (indicator.left + indicator.right) / 2; + // 这里是核心代码 + return Rect.fromLTWH(cw - wantWidth / 2, + indicator.bottom - borderSide.width, wantWidth, borderSide.width); + } +} + +class _UnderlinePainter extends BoxPainter { + _UnderlinePainter(this.decoration, VoidCallback onChanged) + : assert(decoration != null), + super(onChanged); + + final CustomUnderlineTabIndicator decoration; + + @override + void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) { + assert(configuration != null); + assert(configuration.size != null); + final Rect rect = offset & configuration.size; + final TextDirection textDirection = configuration.textDirection; + final Rect indicator = decoration + ._indicatorRectFor(rect, textDirection) + .deflate(decoration.borderSide.width / 2); + final Paint paint = decoration.borderSide.toPaint() + ..strokeCap = decoration.strokeCap; // 这里修改控制器边角的形状 + canvas.drawLine(indicator.bottomLeft, indicator.bottomRight, paint); + } +} \ No newline at end of file diff --git a/star_lock/lib/tools/app_manager.dart b/star_lock/lib/tools/app_manager.dart new file mode 100644 index 00000000..7a5474a0 --- /dev/null +++ b/star_lock/lib/tools/app_manager.dart @@ -0,0 +1,45 @@ + +import 'package:package_info_plus/package_info_plus.dart'; + +class AppManager { + + String appName = ''; + String packageName = ''; + String version = ''; + String buildNumber = ''; + String platformName = ''; + String get showVersion =>'$version.$buildNumber'; + + static AppManager _manager; + AppManager._init(); + + static AppManager shareManager(){ + _manager ??= AppManager._init(); + return _manager; + } + + factory AppManager() => shareManager(); + AppManager get manager => shareManager(); + + //当前应用的语言 + String _languageCode = 'en-US'; + void setLanCode({String code})=>_languageCode = code; + String get languageCode => _languageCode; + + //设备唯一标识 + String _deviceID = ''; + void saveDeviceID(String id){ + _deviceID = id; + } + + Future initPackageInfo() async { + PackageInfo packageInfo = await PackageInfo.fromPlatform(); + AppManager().appName = packageInfo.appName; + AppManager().packageName = packageInfo.packageName; + AppManager().version = packageInfo.version; + AppManager().buildNumber = packageInfo.buildNumber; + } + + String get deviceId =>_deviceID; + +} \ No newline at end of file diff --git a/star_lock/lib/tools/commonItem.dart b/star_lock/lib/tools/commonItem.dart new file mode 100644 index 00000000..f0285f84 --- /dev/null +++ b/star_lock/lib/tools/commonItem.dart @@ -0,0 +1,50 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class CommonItem extends StatelessWidget { + String leftTitel; + String rightTitle; + bool isHaveDirection; + bool isHaveLine; + bool isHaveRightWidget; + Widget rightWidget; + Function action; + double allHeight; + + CommonItem({Key key,@required this.leftTitel, this.rightTitle, this.allHeight, this.isHaveDirection = false, this.isHaveLine = false, this.isHaveRightWidget = false, this.rightWidget, this.action}) : super(key: key); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: action, + child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: allHeight??70.h, + color: Colors.white, + padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + child: Row( + children: [ + SizedBox(width:20.w), + Expanded(child: Text(leftTitel, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500))), + SizedBox(width:20.w), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + isHaveRightWidget?rightWidget:Text(rightTitle, textAlign: TextAlign.end, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),) + ], + ), + SizedBox(width:5.w), + isHaveDirection?Image.asset('images/icon_right.png', width: 50.w, height: 50.w,):SizedBox(width:10.w), + // SizedBox(width:10.w), + ], + ), + ), + isHaveLine?Container(height: 0.5.h, color: Colors.grey,):Container() + ], + ), + ); + } +} diff --git a/star_lock/lib/tools/device_info_service.dart b/star_lock/lib/tools/device_info_service.dart new file mode 100644 index 00000000..0ceaafdb --- /dev/null +++ b/star_lock/lib/tools/device_info_service.dart @@ -0,0 +1,42 @@ + +import 'dart:io'; +import 'package:device_info_plus/device_info_plus.dart'; +import 'package:get/get.dart'; +import '../../app_settings/app_settings.dart'; +import 'app_manager.dart'; +import 'store_service.dart'; +import 'package:uuid/uuid.dart'; + +class DeviceInfoService extends GetxService { + static DeviceInfoService get to => Get.find(); + + String _deviceID = ''; + String get deviceID => _deviceID; + + Future init() async { + DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); + var dId = StoreService.to.getDeviceId(); + if(dId.isEmpty){ + dId = const Uuid().v1(); + print('初始化设备ID:$dId'); + StoreService.to.saveDeviceId(dId); + } + _deviceID = dId; + + if(Platform.isAndroid){ + AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; + AppPlatform.setBrandString(androidInfo.brand); + AndroidBuildVersion buildVersion = androidInfo.version; + AppPlatform.setSDKInt(buildVersion.sdkInt); + } + + if(Platform.isIOS){ + IosDeviceInfo iosInfo = await deviceInfo.iosInfo; + } + AppManager().saveDeviceID(deviceID); + print(AppManager().deviceId); + return this; + } + + +} \ No newline at end of file diff --git a/star_lock/lib/tools/forgetPwdInput.dart b/star_lock/lib/tools/forgetPwdInput.dart new file mode 100644 index 00000000..928f5df4 --- /dev/null +++ b/star_lock/lib/tools/forgetPwdInput.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ForgetPwdInput extends StatelessWidget { + TextEditingController controller; + List inputFormatters; + TextInputType keyboardType; + String hintText; + String label; + Widget rightSlot; + bool isPwd; + ForgetPwdInput({Key key,this.rightSlot,this.isPwd,this.label,this.hintText,this.keyboardType,this.inputFormatters, @required this.controller}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Row( + children: [ + SizedBox(width: 90.w, height: 40.w,), + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only( + top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), + hintText: hintText, + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + rightSlot??const SizedBox(width: 0,height: 0) + ], + ), + ), + Container(height: 0.5.h, color: Colors.grey,), + ], + ); + } +} diff --git a/star_lock/lib/tools/jh_pop_menus.dart b/star_lock/lib/tools/jh_pop_menus.dart new file mode 100644 index 00000000..42f6fab7 --- /dev/null +++ b/star_lock/lib/tools/jh_pop_menus.dart @@ -0,0 +1,220 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'screen_utils.dart'; + +List _listData = [ + {'text': '读取记录'}, + {'text': '清空记录'}, + {'text': '导出记录'}, +]; + +const Color _bgColor = Color(0xFF2D2D2D); +const double _fontSize = 16.0; +const double _cellHeight = 50.0; +const double _imgWH = 22.0; + +class JhPopMenus { + /// 显示pop + static void show( + BuildContext context, { + Function(int selectIndex, String selectText) clickCallback, + }) { + // Cell + Widget buildMenuCell(dataArr) { + return ListView.builder( + itemCount: dataArr.length, + itemExtent: _cellHeight, + padding: const EdgeInsets.all(0.0), + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (BuildContext context, int index) { + return Material( + color: _bgColor, + child: InkWell( + onTap: () { + clickCallback?.call(index, _listData[index]['text']); + Navigator.pop(context); + }, + child: Row( + children: [ + const SizedBox(width: 25), + // Image.asset(dataArr[index]['icon'], width: _imgWH, height: _imgWH, color: Colors.white), + // const SizedBox(width: 15), + Text("你好", style: const TextStyle(color: Colors.white, fontSize: _fontSize)), + ], + ), + ), + ); + }, + ); + } + + Widget menusView(dataArr) { + var cellH = dataArr.length * _cellHeight; + var navH = JhScreenUtils.navigationBarHeight; + return Positioned( + right: 10, + top: navH - 10, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Image.asset('images/ic_menu_up_arrow.png', width: 28, height: 5), + ClipRRect( + borderRadius: BorderRadius.circular(5), + child: Container(color: _bgColor, width: 160, height: cellH, child: buildMenuCell(dataArr)), + ) + ], + ), + ); + } + + Navigator.of(context).push(DialogRouter(_BasePopMenus(child: menusView(_listData)))); + } + + /// 显示带线带背景 pop + static void showLinePop(BuildContext context, {bool isShowBg = false, Function(int selectIndex, String selectText) clickCallback,}) { + // 带线 + Widget buildMenuLineCell(dataArr) { + return ListView.separated( + itemCount: dataArr.length, + padding: const EdgeInsets.all(0.0), + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (BuildContext context, int index) { + return Material( + color: _bgColor, + child: InkWell( + onTap: () { + clickCallback?.call(index, _listData[index]['text']); + Navigator.pop(context); + }, + child: Container( + height: _cellHeight, + padding: EdgeInsets.only(left: 20.h), + child: Row( + children: [ + // const SizedBox(width: 25), + // Image.asset(dataArr[index]['icon'], width: _imgWH, height: _imgWH, color: Colors.white), + // const SizedBox(width: 12), + Center(child: Text(dataArr[index]['text'], style: const TextStyle(color: Colors.white, fontSize: _fontSize))) + ], + ), + ), + ), + ); + }, + separatorBuilder: (context, index) => + const Divider(height: .1, indent: 50, endIndent: 0, color: Color(0xFFE6E6E6)), + ); + } + + Widget menusView(dataArr) { + var cellH = dataArr.length * _cellHeight; + var navH = JhScreenUtils.navigationBarHeight; + if (isShowBg == true) { + navH = navH - JhScreenUtils.topSafeHeight; + } else { + navH = navH - 10; + } + return Positioned( + right: 10, + top: navH, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Image.asset('images/ic_menu_up_arrow.png', width: 28, height: 5), + ClipRRect( + borderRadius: BorderRadius.circular(5), + child: Container(color: _bgColor, width: 180.w, height: cellH, child: buildMenuLineCell(dataArr))) + ], + ), + ); + } + + if (isShowBg == true) { + // 带背景 + showDialog( + context: context, + barrierDismissible: false, + builder: (context) { + return _BasePopMenus(child: menusView(_listData)); + }, + ); + } else { + Navigator.of(context).push(DialogRouter(_BasePopMenus(child: menusView(_listData)))); + } + } +} + +class _BasePopMenus extends Dialog { + final child; + + const _BasePopMenus({ + Key key, + this.child, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Material( + type: MaterialType.transparency, + child: Stack( + fit: StackFit.expand, + children: [ + GestureDetector(onTap: () => Navigator.pop(context)), + // 内容 + child ?? Container() + ], + ), + ); + } +} + +class DialogRouter extends PageRouteBuilder { + final Widget page; + + DialogRouter(this.page) + : super( + opaque: false, + // 自定义遮罩颜色 + barrierColor: Colors.white10.withAlpha(1), + transitionDuration: const Duration(milliseconds: 150), + pageBuilder: (context, animation, secondaryAnimation) => page, + transitionsBuilder: (context, animation, secondaryAnimation, child) => child, + ); +} + +class CustomDialog extends Dialog { + final bool clickBgHidden; + final child; + + const CustomDialog({ + Key key, + this.child, + this.clickBgHidden = false, // 点击背景隐藏,默认不隐藏 + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Material( + // 透明层 + type: MaterialType.transparency, + child: Stack( + children: [ + InkWell( + onTap: () { + if (clickBgHidden == true) { + Navigator.pop(context); + } + }, + child: SizedBox( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + ), + ), + // 内容 + Center(child: child) + ], + ), + ); + } +} diff --git a/star_lock/lib/tools/loginInput.dart b/star_lock/lib/tools/loginInput.dart new file mode 100644 index 00000000..9c6a39fd --- /dev/null +++ b/star_lock/lib/tools/loginInput.dart @@ -0,0 +1,56 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +/* +* 登录注册页面 input +* */ + +class LoginInput extends StatelessWidget { + + TextEditingController controller; + List inputFormatters; + TextInputType keyboardType; + Color background; + String hintText; + String leftImg; + String label; + bool isPwd; + Widget rightSlot; + LoginInput({Key key, @required this.controller,this.rightSlot,this.label,this.isPwd,this.inputFormatters,this.keyboardType,this.background,this.hintText, this.leftImg}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + // color: Colors.red, + // width: 1.sp, + // height: 200.h, + child: Column( + children: [ + TextField( + //输入框一行 + maxLines: 1, + controller: controller, + autofocus: false, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only( + top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), + labelText: label, + hintText: hintText, + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + icon: (leftImg.isNotEmpty)?Padding( + padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: Image.asset(leftImg, width: 40.w, height: 40.w,), + ):SizedBox(width: 65.w, height: 40.w,), + ), + ), + Container(height: 0.5.h, color: Colors.grey,), + ], + ), + ); + } +} diff --git a/star_lock/lib/tools/noData.dart b/star_lock/lib/tools/noData.dart new file mode 100644 index 00000000..377d0d00 --- /dev/null +++ b/star_lock/lib/tools/noData.dart @@ -0,0 +1,17 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class NoData extends StatelessWidget { + const NoData({Key key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return SizedBox( + width: 1.sw, + height: 1.sh - ScreenUtil().statusBarHeight, + child: Center( + child: Image.asset('images/noData.png',width: 300.w,height: 240.w), + ), + ); + } +} diff --git a/star_lock/lib/tools/platform_info_services.dart b/star_lock/lib/tools/platform_info_services.dart new file mode 100644 index 00000000..c01304fd --- /dev/null +++ b/star_lock/lib/tools/platform_info_services.dart @@ -0,0 +1,14 @@ + +import 'package:get/get.dart'; +import 'package:package_info_plus/package_info_plus.dart'; + +class PlatformInfoService extends GetxService { + static PlatformInfoService get to => Get.find(); + PackageInfo _packageInfo; + PackageInfo get info => _packageInfo; + Future init() async { + PackageInfo packageInfo = await PackageInfo.fromPlatform(); + _packageInfo = packageInfo; + return this; + } +} \ No newline at end of file diff --git a/star_lock/lib/tools/screen_utils.dart b/star_lock/lib/tools/screen_utils.dart new file mode 100644 index 00000000..09061acc --- /dev/null +++ b/star_lock/lib/tools/screen_utils.dart @@ -0,0 +1,140 @@ +/// screen_utils.dart +/// +/// Created by iotjin on 2020/07/04. +/// description: 屏幕信息 + +import 'dart:ui' as ui show window; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class JhScreenUtils { + static init(BuildContext context) { + // 假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334) + ScreenUtil.init(context, designSize: const Size(750, 1334)); + } + + static setWidth(double width) { + ScreenUtil().setWidth(width); + } + + static setHeight(double height) { + ScreenUtil().setHeight(height); + } + + static setSp(num fontSize) { + ScreenUtil().setSp(fontSize); + } + + // static double get screenWidth => ScreenUtil.screenWidth; + // + // static double get screenHeight => ScreenUtil.screenHeight; + + // static double get screenWidthPx => ScreenUtil.screenWidthPx; + // + // static double get screenHeightPx => ScreenUtil.screenHeightPx; + // + // static double get statusBarHeight => ScreenUtil.statusBarHeight; + // + // static double get bottomBarHeight => ScreenUtil.bottomBarHeight; + + // 系统方法获取 + + static double get screenWidth { + MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window); + return mediaQuery.size.width; + } + + static double get screenHeight { + MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window); + return mediaQuery.size.height; + } + + static double get scale { + MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window); + return mediaQuery.devicePixelRatio; + } + + static double get textScaleFactor { + MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window); + return mediaQuery.textScaleFactor; + } + + static double get navigationBarHeight { + MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window); + return mediaQuery.padding.top + kToolbarHeight; + } + + static double get topSafeHeight { + MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window); + return mediaQuery.padding.top; + } + + static double get bottomSafeHeight { + MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window); + return mediaQuery.padding.bottom; + } + + static updateStatusBarStyle(SystemUiOverlayStyle style) { + SystemChrome.setSystemUIOverlayStyle(style); + } +} + +/* + +ScreenUtil.pixelRatio // 设备的像素密度 +ScreenUtil.screenWidth // 设备宽度 +ScreenUtil.screenHeight // 设备高度 +ScreenUtil.bottomBarHeight // 底部安全区距离,适用于全面屏下面有按键的 +ScreenUtil.statusBarHeight // 状态栏高度 刘海屏会更高 单位px +ScreenUtil.textScaleFactory // 系统字体缩放比例 + +ScreenUtil.getInstance().scaleWidth // 实际宽度的dp与设计稿px的比例 +ScreenUtil.getInstance().scaleHeight // 实际高度的dp与设计稿px的比例 + + +width:ScreenUtil().setWidth(100) +height:ScreenUtil().setHeight(80) + +Container( +width: 50.w, +height:200.h +) + +fontSize: ScreenUtil().setSp(28) + +fontSize: ScreenUtil.getInstance().setSp(24), +fontSize: ScreenUtil(allowFontScaling: true).setSp(24), + + +print('设备宽度:${ScreenUtil.screenWidth}'); //Device width +print('设备高度:${ScreenUtil.screenHeight}'); //Device height +print('设备的像素密度:${ScreenUtil.pixelRatio}'); //Device pixel density +print('底部安全区距离:${ScreenUtil.bottomBarHeight}'); //Bottom safe zone distance,suitable for buttons with full screen +print('状态栏高度:${ScreenUtil.statusBarHeight}px'); +print('实际宽度的dp与设计稿px的比例:${ScreenUtil.getInstance().scaleWidth}'); +print('实际高度的dp与设计稿px的比例:${ScreenUtil.getInstance().scaleHeight}'); +print( '宽度和字体相对于设计稿放大的比例:${ScreenUtil.getInstance().scaleWidth * ScreenUtil.pixelRatio}'); +print( '高度相对于设计稿放大的比例:${ScreenUtil.getInstance().scaleHeight * ScreenUtil.pixelRatio}'); +print('系统的字体缩放比例:${ScreenUtil.textScaleFactor}'); + +*/ + +/* + 屏幕宽度高度:MediaQuery.of(context).size.width + 屏幕宽度高度:MediaQuery.of(context).size.height + 屏幕状态栏高度:MediaQueryData.fromWindow(WidgetBinding.instance.window).padding.top。 + + MediaQueryData mq = MediaQuery.of(context); + // 屏幕密度 + pixelRatio = mq.devicePixelRatio; + // 屏幕宽(注意是dp, 转换px 需要 screenWidth * pixelRatio) + screenWidth = mq.size.width; + // 屏幕高(注意是dp) + screenHeight = mq.size.height; + // 顶部状态栏, 随着刘海屏会增高 + statusBarHeight = mq padding.top; + // 底部功能栏, 类似于iPhone XR 底部安全区域 + bottomBarHeight = mq.padding.bottom; + +*/ diff --git a/star_lock/lib/tools/showBottomSheetTool.dart b/star_lock/lib/tools/showBottomSheetTool.dart new file mode 100644 index 00000000..186492e4 --- /dev/null +++ b/star_lock/lib/tools/showBottomSheetTool.dart @@ -0,0 +1,107 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_picker/flutter_picker.dart'; + +///2023/7/17 +///底部弹出选择器工具类 +typedef StringClickCallback = void Function(int selectIndex, Object selectStr); +typedef ArrayClickCallback = void Function(List selecteds, List strData); +typedef DateClickCallback = void Function(dynamic selectDateStr, dynamic selectDate); + +class ShowBottomSheetTool { + //选择器的高度 + double pickerHeight; + //单行的高度 + double itemHeight; + //按钮颜色 + Color btnColor; + //文本颜色 + Color titleColor; + //字体大小 + double textFontSize; + + ShowBottomSheetTool( + {this.pickerHeight = 200.0, + this.itemHeight = 45.0, + this.btnColor = Colors.black, + this.titleColor = const Color.fromRGBO(127, 127, 127, 1.0), + this.textFontSize = 16.0}); + + ///单列 + void showSingleRowPicker( + BuildContext context, { + @required List data, + String title, + String cancelTitle, + String sureTitle, + int normalIndex, + PickerDataAdapter adapter, + @required StringClickCallback clickCallBack, + }) { + openPicker(context, + title: title, + cancelTitle: cancelTitle, + sureTitle: sureTitle, + selecteds: [normalIndex ?? 0], + adapter: adapter ?? PickerDataAdapter(pickerData: data, isArray: false), + clickCallBack: (Picker picker, List selecteds) { + clickCallBack(selecteds[0], data[selecteds[0]]); + }); + } + + ///多列 + void showArrayPicker( + BuildContext context, { + @required List data, + String title, + List normalIndex, + PickerDataAdapter adapter, + @required ArrayClickCallback clickCallBack, + }) { + openPicker(context, + selecteds: normalIndex, + title: title, + adapter: adapter ?? PickerDataAdapter(pickerData: data, isArray: true), + clickCallBack: (Picker picker, List selecteds) { + clickCallBack(selecteds, picker.getSelectedValues()); + }); + } + + void openPicker( + BuildContext context, { + @required PickerAdapter adapter, + String title, + String cancelTitle, + String sureTitle, + List selecteds, + @required PickerConfirmCallback clickCallBack, + }) { + Picker( + adapter: adapter, + title: Text( + title ?? "请选择", + style: TextStyle( + color: titleColor, + fontSize: textFontSize, + ), + ), + selecteds: selecteds, + confirmText: sureTitle??'确定', + cancelText: cancelTitle??'取消', + cancelTextStyle: TextStyle( + color: btnColor, + fontSize: textFontSize, + ), + confirmTextStyle: TextStyle( + color: btnColor, + fontSize: textFontSize, + ), + textAlign: TextAlign.right, + itemExtent: itemHeight, + height: pickerHeight, + selectedTextStyle: TextStyle( + color: Colors.black, + ), + onConfirm: clickCallBack, + ).showModal(context); + } +} \ No newline at end of file diff --git a/star_lock/lib/tools/store_service.dart b/star_lock/lib/tools/store_service.dart new file mode 100644 index 00000000..1fd46669 --- /dev/null +++ b/star_lock/lib/tools/store_service.dart @@ -0,0 +1,57 @@ +import 'package:get/get.dart'; +import 'package:get_storage/get_storage.dart'; + +final box = GetStorage(); +class StoreService extends GetxService { + + static StoreService get to => Get.find(); + Future> init() async { + await GetStorage.init(); + // await resetUserInfo(); + return this; + } + + Future save(String key, dynamic value) => box.write(key, value); + T read(String key) => box.read(key); + Future remove(String key) => box.remove(key); + bool hasData(String key) => box.hasData(key); + + + final String _loginUserInfoKey = 'LOGIN_USER_INFO'; + final String _deviceUUID = 'DEVICE_ID'; + final String _languageCode = 'LANGUAGE_CODE'; + final String _userAccount = 'USER_ACCOUNT'; + + + // LoginEntity _loginEntity; + // LoginEntity get loginEntity => _loginEntity; + // Future resetUserInfo() async{ + // if(hasData(_loginUserInfoKey)){ + // _loginEntity = LoginEntity.fromJson(box.read(_loginUserInfoKey)); + // } + // } + // Future removeUserInfo() => remove(_loginUserInfoKey); + // + // Future saveLogInInfo(LoginEntity entity) { + // _loginEntity = LoginEntity.fromJson(entity.toJson()); + // save(_loginUserInfoKey, entity.toJson()); + // if(_loginEntity != null && _loginEntity.data != null && _loginEntity.data.email != null && _loginEntity.data.email.isNotEmpty) { + // save(_userAccount, _loginEntity.data.email); + // } + // } + + String getDeviceId() => hasData(_deviceUUID) ? read(_deviceUUID): ""; + Future saveDeviceId(String uuid) => save(_deviceUUID, uuid); + + String getLanguageCode() => hasData(_languageCode) ? read(_languageCode): ""; + Future saveLanguageCode(String code) => save(_languageCode, code); + + // bool get hadToken => loginEntity != null && loginEntity.data.token != null && loginEntity.data.token.isNotEmpty; + // String get userToken => hadToken ? loginEntity.data.token : ""; + + String getLastUserAccount() => hasData(_userAccount) ? read(_userAccount): ""; + void removeLastUserAccount() => remove(_userAccount); + + String get localUserAccount => getLastUserAccount(); + +} diff --git a/star_lock/lib/tools/submitBtn.dart b/star_lock/lib/tools/submitBtn.dart new file mode 100644 index 00000000..44d7fef3 --- /dev/null +++ b/star_lock/lib/tools/submitBtn.dart @@ -0,0 +1,71 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../app_settings/app_colors.dart'; + + +/* +* 提交按钮 公用组件 +* */ + +class SubmitBtn extends StatelessWidget { + + String btnName; + + Function onClick; + + EdgeInsetsGeometry margin; + + EdgeInsetsGeometry padding; + + double width; + + double fontSize; + + Color color; + + List backgroundColorList; + + double borderRadius; + + SubmitBtn({Key key,@required this.btnName,this.borderRadius,this.color,this.padding,this.onClick,this.margin,this.width,this.backgroundColorList,this.fontSize}) : super(key: key); + + @override + Widget build(BuildContext context) { + return GestureDetector( + child: Container( + width: width??690.w, + padding: padding??EdgeInsets.only( + top: 20.w, + bottom: 20.w + ), + margin: margin??EdgeInsets.only(top: 30.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(borderRadius??30.w), + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: backgroundColorList??[ + AppColors.mainColor,AppColors.mainColor, + ], + ) + ), + child: Center( + child: Text(btnName,style: TextStyle( + fontSize: fontSize??36.sp, + height: 1.3, + decoration: TextDecoration.none, + fontWeight: FontWeight.w500, + color: color??Colors.white + )), + ), + ), + onTap: (){ + if(onClick!=null){ + onClick(); + } + }, + ); + } +} diff --git a/star_lock/lib/tools/titleAppBar.dart b/star_lock/lib/tools/titleAppBar.dart new file mode 100644 index 00000000..9d5b302c --- /dev/null +++ b/star_lock/lib/tools/titleAppBar.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class TitleAppBar extends AppBar { + + @override + final Color backgroundColor; + final String barTitle; + final Color titleColor; + final Color iconColor; + final bool haveBack; + final bool haveOtherLeftWidget; + final Widget leftWidget; + List actionsList; + + TitleAppBar({Key key,this.barTitle,this.titleColor,this.iconColor,this.backgroundColor,this.actionsList, this.haveBack, this.haveOtherLeftWidget = false , this.leftWidget}) : super(key: key); + + @override + _TitleAppBarState createState() => _TitleAppBarState(); + +} + +class _TitleAppBarState extends State { + @override + Widget build(BuildContext context) { + return AppBar( + elevation: 0, + leading:widget.haveOtherLeftWidget?widget.leftWidget:(widget.haveBack?IconButton( + icon: Icon(Icons.arrow_back_ios,color: widget.iconColor??Colors.white), + onPressed: () => Navigator.of(context).pop(), + ):Container()), + backgroundColor: widget.backgroundColor??Colors.white, + title: Text(widget.barTitle??'', style: TextStyle(color: widget.titleColor??Colors.white,fontSize: 36.sp, fontWeight:FontWeight.w500)), + centerTitle: true, + actions: widget.actionsList??[] + ); + } +} diff --git a/star_lock/lib/translations/app_dept.dart b/star_lock/lib/translations/app_dept.dart new file mode 100644 index 00000000..638defd5 --- /dev/null +++ b/star_lock/lib/translations/app_dept.dart @@ -0,0 +1,79 @@ + +import 'dart:convert'; +import 'dart:ui'; +import 'package:flutter/services.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/translations/trans_lib.dart'; + +import '../tools/app_manager.dart'; + +enum AppDept { + cdl, +} + +extension ExtensionAppDept on AppDept { + + static AppDept fromAppPackageName(String packageName) { + AppDept dept = AppDept.cdl; + packageName = packageName.toLowerCase(); + if(packageName.contains('cdl')){ + dept = AppDept.cdl; + } + return dept; + } + + List get deptSupportedLocales { + Locale enL = const Locale('en', 'US'); + Locale zhL = const Locale('zh', 'CN'); + + return [enL,zhL]; + } + +} + +AppDept appDept = ExtensionAppDept.fromAppPackageName(AppManager().packageName); + +final List appSupportedLocales = appDept.deptSupportedLocales; + +enum LanguageType { + chinese, + english, + deutsch, // 德语 + francais, // 法语 + italiano, // 意大利 + dutch, // 荷兰语 + spanish, // 西班牙 + czech, // 捷克语 + slovak // 斯洛伐克语 +} + +extension ExtensionLanguageType on LanguageType { + String get lanTitle { + var str = ''; + switch(this){ + case LanguageType.english: + str = TranslationLoader.lanKeys.lanEnglish.tr; + break; + case LanguageType.chinese: + str = TranslationLoader.lanKeys.lanChinese.tr; + break; + + } + return str; + } + + static LanguageType fromLanguageCode(String code) { + LanguageType languageType = LanguageType.english; + switch(code.toLowerCase()){ + case 'en': + languageType = LanguageType.english; + break; + case 'zh': + languageType = LanguageType.chinese; + break; + + } + return languageType; + } + +} \ No newline at end of file diff --git a/star_lock/lib/translations/lanKeyEntity.dart b/star_lock/lib/translations/lanKeyEntity.dart new file mode 100644 index 00000000..c161a23b --- /dev/null +++ b/star_lock/lib/translations/lanKeyEntity.dart @@ -0,0 +1,833 @@ +class LanKeyEntity { + LanKeyEntity({ + this.starLock, + this.clickUnlockAndHoldDownClose, + this.checkingIn, + this.electronicKey, + this.password, + this.card, + this.fingerprint, + this.remoteControl, + this.operatingRecord, + this.number, + this.additive, + this.addTime, + + this.reset, + this.sendKey, + this.timeLimit, + this.permanent, + this.once, + this.circulation, + this.receiver, + this.pleaseEnterNumberOrEmail, + this.name, + this.enterYourName, + this.effectiveTime, + this.failureTime, + this.effectiveDate, + this.failureDate, + this.Monday, + this.Tuesday, + this.Wednesday, + this.Thursday, + this.Friday, + this.Saturday, + this.Sunday, + + this.realNameAuthentication, + this.sendKeyBottomTip, + this.send, + this.periodValidity, + this.sendGroupKey, + this.lock, + this.pleaseAdd, + this.pleaseSelet, + this.remoteUnlockingAllowed, + this.pleaseEnter, + this.getPassword, + this.custom, + this.clearAll, + this.recursiveDevice, + this.pleaseNameYourPassword, + this.pleaseEnterDigitsNumber, + this.getPasswordTip1, + this.getPasswordTip2, + this.getPasswordTip3, + this.getPasswordTip4, + this.getPasswordTip5, + this.getPasswordTip6, + this.getTip, + this.addTip, + this.sender, + this.senderTime, + this.keyDetail, + this.detail, + this.delete, + this.passwordDetail, + this.share, + this.amend, + this.sure, + this.cancel, + this.add, + this.accountNumber, + this.volumeAuthorizationLock, + this.authorizedAdminTip, + this.lockOperatingRecordTip, + + this.basicInformation, + this.wirelessKeyboard, + this.doorMagnetic, + this.remoteUnlocking, + this.automaticBlocking, + this.normallyOpenMode, + this.lockSound, + this.burglarAlarm, + this.resetButton, + this.lockTime, + this.diagnose, + this.uploadData, + this.importOtherLockData, + this.lockEscalation, + this.markedHouseState, + this.unlockReminder, + this.unlockQRCode, + this.lockNumber, + this.electricQuantity, + this.lockName, + this.lockGrouping, + this.adminOpenLockPassword, + this.update, + this.updateElectricQuantityTip, + this.adminOpenLockPasswordTip, + this.updateLockAdminPassword, + this.whenScreenFlashesClickNext, + this.theScreenNeverFlickered, + this.enterNumberOrPressSet, + this.theLocationOfTheSetKeyWillBeDifferent, + this.pressAndHoldTheResetButtonTwoSeconds, + this.nearbyEquipment, + this.noData, + this.doorMagneticListTopTip, + this.remoteUnlockingPageTip, + this.currentMode, + this.delayTime, + this.automaticBlockingTip, + this.time, + this.normallyOpen, + this.date, + this.begin, + this.end, + this.allDay, + this.save, + this.normallyOpenModeTip, + this.pleaseSeletLockVolume, + this.lockSoundTip, + this.low, + this.lower, + this.medium, + this.high, + this.higher, + this.burglarAlarmTip, + this.resetButtonTip, + this.calibrationTime, + this.setTheDSTMode, + this.diagnoseTip, + this.uploading, + this.uploadDataTip, + this.importOtherLockDataTip, + this.haveNewVersion, + this.currentVersion, + this.newVersion, + this.upgrade, + this.leisure, + this.checkedIn, + + this.lanEnglish, + this.lanChinese, + this.multilingual, + this.addLock, + this.gateway, + this.message, + this.supportStaff, + this.set, + this.moreServices, + + this.moreSet, + this.prompTone, + this.touchUnlock, + this.pushNotification, + this.lockUserManagement, + this.authorizedAdmin, + this.lockGroup, + this.transferSmartLock, + this.transferGateway, + + this.multiLanguage, + this.lockScreen, + this.closed, + this.opened, + this.hideInvalidUnlockPermissions, + this.appUnlockRequiresMobilePhoneAccessToTheLock, + this.valueAddedServices, + this.about, + this.userAgreement, + this.privacyPolicy, + this.personalInformationCollectionList, + this.applicationPermissionDescription, + this.thirdPartyInformationSharingList, + this.logout, + this.deleteAccount, + + this.allLock, + this.searchAllLockType, + this.doorLock, + this.padlock, + this.safeLock, + this.intelligentLockCore, + this.parkingLock, + this.bicycleLock, + this.longRangeControl, + this.lightTouchScreen, + this.lightTouchScreenTip, + this.next, + this.nearbyLock, + this.addSuccessfullyPleaseRename, + this.whenAddingLockThePhoneMustBeNextToTheLock, + + this.login, + this.register, + this.forgetPassword, + this.readAndAgree, + this.verificationCode, + this.registerPasswordTip, + this.iphone, + this.email, + this.countryAndRegion, + this.selet + }); + + LanKeyEntity.fromJson(dynamic json) { + starLock = json['starLock']; + clickUnlockAndHoldDownClose = json['clickUnlockAndHoldDownClose']; + checkingIn = json['checkingIn']; + electronicKey = json['electronicKey']; + password = json['password']; + card = json['card']; + fingerprint = json['fingerprint']; + remoteControl = json['remoteControl']; + operatingRecord = json['operatingRecord']; + number = json['number']; + additive = json['additive']; + addTime = json['addTime']; + + reset = json['reset']; + sendKey = json['sendKey']; + timeLimit = json['timeLimit']; + permanent = json['permanent']; + once = json['once']; + circulation = json['circulation']; + receiver = json['receiver']; + pleaseEnterNumberOrEmail = json['pleaseEnterNumberOrEmail']; + name = json['name']; + enterYourName = json['enterYourName']; + effectiveTime = json['effectiveTime']; + failureTime = json['failureTime']; + effectiveDate = json['effectiveDate']; + failureDate = json['failureDate']; + Monday = json['Monday']; + Tuesday = json['Tuesday']; + Wednesday = json['Wednesday']; + Thursday = json['Thursday']; + Friday = json['Friday']; + Saturday = json['Saturday']; + Sunday = json['Sunday']; + + realNameAuthentication = json['realNameAuthentication']; + sendKeyBottomTip = json['sendKeyBottomTip']; + send = json['send']; + periodValidity = json['periodValidity']; + sendGroupKey = json['sendGroupKey']; + lock = json['lock']; + pleaseAdd = json['pleaseAdd']; + pleaseSelet = json['pleaseSelet']; + remoteUnlockingAllowed = json['remoteUnlockingAllowed']; + pleaseEnter = json['pleaseEnter']; + getPassword = json['getPassword']; + custom = json['custom']; + clearAll = json['clearAll']; + recursiveDevice = json['recursiveDevice']; + pleaseNameYourPassword = json['pleaseNameYourPassword']; + pleaseEnterDigitsNumber = json['pleaseEnterDigitsNumber']; + getPasswordTip1 = json['getPasswordTip1']; + getPasswordTip2 = json['getPasswordTip2']; + getPasswordTip3 = json['getPasswordTip3']; + getPasswordTip4 = json['getPasswordTip4']; + getPasswordTip5 = json['getPasswordTip5']; + getPasswordTip6 = json['getPasswordTip6']; + getTip = json['getTip']; + addTip = json['addTip']; + sender = json['sender']; + senderTime = json['senderTime']; + keyDetail = json['keyDetail']; + detail = json['detail']; + delete = json['delete']; + passwordDetail = json['passwordDetail']; + share = json['share']; + amend = json['amend']; + sure = json['sure']; + cancel = json['cancel']; + add = json['add']; + accountNumber = json['accountNumber']; + volumeAuthorizationLock = json['volumeAuthorizationLock']; + authorizedAdminTip = json['authorizedAdminTip']; + lockOperatingRecordTip = json['lockOperatingRecordTip']; + remoteUnlockingPageTip = json['remoteUnlockingPageTip']; + currentMode = json['currentMode']; + delayTime = json['delayTime']; + automaticBlockingTip = json['automaticBlockingTip']; + time = json['time']; + normallyOpen = json['normallyOpen']; + date = json['date']; + begin = json['begin']; + end = json['end']; + allDay = json['allDay']; + save = json['save']; + normallyOpenModeTip = json['normallyOpenModeTip']; + pleaseSeletLockVolume = json['pleaseSeletLockVolume']; + lockSoundTip = json['lockSoundTip']; + low = json['low']; + lower = json['lower']; + medium = json['medium']; + high = json['high']; + higher = json['higher']; + burglarAlarmTip = json['burglarAlarmTip']; + resetButtonTip = json['resetButtonTip']; + calibrationTime = json['calibrationTime']; + setTheDSTMode = json['setTheDSTMode']; + diagnoseTip = json['diagnoseTip']; + uploading = json['uploading']; + uploadDataTip = json['uploadDataTip']; + importOtherLockDataTip = json['importOtherLockDataTip']; + haveNewVersion = json['haveNewVersion']; + currentVersion = json['currentVersion']; + newVersion = json['newVersion']; + upgrade = json['upgrade']; + leisure = json['leisure']; + checkedIn = json['checkedIn']; + + basicInformation = json['basicInformation']; + wirelessKeyboard = json['wirelessKeyboard']; + doorMagnetic = json['doorMagnetic']; + remoteUnlocking = json['remoteUnlocking']; + automaticBlocking = json['automaticBlocking']; + normallyOpenMode = json['normallyOpenMode']; + lockSound = json['lockSound']; + burglarAlarm = json['burglarAlarm']; + resetButton = json['resetButton']; + lockTime = json['lockTime']; + diagnose = json['diagnose']; + uploadData = json['uploadData']; + importOtherLockData = json['importOtherLockData']; + lockEscalation = json['lockEscalation']; + markedHouseState = json['markedHouseState']; + unlockReminder = json['unlockReminder']; + unlockQRCode = json['unlockQRCode']; + lockNumber = json['lockNumber']; + electricQuantity = json['electricQuantity']; + lockName = json['lockName']; + lockGrouping = json['lockGrouping']; + adminOpenLockPassword = json['adminOpenLockPassword']; + update = json['update']; + updateElectricQuantityTip = json['updateElectricQuantityTip']; + adminOpenLockPasswordTip = json['adminOpenLockPasswordTip']; + updateLockAdminPassword = json['updateLockAdminPassword']; + whenScreenFlashesClickNext = json['whenScreenFlashesClickNext']; + theScreenNeverFlickered = json['theScreenNeverFlickered']; + enterNumberOrPressSet = json['enterNumberOrPressSet']; + theLocationOfTheSetKeyWillBeDifferent = json['theLocationOfTheSetKeyWillBeDifferent']; + pressAndHoldTheResetButtonTwoSeconds = json['pressAndHoldTheResetButtonTwoSeconds']; + nearbyEquipment = json['nearbyEquipment']; + noData = json['noData']; + doorMagneticListTopTip = json['doorMagneticListTopTip']; + + lanEnglish = json['lanEnglish']; + lanChinese = json['lanChinese']; + multilingual = json['multilingual']; + addLock = json['addLock']; + gateway = json['gateway']; + message = json['message']; + supportStaff = json['supportStaff']; + set = json['set']; + moreServices = json['moreServices']; + + moreSet = json['moreSet']; + prompTone = json['prompTone']; + touchUnlock = json['touchUnlock']; + pushNotification = json['pushNotification']; + lockUserManagement = json['lockUserManagement']; + authorizedAdmin = json['authorizedAdmin']; + lockGroup = json['lockGroup']; + transferSmartLock = json['transferSmartLock']; + transferGateway = json['transferGateway']; + + multiLanguage = json['multiLanguage']; + lockScreen = json['lockScreen']; + closed = json['closed']; + opened = json['opened']; + hideInvalidUnlockPermissions = json['hideInvalidUnlockPermissions']; + appUnlockRequiresMobilePhoneAccessToTheLock = json['appUnlockRequiresMobilePhoneAccessToTheLock']; + valueAddedServices = json['valueAddedServices']; + about = json['about']; + userAgreement = json['userAgreement']; + privacyPolicy = json['privacyPolicy']; + personalInformationCollectionList = json['personalInformationCollectionList']; + applicationPermissionDescription = json['applicationPermissionDescription']; + thirdPartyInformationSharingList = json['thirdPartyInformationSharingList']; + logout = json['logout']; + deleteAccount = json['deleteAccount']; + + allLock = json['allLock']; + searchAllLockType = json['searchAllLockType']; + doorLock = json['doorLock']; + padlock = json['padlock']; + safeLock = json['safeLock']; + intelligentLockCore = json['intelligentLockCore']; + parkingLock = json['parkingLock']; + bicycleLock = json['bicycleLock']; + longRangeControl = json['longRangeControl']; + lightTouchScreen = json['lightTouchScreen']; + lightTouchScreenTip = json['lightTouchScreenTip']; + next = json['next']; + nearbyLock = json['nearbyLock']; + addSuccessfullyPleaseRename = json['addSuccessfullyPleaseRename']; + whenAddingLockThePhoneMustBeNextToTheLock = json['whenAddingLockThePhoneMustBeNextToTheLock']; + + login = json['login']; + register = json['register']; + forgetPassword = json['forgetPassword']; + readAndAgree = json['readAndAgree']; + verificationCode = json['verificationCode']; + registerPasswordTip = json['registerPasswordTip']; + iphone = json['iphone']; + email = json['email']; + countryAndRegion = json['countryAndRegion']; + selet = json['selet']; + } + String starLock; + String clickUnlockAndHoldDownClose; + String checkingIn; + String electronicKey; + String password; + String card; + String fingerprint; + String remoteControl; + String operatingRecord; + String number; + String additive; + String addTime; + + String reset; + String sendKey; + String timeLimit; + String permanent; + String once; + String circulation; + String receiver; + String pleaseEnterNumberOrEmail; + String name; + String enterYourName; + String effectiveTime; + String failureTime; + String effectiveDate; + String failureDate; + String Monday; + String Tuesday; + String Wednesday; + String Thursday; + String Friday; + String Saturday; + String Sunday; + + String realNameAuthentication; + String sendKeyBottomTip; + String send; + String periodValidity; + String sendGroupKey; + String lock; + String pleaseAdd; + String pleaseSelet; + String remoteUnlockingAllowed; + String pleaseEnter; + String getPassword; + String custom; + String clearAll; + String recursiveDevice; + String pleaseNameYourPassword; + String pleaseEnterDigitsNumber; + String getPasswordTip1; + String getPasswordTip2; + String getPasswordTip3; + String getPasswordTip4; + String getPasswordTip5; + String getPasswordTip6; + String getTip; + String addTip; + String sender; + String senderTime; + String keyDetail; + String detail; + String delete; + String passwordDetail; + String share; + String amend; + String sure; + String cancel; + String add; + String accountNumber; + String volumeAuthorizationLock; + String authorizedAdminTip; + String lockOperatingRecordTip; + String remoteUnlockingPageTip; + String currentMode; + String delayTime; + String automaticBlockingTip; + String time; + String normallyOpen; + String date; + String begin; + String end; + String allDay; + String save; + String normallyOpenModeTip; + String pleaseSeletLockVolume; + String lockSoundTip; + String low; + String lower; + String medium; + String high; + String higher; + String burglarAlarmTip; + String resetButtonTip; + String calibrationTime; + String setTheDSTMode; + String diagnoseTip; + String uploading; + String uploadDataTip; + String importOtherLockDataTip; + String haveNewVersion; + String currentVersion; + String newVersion; + String upgrade; + String leisure; + String checkedIn; + + String basicInformation; + String wirelessKeyboard; + String doorMagnetic; + String remoteUnlocking; + String automaticBlocking; + String normallyOpenMode; + String lockSound; + String burglarAlarm; + String resetButton; + String lockTime; + String diagnose; + String uploadData; + String importOtherLockData; + String lockEscalation; + String markedHouseState; + String unlockReminder; + String unlockQRCode; + String lockNumber; + String electricQuantity; + String lockName; + String lockGrouping; + String adminOpenLockPassword; + String update; + String updateElectricQuantityTip; + String adminOpenLockPasswordTip; + String updateLockAdminPassword; + String whenScreenFlashesClickNext; + String theScreenNeverFlickered; + String enterNumberOrPressSet; + String theLocationOfTheSetKeyWillBeDifferent; + String pressAndHoldTheResetButtonTwoSeconds; + String nearbyEquipment; + String noData; + String doorMagneticListTopTip; + + String lanEnglish; + String lanChinese; + String multilingual; + String addLock; + String gateway; + String message; + String supportStaff; + String set; + String moreServices; + + String moreSet; + String prompTone; + String touchUnlock; + String pushNotification; + String lockUserManagement; + String authorizedAdmin; + String lockGroup; + String transferSmartLock; + String transferGateway; + + String multiLanguage; + String lockScreen; + String closed; + String opened; + String hideInvalidUnlockPermissions; + String appUnlockRequiresMobilePhoneAccessToTheLock; + String valueAddedServices; + String about; + String userAgreement; + String privacyPolicy; + String personalInformationCollectionList; + String applicationPermissionDescription; + String thirdPartyInformationSharingList; + String logout; + String deleteAccount; + + String allLock; + String searchAllLockType; + String doorLock; + String padlock; + String safeLock; + String intelligentLockCore; + String parkingLock; + String bicycleLock; + String longRangeControl; + String lightTouchScreen; + String lightTouchScreenTip; + String next; + String nearbyLock; + String addSuccessfullyPleaseRename; + String whenAddingLockThePhoneMustBeNextToTheLock; + + String login; + String register; + String forgetPassword; + String readAndAgree; + String verificationCode; + String registerPasswordTip; + String iphone; + String email; + String countryAndRegion; + String selet; + + Map toJson() { + final map = {}; + map['starLock'] = starLock; + map['clickUnlockAndHoldDownClose'] = clickUnlockAndHoldDownClose; + map['checkingIn'] = checkingIn; + map['electronicKey'] = electronicKey; + map['password'] = password; + map['card'] = card; + map['fingerprint'] = fingerprint; + map['remoteControl'] = remoteControl; + map['operatingRecord'] = operatingRecord; + map['number'] = number; + map['additive'] = additive; + map['addTime'] = addTime; + + map['reset'] = reset; + map['sendKey'] = sendKey; + map['timeLimit'] = timeLimit; + map['permanent'] = permanent; + map['once'] = once; + map['circulation'] = circulation; + map['receiver'] = receiver; + map['pleaseEnterNumberOrEmail'] = pleaseEnterNumberOrEmail; + map['name'] = name; + map['enterYourName'] = enterYourName; + map['effectiveTime'] = effectiveTime; + map['failureTime'] = failureTime; + map['effectiveDate'] = effectiveDate; + map['failureDate'] = failureDate; + map['Monday'] = Monday; + map['Tuesday'] = Tuesday; + map['Wednesday'] = Wednesday; + map['Thursday'] = Thursday; + map['Friday'] = Friday; + map['Saturday'] = Saturday; + map['Sunday'] = Sunday; + + map['realNameAuthentication'] = realNameAuthentication; + map['sendKeyBottomTip'] = sendKeyBottomTip; + map['send'] = send; + map['periodValidity'] = periodValidity; + map['sendGroupKey'] = sendGroupKey; + map['lock'] = lock; + map['pleaseAdd'] = pleaseAdd; + map['pleaseSelet'] = pleaseSelet; + map['remoteUnlockingAllowed'] = remoteUnlockingAllowed; + map['pleaseEnter'] = pleaseEnter; + map['getPassword'] = getPassword; + + map['custom'] = custom; + map['clearAll'] = clearAll; + map['recursiveDevice'] = recursiveDevice; + map['pleaseNameYourPassword'] = pleaseNameYourPassword; + map['pleaseEnterDigitsNumber'] = pleaseEnterDigitsNumber; + map['getPasswordTip1'] = getPasswordTip1; + map['getPasswordTip2'] = getPasswordTip2; + map['getPasswordTip3'] = getPasswordTip3; + map['getPasswordTip4'] = getPasswordTip4; + map['getPasswordTip5'] = getPasswordTip5; + map['getPasswordTip6'] = getPasswordTip6; + map['getTip'] = getTip; + map['addTip'] = addTip; + map['sender'] = sender; + map['senderTime'] = senderTime; + map['keyDetail'] = keyDetail; + map['detail'] = detail; + map['delete'] = delete; + map['passwordDetail'] = passwordDetail; + map['share'] = share; + map['amend'] = amend; + map['sure'] = sure; + map['cancel'] = cancel; + map['add'] = add; + map['accountNumber'] = accountNumber; + map['volumeAuthorizationLock'] = volumeAuthorizationLock; + map['authorizedAdminTip'] = authorizedAdminTip; + map['lockOperatingRecordTip'] = lockOperatingRecordTip; + map['remoteUnlockingPageTip'] = remoteUnlockingPageTip; + map['currentMode'] = currentMode; + map['delayTime'] = delayTime; + map['automaticBlockingTip'] = automaticBlockingTip; + map['time'] = time; + map['normallyOpen'] = normallyOpen; + map['date'] = date; + map['begin'] = begin; + map['end'] = end; + map['allDay'] = allDay; + map['save'] = save; + map['normallyOpenModeTip'] = normallyOpenModeTip; + map['pleaseSeletLockVolume'] = pleaseSeletLockVolume; + map['lockSoundTip'] = lockSoundTip; + map['low'] = low; + map['lower'] = lower; + map['medium'] = medium; + map['high'] = high; + map['higher'] = higher; + map['burglarAlarmTip'] = burglarAlarmTip; + map['resetButtonTip'] = resetButtonTip; + map['calibrationTime'] = calibrationTime; + map['setTheDSTMode'] = setTheDSTMode; + map['diagnoseTip'] = diagnoseTip; + map['uploading'] = uploading; + map['uploadDataTip'] = uploadDataTip; + map['importOtherLockDataTip'] = importOtherLockDataTip; + map['haveNewVersion'] = haveNewVersion; + map['currentVersion'] = currentVersion; + map['newVersion'] = newVersion; + map['upgrade'] = upgrade; + map['leisure'] = leisure; + map['checkedIn'] = checkedIn; + + map['basicInformation'] = basicInformation; + map['wirelessKeyboard'] = wirelessKeyboard; + map['doorMagnetic'] = doorMagnetic; + map['remoteUnlocking'] = remoteUnlocking; + map['automaticBlocking'] = automaticBlocking; + map['normallyOpenMode'] = normallyOpenMode; + map['lockSound'] = lockSound; + map['burglarAlarm'] = burglarAlarm; + map['resetButton'] = resetButton; + map['lockTime'] = lockTime; + map['diagnose'] = diagnose; + map['uploadData'] = uploadData; + map['importOtherLockData'] = importOtherLockData; + map['lockEscalation'] = lockEscalation; + map['markedHouseState'] = markedHouseState; + map['unlockReminder'] = unlockReminder; + map['unlockQRCode'] = unlockQRCode; + map['lockNumber'] = lockNumber; + map['electricQuantity'] = electricQuantity; + map['lockName'] = lockName; + map['lockGrouping'] = lockGrouping; + map['adminOpenLockPassword'] = adminOpenLockPassword; + map['update'] = update; + map['updateElectricQuantityTip'] = updateElectricQuantityTip; + map['adminOpenLockPasswordTip'] = adminOpenLockPasswordTip; + map['updateLockAdminPassword'] = updateLockAdminPassword; + map['whenScreenFlashesClickNext'] = whenScreenFlashesClickNext; + map['theScreenNeverFlickered'] = theScreenNeverFlickered; + map['enterNumberOrPressSet'] = enterNumberOrPressSet; + map['theLocationOfTheSetKeyWillBeDifferent'] = theLocationOfTheSetKeyWillBeDifferent; + map['pressAndHoldTheResetButtonTwoSeconds'] = pressAndHoldTheResetButtonTwoSeconds; + map['nearbyEquipment'] = nearbyEquipment; + map['noData'] = noData; + map['doorMagneticListTopTip'] = doorMagneticListTopTip; + + map['lanEnglish'] = lanEnglish; + map['lanChinese'] = lanChinese; + map['multilingual'] = multilingual; + map['addLock'] = addLock; + map['gateway'] = gateway; + map['message'] = message; + map['supportStaff'] = supportStaff; + map['set'] = set; + map['moreServices'] = moreServices; + + map['moreSet'] = moreSet; + map['prompTone'] = prompTone; + map['touchUnlock'] = touchUnlock; + map['pushNotification'] = pushNotification; + map['lockUserManagement'] = lockUserManagement; + map['authorizedAdmin'] = authorizedAdmin; + map['lockGroup'] = lockGroup; + map['transferSmartLock'] = transferSmartLock; + map['transferGateway'] = transferGateway; + + map['multiLanguage'] = multiLanguage; + map['lockScreen'] = lockScreen; + map['closed'] = closed; + map['opened'] = opened; + map['hideInvalidUnlockPermissions'] = hideInvalidUnlockPermissions; + map['appUnlockRequiresMobilePhoneAccessToTheLock'] = appUnlockRequiresMobilePhoneAccessToTheLock; + map['valueAddedServices'] = valueAddedServices; + map['about'] = about; + map['userAgreement'] = userAgreement; + map['privacyPolicy'] = privacyPolicy; + map['personalInformationCollectionList'] = personalInformationCollectionList; + map['applicationPermissionDescription'] = applicationPermissionDescription; + map['thirdPartyInformationSharingList'] = thirdPartyInformationSharingList; + map['logout'] = logout; + map['deleteAccount'] = deleteAccount; + + map['allLock'] = allLock; + map['searchAllLockType'] = searchAllLockType; + map['doorLock'] = doorLock; + map['padlock'] = padlock; + map['safeLock'] = safeLock; + map['intelligentLockCore'] = intelligentLockCore; + map['parkingLock'] = parkingLock; + map['bicycleLock'] = bicycleLock; + map['longRangeControl'] = longRangeControl; + map['lightTouchScreen'] = lightTouchScreen; + map['lightTouchScreenTip'] = lightTouchScreenTip; + map['next'] = next; + map['nearbyLock'] = nearbyLock; + map['addSuccessfullyPleaseRename'] = addSuccessfullyPleaseRename; + map['whenAddingLockThePhoneMustBeNextToTheLock'] = whenAddingLockThePhoneMustBeNextToTheLock; + + map['login'] = login; + map['register'] = register; + map['forgetPassword'] = forgetPassword; + map['readAndAgree'] = readAndAgree; + map['verificationCode'] = verificationCode; + map['registerPasswordTip'] = registerPasswordTip; + map['iphone'] = iphone; + map['email'] = email; + map['countryAndRegion'] = countryAndRegion; + map['selet'] = selet; + return map; + } +} \ No newline at end of file diff --git a/star_lock/lib/translations/trans_lib.dart b/star_lock/lib/translations/trans_lib.dart new file mode 100644 index 00000000..b42e09dd --- /dev/null +++ b/star_lock/lib/translations/trans_lib.dart @@ -0,0 +1,9 @@ +library lib_trans; + +import 'dart:convert'; +import 'dart:ui'; +import 'package:flutter/services.dart'; +import 'package:get/get.dart'; +import 'lanKeyEntity.dart'; +part 'translation_loader.dart'; +part 'translation_message.dart'; \ No newline at end of file diff --git a/star_lock/lib/translations/translation_loader.dart b/star_lock/lib/translations/translation_loader.dart new file mode 100644 index 00000000..9fb726b5 --- /dev/null +++ b/star_lock/lib/translations/translation_loader.dart @@ -0,0 +1,42 @@ +part of lib_trans; + + + +class TranslationLoader { + + static bool get isZh => Get.locale?.languageCode?.toLowerCase() == 'zh'; + static bool get isEn => Get.locale?.languageCode?.toLowerCase() == 'en'; + + static Map + _zhMap = {}, + _enMap = {}, + _keyMap = {}; + + static Map get zhDic => _zhMap; + static Map get enDic => _enMap; + + static LanKeyEntity _lanKeyEntity; + static LanKeyEntity get lanKeys => _lanKeyEntity; + + static Future loadTranslation({ + String zhSource, + String enSource, + String keySource,}) async { + _zhMap = await _loadJsonFile(zhSource); + _enMap = await _loadJsonFile(enSource); + _keyMap = await _loadJsonFile(keySource); + _lanKeyEntity = LanKeyEntity.fromJson(_keyMap); + } + + static Future> _loadJsonFile(String filePath) async => rootBundle.loadString(filePath).then((jsonString){ + Map enJson = jsonDecode(jsonString); + Map map = {}; + enJson.forEach((key, value) { + map[key] = value.toString(); + }); + return map; + }).onError((error, stackTrace){ + return Future.value({}); + }); + +} diff --git a/star_lock/lib/translations/translation_message.dart b/star_lock/lib/translations/translation_message.dart new file mode 100644 index 00000000..b554eacb --- /dev/null +++ b/star_lock/lib/translations/translation_message.dart @@ -0,0 +1,13 @@ +part of lib_trans; + +class TranslationMessage extends Translations { + + @override + Map> get keys => { + 'en_US' : TranslationLoader.enDic, + 'zh_CN': TranslationLoader.zhDic, + }; + + void updateLocal(Locale l) => Get.updateLocale(l); + +} \ No newline at end of file diff --git a/star_lock/linux/.gitignore b/star_lock/linux/.gitignore new file mode 100644 index 00000000..d3896c98 --- /dev/null +++ b/star_lock/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/star_lock/linux/CMakeLists.txt b/star_lock/linux/CMakeLists.txt new file mode 100644 index 00000000..62853b7e --- /dev/null +++ b/star_lock/linux/CMakeLists.txt @@ -0,0 +1,138 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "star_lock") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.example.star_lock") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/star_lock/linux/flutter/CMakeLists.txt b/star_lock/linux/flutter/CMakeLists.txt new file mode 100644 index 00000000..d5bd0164 --- /dev/null +++ b/star_lock/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/star_lock/linux/flutter/generated_plugin_registrant.cc b/star_lock/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..e71a16d2 --- /dev/null +++ b/star_lock/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/star_lock/linux/flutter/generated_plugin_registrant.h b/star_lock/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..e0f0a47b --- /dev/null +++ b/star_lock/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/star_lock/linux/flutter/generated_plugins.cmake b/star_lock/linux/flutter/generated_plugins.cmake new file mode 100644 index 00000000..2e1de87a --- /dev/null +++ b/star_lock/linux/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/star_lock/linux/main.cc b/star_lock/linux/main.cc new file mode 100644 index 00000000..e7c5c543 --- /dev/null +++ b/star_lock/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/star_lock/linux/my_application.cc b/star_lock/linux/my_application.cc new file mode 100644 index 00000000..4e599fb3 --- /dev/null +++ b/star_lock/linux/my_application.cc @@ -0,0 +1,104 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "star_lock"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "star_lock"); + } + + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, + "flags", G_APPLICATION_NON_UNIQUE, + nullptr)); +} diff --git a/star_lock/linux/my_application.h b/star_lock/linux/my_application.h new file mode 100644 index 00000000..72271d5e --- /dev/null +++ b/star_lock/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/star_lock/macos/.gitignore b/star_lock/macos/.gitignore new file mode 100644 index 00000000..746adbb6 --- /dev/null +++ b/star_lock/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/star_lock/macos/Flutter/Flutter-Debug.xcconfig b/star_lock/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 00000000..4b81f9b2 --- /dev/null +++ b/star_lock/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/star_lock/macos/Flutter/Flutter-Release.xcconfig b/star_lock/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 00000000..5caa9d15 --- /dev/null +++ b/star_lock/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/star_lock/macos/Flutter/GeneratedPluginRegistrant.swift b/star_lock/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 00000000..47b97425 --- /dev/null +++ b/star_lock/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,16 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import device_info_plus +import package_info_plus +import path_provider_foundation + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) + FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) +} diff --git a/star_lock/macos/Podfile b/star_lock/macos/Podfile new file mode 100644 index 00000000..dade8dfa --- /dev/null +++ b/star_lock/macos/Podfile @@ -0,0 +1,40 @@ +platform :osx, '10.11' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/star_lock/macos/Runner.xcodeproj/project.pbxproj b/star_lock/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..00fe8982 --- /dev/null +++ b/star_lock/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,572 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* star_lock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "star_lock.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* star_lock.app */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* star_lock.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/star_lock/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/star_lock/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/star_lock/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/star_lock/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/star_lock/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..c1a85f2d --- /dev/null +++ b/star_lock/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/star_lock/macos/Runner.xcworkspace/contents.xcworkspacedata b/star_lock/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/star_lock/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/star_lock/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/star_lock/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/star_lock/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/star_lock/macos/Runner/AppDelegate.swift b/star_lock/macos/Runner/AppDelegate.swift new file mode 100644 index 00000000..d53ef643 --- /dev/null +++ b/star_lock/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..a2ec33f1 --- /dev/null +++ b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 00000000..82b6f9d9 Binary files /dev/null and b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 00000000..13b35eba Binary files /dev/null and b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 00000000..0a3f5fa4 Binary files /dev/null and b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 00000000..bdb57226 Binary files /dev/null and b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 00000000..f083318e Binary files /dev/null and b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 00000000..326c0e72 Binary files /dev/null and b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 00000000..2f1632cf Binary files /dev/null and b/star_lock/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/star_lock/macos/Runner/Base.lproj/MainMenu.xib b/star_lock/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..80e867a4 --- /dev/null +++ b/star_lock/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/star_lock/macos/Runner/Configs/AppInfo.xcconfig b/star_lock/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 00000000..9e0b6d30 --- /dev/null +++ b/star_lock/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = star_lock + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.starLock + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. diff --git a/star_lock/macos/Runner/Configs/Debug.xcconfig b/star_lock/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 00000000..36b0fd94 --- /dev/null +++ b/star_lock/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/star_lock/macos/Runner/Configs/Release.xcconfig b/star_lock/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 00000000..dff4f495 --- /dev/null +++ b/star_lock/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/star_lock/macos/Runner/Configs/Warnings.xcconfig b/star_lock/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 00000000..42bcbf47 --- /dev/null +++ b/star_lock/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/star_lock/macos/Runner/DebugProfile.entitlements b/star_lock/macos/Runner/DebugProfile.entitlements new file mode 100644 index 00000000..dddb8a30 --- /dev/null +++ b/star_lock/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/star_lock/macos/Runner/Info.plist b/star_lock/macos/Runner/Info.plist new file mode 100644 index 00000000..4789daa6 --- /dev/null +++ b/star_lock/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/star_lock/macos/Runner/MainFlutterWindow.swift b/star_lock/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 00000000..2722837e --- /dev/null +++ b/star_lock/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController.init() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/star_lock/macos/Runner/Release.entitlements b/star_lock/macos/Runner/Release.entitlements new file mode 100644 index 00000000..852fa1a4 --- /dev/null +++ b/star_lock/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/star_lock/pubspec.yaml b/star_lock/pubspec.yaml new file mode 100644 index 00000000..202cb874 --- /dev/null +++ b/star_lock/pubspec.yaml @@ -0,0 +1,115 @@ +name: star_lock +description: A new Flutter project. + +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# 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. +version: 1.0.0+1 + +environment: + sdk: '>=2.7.0 <3.0.0' + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + flutter_localizations: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + + # 状态管理 + get: ^4.6.5 + # 获取设备信息 + device_info_plus: ^8.0.0 + # 本地储存 + get_storage: ^2.0.3 + # 获取唯一设备码 + uuid: ^3.0.6 + # 屏幕适配 + flutter_screenutil: ^5.6.0 + # 获取当前项目信息 + package_info_plus: ^3.0.1 + # 选择日期时间 + flutter_cupertino_datetime_picker: ^3.0.0 + # 选择原生通讯录 + flutter_native_contact_picker: ^0.0.4 + #底部弹出选择器 + flutter_picker: ^2.1.0 + #生成二维码 + qr_flutter: ^4.0.0 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - images/ + - images/tabbar/ + - images/main/ + - images/lan/ + - images/mine/ + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/star_lock/test/widget_test.dart b/star_lock/test/widget_test.dart new file mode 100644 index 00000000..64ae1c59 --- /dev/null +++ b/star_lock/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:star_lock/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/star_lock/web/favicon.png b/star_lock/web/favicon.png new file mode 100644 index 00000000..8aaa46ac Binary files /dev/null and b/star_lock/web/favicon.png differ diff --git a/star_lock/web/icons/Icon-192.png b/star_lock/web/icons/Icon-192.png new file mode 100644 index 00000000..b749bfef Binary files /dev/null and b/star_lock/web/icons/Icon-192.png differ diff --git a/star_lock/web/icons/Icon-512.png b/star_lock/web/icons/Icon-512.png new file mode 100644 index 00000000..88cfd48d Binary files /dev/null and b/star_lock/web/icons/Icon-512.png differ diff --git a/star_lock/web/icons/Icon-maskable-192.png b/star_lock/web/icons/Icon-maskable-192.png new file mode 100644 index 00000000..eb9b4d76 Binary files /dev/null and b/star_lock/web/icons/Icon-maskable-192.png differ diff --git a/star_lock/web/icons/Icon-maskable-512.png b/star_lock/web/icons/Icon-maskable-512.png new file mode 100644 index 00000000..d69c5669 Binary files /dev/null and b/star_lock/web/icons/Icon-maskable-512.png differ diff --git a/star_lock/web/index.html b/star_lock/web/index.html new file mode 100644 index 00000000..13f45b66 --- /dev/null +++ b/star_lock/web/index.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + star_lock + + + + + + + + + + diff --git a/star_lock/web/manifest.json b/star_lock/web/manifest.json new file mode 100644 index 00000000..f3343ffb --- /dev/null +++ b/star_lock/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "star_lock", + "short_name": "star_lock", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/star_lock/windows/.gitignore b/star_lock/windows/.gitignore new file mode 100644 index 00000000..d492d0d9 --- /dev/null +++ b/star_lock/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/star_lock/windows/CMakeLists.txt b/star_lock/windows/CMakeLists.txt new file mode 100644 index 00000000..c9472223 --- /dev/null +++ b/star_lock/windows/CMakeLists.txt @@ -0,0 +1,101 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(star_lock LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "star_lock") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/star_lock/windows/flutter/CMakeLists.txt b/star_lock/windows/flutter/CMakeLists.txt new file mode 100644 index 00000000..930d2071 --- /dev/null +++ b/star_lock/windows/flutter/CMakeLists.txt @@ -0,0 +1,104 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + windows-x64 $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/star_lock/windows/flutter/generated_plugin_registrant.cc b/star_lock/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..8b6d4680 --- /dev/null +++ b/star_lock/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void RegisterPlugins(flutter::PluginRegistry* registry) { +} diff --git a/star_lock/windows/flutter/generated_plugin_registrant.h b/star_lock/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..dc139d85 --- /dev/null +++ b/star_lock/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/star_lock/windows/flutter/generated_plugins.cmake b/star_lock/windows/flutter/generated_plugins.cmake new file mode 100644 index 00000000..b93c4c30 --- /dev/null +++ b/star_lock/windows/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/star_lock/windows/runner/CMakeLists.txt b/star_lock/windows/runner/CMakeLists.txt new file mode 100644 index 00000000..17411a8a --- /dev/null +++ b/star_lock/windows/runner/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/star_lock/windows/runner/Runner.rc b/star_lock/windows/runner/Runner.rc new file mode 100644 index 00000000..1e1a0eea --- /dev/null +++ b/star_lock/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "star_lock" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "star_lock" "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "star_lock.exe" "\0" + VALUE "ProductName", "star_lock" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/star_lock/windows/runner/flutter_window.cpp b/star_lock/windows/runner/flutter_window.cpp new file mode 100644 index 00000000..b43b9095 --- /dev/null +++ b/star_lock/windows/runner/flutter_window.cpp @@ -0,0 +1,61 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/star_lock/windows/runner/flutter_window.h b/star_lock/windows/runner/flutter_window.h new file mode 100644 index 00000000..6da0652f --- /dev/null +++ b/star_lock/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/star_lock/windows/runner/main.cpp b/star_lock/windows/runner/main.cpp new file mode 100644 index 00000000..98ed3594 --- /dev/null +++ b/star_lock/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.CreateAndShow(L"star_lock", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/star_lock/windows/runner/resource.h b/star_lock/windows/runner/resource.h new file mode 100644 index 00000000..66a65d1e --- /dev/null +++ b/star_lock/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/star_lock/windows/runner/resources/app_icon.ico b/star_lock/windows/runner/resources/app_icon.ico new file mode 100644 index 00000000..c04e20ca Binary files /dev/null and b/star_lock/windows/runner/resources/app_icon.ico differ diff --git a/star_lock/windows/runner/runner.exe.manifest b/star_lock/windows/runner/runner.exe.manifest new file mode 100644 index 00000000..a42ea768 --- /dev/null +++ b/star_lock/windows/runner/runner.exe.manifest @@ -0,0 +1,20 @@ + + + + + PerMonitorV2 + + + + + + + + + + + + + + + diff --git a/star_lock/windows/runner/utils.cpp b/star_lock/windows/runner/utils.cpp new file mode 100644 index 00000000..f5bf9fa0 --- /dev/null +++ b/star_lock/windows/runner/utils.cpp @@ -0,0 +1,64 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, utf8_string.data(), + target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/star_lock/windows/runner/utils.h b/star_lock/windows/runner/utils.h new file mode 100644 index 00000000..3879d547 --- /dev/null +++ b/star_lock/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/star_lock/windows/runner/win32_window.cpp b/star_lock/windows/runner/win32_window.cpp new file mode 100644 index 00000000..c10f08dc --- /dev/null +++ b/star_lock/windows/runner/win32_window.cpp @@ -0,0 +1,245 @@ +#include "win32_window.h" + +#include + +#include "resource.h" + +namespace { + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + FreeLibrary(user32_module); + } +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::CreateAndShow(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + return OnCreate(); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} diff --git a/star_lock/windows/runner/win32_window.h b/star_lock/windows/runner/win32_window.h new file mode 100644 index 00000000..17ba4311 --- /dev/null +++ b/star_lock/windows/runner/win32_window.h @@ -0,0 +1,98 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates and shows a win32 window with |title| and position and size using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size to will treat the width height passed in to this function + // as logical pixels and scale to appropriate for the default monitor. Returns + // true if the window was created successfully. + bool CreateAndShow(const std::wstring& title, + const Point& origin, + const Size& size); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responsponds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_