commit d39a355ede3abfbc31f32824e0d96ebab2951d41
Author: hs <873121290@qq.com>
Date: Fri Dec 12 09:11:30 2025 +0800
秦港相关方
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..814bc41
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,44 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.build/
+.buildlog/
+.history
+.svn/
+.swiftpm/
+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
+.pub-cache/
+.pub/
+/build/
+
+# Symbolication related
+app.*.symbols
+
+# Obfuscation related
+app.*.map.json
+/lib/git-cheatsheet.md
+# Android Studio will place build artifacts here
+/android/app/debug
+/android/app/release
\ No newline at end of file
diff --git a/.metadata b/.metadata
new file mode 100644
index 0000000..e2ff7d7
--- /dev/null
+++ b/.metadata
@@ -0,0 +1,30 @@
+# 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 and should not be manually edited.
+
+version:
+ revision: "d7b523b356d15fb81e7d340bbe52b47f93937323"
+ channel: "stable"
+
+project_type: app
+
+# Tracks metadata for the flutter migrate command
+migration:
+ platforms:
+ - platform: root
+ create_revision: d7b523b356d15fb81e7d340bbe52b47f93937323
+ base_revision: d7b523b356d15fb81e7d340bbe52b47f93937323
+ - platform: web
+ create_revision: d7b523b356d15fb81e7d340bbe52b47f93937323
+ base_revision: d7b523b356d15fb81e7d340bbe52b47f93937323
+
+ # 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/.tgitconfig b/.tgitconfig
new file mode 100644
index 0000000..e69de29
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..62e7dd4
--- /dev/null
+++ b/README.md
@@ -0,0 +1,16 @@
+# flutter_integrated_whb
+
+危化项目.
+
+## 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/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 0000000..5c7a25e
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1,30 @@
+# 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.dev/lints.
+ #
+ # 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:
+ camel_case_types: false
+ # 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/android/.gitignore b/android/.gitignore
new file mode 100644
index 0000000..be3943c
--- /dev/null
+++ b/android/.gitignore
@@ -0,0 +1,14 @@
+gradle-wrapper.jar
+/.gradle
+/captures/
+/gradlew
+/gradlew.bat
+/local.properties
+GeneratedPluginRegistrant.java
+.cxx/
+
+# Remember to never publicly share your keystore.
+# See https://flutter.dev/to/reference-keystore
+key.properties
+**/*.keystore
+**/*.jks
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
new file mode 100644
index 0000000..3085927
--- /dev/null
+++ b/android/app/build.gradle.kts
@@ -0,0 +1,66 @@
+import java.util.Properties
+
+plugins {
+ id("com.android.application")
+ id("kotlin-android")
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
+ id("dev.flutter.flutter-gradle-plugin")
+}
+// 🔐 加载 key.properties
+val keystoreProperties = Properties()
+val keystorePropertiesFile = rootProject.file("key.properties")
+if (keystorePropertiesFile.exists()) {
+ keystoreProperties.load(keystorePropertiesFile.inputStream())
+}
+
+android {
+ namespace = "com.company.myapp2"
+ compileSdk = flutter.compileSdkVersion
+ ndkVersion = "28.1.13356709"
+
+ // 使用 JDK 17 / JavaVersion.VERSION_17(推荐与 AGP 8.9.x 兼容)
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+
+ kotlinOptions {
+ // jvmTarget 要与 Java 版本一致
+ jvmTarget = JavaVersion.VERSION_17.toString()
+ }
+
+ defaultConfig {
+ applicationId = "com.company.myapp2"
+ minSdk = 24
+ targetSdk = flutter.targetSdkVersion
+ versionCode = flutter.versionCode
+ versionName = flutter.versionName
+ }
+
+ signingConfigs {
+ create("release") {
+ storeFile = file(keystoreProperties["storeFile"] as String)
+ storePassword = keystoreProperties["storePassword"] as String
+ keyAlias = keystoreProperties["keyAlias"] as String
+ keyPassword = keystoreProperties["keyPassword"] as String
+ }
+ // debug signingConfig 通常存在(Android Gradle 会有默认 debug 签名)
+ // 如果你自定义 debug 签名,则可以在这里创建
+ }
+
+ buildTypes {
+ release {
+ signingConfig = signingConfigs.getByName("release")
+ isMinifyEnabled = false
+ isShrinkResources = false
+ }
+ debug {
+ // 使用默认 debug 签名(或你自定义的 debug)
+ // signingConfig = signingConfigs.getByName("debug")
+ }
+ }
+}
+
+flutter {
+ source = "../.."
+}
diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml
new file mode 100644
index 0000000..399f698
--- /dev/null
+++ b/android/app/src/debug/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..349325a
--- /dev/null
+++ b/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/kotlin/com/company/myapp2/MainActivity.kt b/android/app/src/main/kotlin/com/company/myapp2/MainActivity.kt
new file mode 100644
index 0000000..59c30c2
--- /dev/null
+++ b/android/app/src/main/kotlin/com/company/myapp2/MainActivity.kt
@@ -0,0 +1,123 @@
+package com.company.myapp2
+
+import android.content.Intent
+import android.net.Uri
+import android.os.Build
+import android.os.Bundle
+import android.provider.Settings
+import androidx.core.content.FileProvider
+import io.flutter.embedding.android.FlutterActivity
+import io.flutter.embedding.engine.FlutterEngine
+import io.flutter.plugin.common.MethodChannel
+import java.io.File
+
+class MainActivity: FlutterActivity() {
+ private val CHANNEL = "app.install"
+ private val REQ_INSTALL_UNKNOWN = 9999
+
+ // 暂存安装请求(仅在跳转设置并等待返回时使用)
+ private var pendingApkPath: String? = null
+ private var pendingResult: MethodChannel.Result? = null
+
+ override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
+ super.configureFlutterEngine(flutterEngine)
+ MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result ->
+ when (call.method) {
+ "installApk" -> {
+ val path = call.argument("path")
+ if (path == null) {
+ result.error("NO_PATH", "no path provided", null)
+ return@setMethodCallHandler
+ }
+ handleInstallRequest(path, result)
+ }
+ else -> result.notImplemented()
+ }
+ }
+ }
+
+ private fun handleInstallRequest(path: String, result: MethodChannel.Result) {
+ val file = File(path)
+ if (!file.exists()) {
+ result.error("NO_FILE", "file not exist", null)
+ return
+ }
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ // 8.0+ 需要 app 级别未知来源授权
+ if (!packageManager.canRequestPackageInstalls()) {
+ // 存储请求信息以便用户返回后继续
+ pendingApkPath = path
+ pendingResult = result
+
+ val intent = Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES,
+ Uri.parse("package:$packageName"))
+ // 使用 startActivityForResult 以便用户返回后可以继续安装
+ startActivityForResult(intent, REQ_INSTALL_UNKNOWN)
+ return
+ }
+ }
+ // 已有授权 或 非 8.0+:直接安装
+ installApkInternal(path, result)
+ }
+
+ // 真正执行安装的函数(假定有权限)
+ private fun installApkInternal(path: String, result: MethodChannel.Result) {
+ val file = File(path)
+ if (!file.exists()) {
+ result.error("NO_FILE", "file not exist", null)
+ return
+ }
+
+ try {
+ val apkUri: Uri = FileProvider.getUriForFile(this, "$packageName.fileprovider", file)
+ val intent = Intent(Intent.ACTION_VIEW)
+ intent.setDataAndType(apkUri, "application/vnd.android.package-archive")
+ intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+ intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
+ startActivity(intent)
+ result.success(true)
+ } catch (e: Exception) {
+ result.error("INSTALL_FAILED", e.message, null)
+ }
+ }
+
+ override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
+ super.onActivityResult(requestCode, resultCode, data)
+ if (requestCode == REQ_INSTALL_UNKNOWN) {
+ // 用户从系统设置页返回后,检查是否已授权
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ if (packageManager.canRequestPackageInstalls()) {
+ // 授权已开:继续安装
+ val path = pendingApkPath
+ val res = pendingResult
+ // 清理 pending 状态
+ pendingApkPath = null
+ pendingResult = null
+ if (path != null && res != null) {
+ installApkInternal(path, res)
+ } else {
+ // 安全兜底:若没有 pending 数据,通知 caller 重新触发
+ res?.error("NO_PENDING", "no pending install info", null)
+ }
+ } else {
+ // 用户仍未授权
+ pendingApkPath = null
+ pendingResult?.error("NEED_INSTALL_PERMISSION", "user did not allow install unknown apps", null)
+ pendingResult = null
+ }
+ } else {
+ // API < 26:尝试直接安装一次作为尝试(某些 ROM 无法精准判断)
+ val path = pendingApkPath
+ val res = pendingResult
+ pendingApkPath = null
+ pendingResult = null
+ if (path != null && res != null) {
+ installApkInternal(path, res)
+ } else {
+ res?.error("NO_PENDING", "no pending install info", null)
+ }
+ }
+ }
+ }
+}
diff --git a/android/app/src/main/kotlin/com/zhuoyun/qhdprevention/qhd_prevention/MyApplication.kt b/android/app/src/main/kotlin/com/zhuoyun/qhdprevention/qhd_prevention/MyApplication.kt
new file mode 100644
index 0000000..7433425
--- /dev/null
+++ b/android/app/src/main/kotlin/com/zhuoyun/qhdprevention/qhd_prevention/MyApplication.kt
@@ -0,0 +1,38 @@
+package com.company.myapp2
+
+import android.app.Application
+import android.content.Context
+import android.util.Log
+
+class MyApplication : Application() {
+ override fun onCreate() {
+ super.onCreate()
+
+ // 通过反射调用 SDKInitializer,避免在编译期要求依赖存在
+ try {
+ val sdkClass = Class.forName("com.baidu.mapapi.SDKInitializer")
+ // setAgreePrivacy(boolean) - 有些 SDK 要求先同意隐私
+ try {
+ val setAgree = sdkClass.getMethod("setAgreePrivacy", java.lang.Boolean::class.javaPrimitiveType)
+ setAgree.invoke(null, true)
+ Log.i("MyApplication", "SDKInitializer.setAgreePrivacy invoked via reflection")
+ } catch (t: Throwable) {
+ Log.w("MyApplication", "setAgreePrivacy not available or failed: ${t.message}")
+ }
+
+ // initialize(Context)
+ try {
+ val initMethod = sdkClass.getMethod("initialize", Context::class.java)
+ initMethod.invoke(null, this)
+ Log.i("MyApplication", "SDKInitializer.initialize invoked via reflection")
+ } catch (t: Throwable) {
+ Log.w("MyApplication", "initialize(Context) not available or failed: ${t.message}")
+ }
+ } catch (e: ClassNotFoundException) {
+ // 运行时没有找到该类(可能 plugin 未包含 SDK),记录日志但不崩溃
+ Log.w("MyApplication", "Baidu SDKInitializer class not found at runtime: ${e.message}")
+ } catch (e: Throwable) {
+ Log.e("MyApplication", "Unexpected error while initializing Baidu SDK via reflection", e)
+ }
+ }
+}
diff --git a/android/app/src/main/res/drawable-v21/background.png b/android/app/src/main/res/drawable-v21/background.png
new file mode 100644
index 0000000..4ebb677
Binary files /dev/null and b/android/app/src/main/res/drawable-v21/background.png differ
diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml
new file mode 100644
index 0000000..f88598c
--- /dev/null
+++ b/android/app/src/main/res/drawable-v21/launch_background.xml
@@ -0,0 +1,6 @@
+
+
+ -
+
+
+
diff --git a/android/app/src/main/res/drawable/background.png b/android/app/src/main/res/drawable/background.png
new file mode 100644
index 0000000..4ebb677
Binary files /dev/null and b/android/app/src/main/res/drawable/background.png differ
diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml
new file mode 100644
index 0000000..f88598c
--- /dev/null
+++ b/android/app/src/main/res/drawable/launch_background.xml
@@ -0,0 +1,6 @@
+
+
+ -
+
+
+
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..5337d5a
Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..8c85bf1
Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..e37e85c
Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..342548c
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..7e763e2
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/values-night-v31/styles.xml b/android/app/src/main/res/values-night-v31/styles.xml
new file mode 100644
index 0000000..5fef228
--- /dev/null
+++ b/android/app/src/main/res/values-night-v31/styles.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml
new file mode 100644
index 0000000..dbc9ea9
--- /dev/null
+++ b/android/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/values-v31/styles.xml b/android/app/src/main/res/values-v31/styles.xml
new file mode 100644
index 0000000..d0a68e9
--- /dev/null
+++ b/android/app/src/main/res/values-v31/styles.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..35f833e
--- /dev/null
+++ b/android/app/src/main/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+
+ 秦港相关方
+
\ No newline at end of file
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..0d1fa8f
--- /dev/null
+++ b/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/xml/file_paths.xml b/android/app/src/main/res/xml/file_paths.xml
new file mode 100644
index 0000000..80def29
--- /dev/null
+++ b/android/app/src/main/res/xml/file_paths.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml
new file mode 100644
index 0000000..399f698
--- /dev/null
+++ b/android/app/src/profile/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/android/build.gradle.kts b/android/build.gradle.kts
new file mode 100644
index 0000000..89176ef
--- /dev/null
+++ b/android/build.gradle.kts
@@ -0,0 +1,21 @@
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
+rootProject.layout.buildDirectory.value(newBuildDir)
+
+subprojects {
+ val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
+ project.layout.buildDirectory.value(newSubprojectBuildDir)
+}
+subprojects {
+ project.evaluationDependsOn(":app")
+}
+
+tasks.register("clean") {
+ delete(rootProject.layout.buildDirectory)
+}
diff --git a/android/build/reports/problems/problems-report.html b/android/build/reports/problems/problems-report.html
new file mode 100644
index 0000000..5e5704e
--- /dev/null
+++ b/android/build/reports/problems/problems-report.html
@@ -0,0 +1,663 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Gradle Configuration Cache
+
+
+
+
+
+
+ Loading...
+
+
+
+
+
+
+
diff --git a/android/gradle.properties b/android/gradle.properties
new file mode 100644
index 0000000..24863d2
--- /dev/null
+++ b/android/gradle.properties
@@ -0,0 +1,3 @@
+org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
+android.useAndroidX=true
+android.enableJetifier=true
\ No newline at end of file
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..cf3c25b
--- /dev/null
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
+#distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.11.1-all.zip
diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts
new file mode 100644
index 0000000..9fcdbe2
--- /dev/null
+++ b/android/settings.gradle.kts
@@ -0,0 +1,37 @@
+pluginManagement {
+ val flutterSdkPath = run {
+ val properties = java.util.Properties()
+ file("local.properties").inputStream().use { properties.load(it) }
+ val flutterSdkPath = properties.getProperty("flutter.sdk")
+ require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
+ flutterSdkPath
+ }
+
+ includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
+
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+
+ resolutionStrategy {
+ eachPlugin {
+ val pluginId = requested.id.id
+ if (pluginId == "org.jetbrains.kotlin.android" || pluginId == "org.jetbrains.kotlin.jvm") {
+ // 与 build.gradle.kts 中 kotlin 插件版本保持一致
+ useVersion("2.2.20")
+ }
+ }
+ }
+}
+
+plugins {
+ id("dev.flutter.flutter-plugin-loader") version "1.0.0"
+ // 与 android/build.gradle.kts 中使用的 AGP 版本保持一致
+ id("com.android.application") version "8.9.1" apply false
+ // 与 build.gradle.kts 中 kotlin 插件版本保持一致
+ id("org.jetbrains.kotlin.android") version "2.2.20" apply false
+}
+
+include(":app")
diff --git a/assets/icon-apps/home_ico10.png b/assets/icon-apps/home_ico10.png
new file mode 100644
index 0000000..3c2abc3
Binary files /dev/null and b/assets/icon-apps/home_ico10.png differ
diff --git a/assets/icon-apps/home_ico11.png b/assets/icon-apps/home_ico11.png
new file mode 100644
index 0000000..8ed4996
Binary files /dev/null and b/assets/icon-apps/home_ico11.png differ
diff --git a/assets/icon-apps/home_ico4.png b/assets/icon-apps/home_ico4.png
new file mode 100644
index 0000000..11b0496
Binary files /dev/null and b/assets/icon-apps/home_ico4.png differ
diff --git a/assets/icon-apps/home_ico5.png b/assets/icon-apps/home_ico5.png
new file mode 100644
index 0000000..b54ce14
Binary files /dev/null and b/assets/icon-apps/home_ico5.png differ
diff --git a/assets/icon-apps/home_ico6.png b/assets/icon-apps/home_ico6.png
new file mode 100644
index 0000000..501ba27
Binary files /dev/null and b/assets/icon-apps/home_ico6.png differ
diff --git a/assets/icon-apps/home_ico7.png b/assets/icon-apps/home_ico7.png
new file mode 100644
index 0000000..51b7677
Binary files /dev/null and b/assets/icon-apps/home_ico7.png differ
diff --git a/assets/icon-apps/home_ico8.png b/assets/icon-apps/home_ico8.png
new file mode 100644
index 0000000..802c196
Binary files /dev/null and b/assets/icon-apps/home_ico8.png differ
diff --git a/assets/icon-apps/home_ico9.png b/assets/icon-apps/home_ico9.png
new file mode 100644
index 0000000..9248c16
Binary files /dev/null and b/assets/icon-apps/home_ico9.png differ
diff --git a/assets/icon-apps/home_saoyisao.png b/assets/icon-apps/home_saoyisao.png
new file mode 100644
index 0000000..9bb9b4d
Binary files /dev/null and b/assets/icon-apps/home_saoyisao.png differ
diff --git a/assets/images/banner.png b/assets/images/banner.png
new file mode 100644
index 0000000..b45ab94
Binary files /dev/null and b/assets/images/banner.png differ
diff --git a/assets/images/bg1.png b/assets/images/bg1.png
new file mode 100644
index 0000000..0021e04
Binary files /dev/null and b/assets/images/bg1.png differ
diff --git a/assets/images/bg2.png b/assets/images/bg2.png
new file mode 100644
index 0000000..a7b3310
Binary files /dev/null and b/assets/images/bg2.png differ
diff --git a/assets/images/g_logo.png b/assets/images/g_logo.png
new file mode 100644
index 0000000..e538a42
Binary files /dev/null and b/assets/images/g_logo.png differ
diff --git a/assets/images/home_banner.png b/assets/images/home_banner.png
new file mode 100644
index 0000000..ab6fe67
Binary files /dev/null and b/assets/images/home_banner.png differ
diff --git a/assets/images/ico1.png b/assets/images/ico1.png
new file mode 100644
index 0000000..db8f3bc
Binary files /dev/null and b/assets/images/ico1.png differ
diff --git a/assets/images/ico10.png b/assets/images/ico10.png
new file mode 100644
index 0000000..f552067
Binary files /dev/null and b/assets/images/ico10.png differ
diff --git a/assets/images/ico11.png b/assets/images/ico11.png
new file mode 100644
index 0000000..e6866ce
Binary files /dev/null and b/assets/images/ico11.png differ
diff --git a/assets/images/ico12.png b/assets/images/ico12.png
new file mode 100644
index 0000000..33d14b2
Binary files /dev/null and b/assets/images/ico12.png differ
diff --git a/assets/images/ico13.png b/assets/images/ico13.png
new file mode 100644
index 0000000..6579a7e
Binary files /dev/null and b/assets/images/ico13.png differ
diff --git a/assets/images/ico14.png b/assets/images/ico14.png
new file mode 100644
index 0000000..9429020
Binary files /dev/null and b/assets/images/ico14.png differ
diff --git a/assets/images/ico15.png b/assets/images/ico15.png
new file mode 100644
index 0000000..338ad0a
Binary files /dev/null and b/assets/images/ico15.png differ
diff --git a/assets/images/ico16.png b/assets/images/ico16.png
new file mode 100644
index 0000000..176801c
Binary files /dev/null and b/assets/images/ico16.png differ
diff --git a/assets/images/ico2.png b/assets/images/ico2.png
new file mode 100644
index 0000000..15a5e92
Binary files /dev/null and b/assets/images/ico2.png differ
diff --git a/assets/images/ico3.png b/assets/images/ico3.png
new file mode 100644
index 0000000..7b9e46c
Binary files /dev/null and b/assets/images/ico3.png differ
diff --git a/assets/images/ico4.png b/assets/images/ico4.png
new file mode 100644
index 0000000..15258f7
Binary files /dev/null and b/assets/images/ico4.png differ
diff --git a/assets/images/ico5.png b/assets/images/ico5.png
new file mode 100644
index 0000000..8860b79
Binary files /dev/null and b/assets/images/ico5.png differ
diff --git a/assets/images/ico6.png b/assets/images/ico6.png
new file mode 100644
index 0000000..525779c
Binary files /dev/null and b/assets/images/ico6.png differ
diff --git a/assets/images/ico7.png b/assets/images/ico7.png
new file mode 100644
index 0000000..6fe5208
Binary files /dev/null and b/assets/images/ico7.png differ
diff --git a/assets/images/ico8.png b/assets/images/ico8.png
new file mode 100644
index 0000000..35fbaec
Binary files /dev/null and b/assets/images/ico8.png differ
diff --git a/assets/images/ico9.png b/assets/images/ico9.png
new file mode 100644
index 0000000..1bfa162
Binary files /dev/null and b/assets/images/ico9.png differ
diff --git a/assets/images/img1.png b/assets/images/img1.png
new file mode 100644
index 0000000..dfeea15
Binary files /dev/null and b/assets/images/img1.png differ
diff --git a/assets/images/img2.png b/assets/images/img2.png
new file mode 100644
index 0000000..e39de8d
Binary files /dev/null and b/assets/images/img2.png differ
diff --git a/assets/images/loginbg.png b/assets/images/loginbg.png
new file mode 100644
index 0000000..d2ab811
Binary files /dev/null and b/assets/images/loginbg.png differ
diff --git a/assets/images/logo.png b/assets/images/logo.png
new file mode 100644
index 0000000..64c5599
Binary files /dev/null and b/assets/images/logo.png differ
diff --git a/assets/images/lun.jpg b/assets/images/lun.jpg
new file mode 100644
index 0000000..bd769ef
Binary files /dev/null and b/assets/images/lun.jpg differ
diff --git a/assets/images/more.png b/assets/images/more.png
new file mode 100644
index 0000000..56d9ca7
Binary files /dev/null and b/assets/images/more.png differ
diff --git a/assets/images/my_bg.png b/assets/images/my_bg.png
new file mode 100644
index 0000000..600c5a7
Binary files /dev/null and b/assets/images/my_bg.png differ
diff --git a/assets/images/null.png b/assets/images/null.png
new file mode 100644
index 0000000..7df785c
Binary files /dev/null and b/assets/images/null.png differ
diff --git a/assets/images/search.png b/assets/images/search.png
new file mode 100644
index 0000000..1aec6e2
Binary files /dev/null and b/assets/images/search.png differ
diff --git a/assets/images/unit_banner.jpg b/assets/images/unit_banner.jpg
new file mode 100644
index 0000000..bb3daae
Binary files /dev/null and b/assets/images/unit_banner.jpg differ
diff --git a/assets/images/unit_ico1.png b/assets/images/unit_ico1.png
new file mode 100644
index 0000000..eb66ae6
Binary files /dev/null and b/assets/images/unit_ico1.png differ
diff --git a/assets/images/unit_ico2.png b/assets/images/unit_ico2.png
new file mode 100644
index 0000000..acdcf24
Binary files /dev/null and b/assets/images/unit_ico2.png differ
diff --git a/assets/js/jsencrypt.min.js b/assets/js/jsencrypt.min.js
new file mode 100644
index 0000000..174916b
--- /dev/null
+++ b/assets/js/jsencrypt.min.js
@@ -0,0 +1,2 @@
+/*! For license information please see jsencrypt.min.js.LICENSE.txt */
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.JSEncrypt=e():t.JSEncrypt=e()}(window,(()=>(()=>{var t={155:t=>{var e,i,r=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(i){try{return e.call(null,t,0)}catch(i){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:n}catch(t){e=n}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,a=[],u=!1,c=-1;function f(){u&&h&&(u=!1,h.length?a=h.concat(a):c=-1,a.length&&l())}function l(){if(!u){var t=o(f);u=!0;for(var e=a.length;e;){for(h=a,a=[];++c1)for(var i=1;i{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};return(()=>{"use strict";function t(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function e(t,e){return t&e}function n(t,e){return t|e}function s(t,e){return t^e}function o(t,e){return t&~e}function h(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function a(t){for(var e=0;0!=t;)t&=t-1,++e;return e}i.d(r,{default:()=>ot});var u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function f(t){var e,i,r="";for(e=0;e+3<=t.length;e+=3)i=parseInt(t.substring(e,e+3),16),r+=c.charAt(i>>6)+c.charAt(63&i);for(e+1==t.length?(i=parseInt(t.substring(e,e+1),16),r+=c.charAt(i<<2)):e+2==t.length&&(i=parseInt(t.substring(e,e+2),16),r+=c.charAt(i>>2)+c.charAt((3&i)<<4));(3&r.length)>0;)r+="=";return r}function l(e){var i,r="",n=0,s=0;for(i=0;i>2),s=3&o,n=1):1==n?(r+=t(s<<2|o>>4),s=15&o,n=2):2==n?(r+=t(s),r+=t(o>>2),s=3&o,n=3):(r+=t(s<<2|o>>4),r+=t(15&o),n=0))}return 1==n&&(r+=t(s<<2)),r}var p,g={decode:function(t){var e;if(void 0===p){var i="= \f\n\r\t \u2028\u2029";for(p=Object.create(null),e=0;e<64;++e)p["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(p["-"]=62,p._=63,e=0;e=4?(r[r.length]=n>>16,r[r.length]=n>>8&255,r[r.length]=255&n,n=0,s=0):n<<=6}}switch(s){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:r[r.length]=n>>10;break;case 3:r[r.length]=n>>16,r[r.length]=n>>8&255}return r},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=g.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return g.decode(t)}},d=1e13,v=function(){function t(t){this.buf=[+t||0]}return t.prototype.mulAdd=function(t,e){var i,r,n=this.buf,s=n.length;for(i=0;i0&&(n[i]=e)},t.prototype.sub=function(t){var e,i,r=this.buf,n=r.length;for(e=0;e=0;--r)i+=(d+e[r]).toString().substring(1);return i},t.prototype.valueOf=function(){for(var t=this.buf,e=0,i=t.length-1;i>=0;--i)e=e*d+t[i];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),m=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,y=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function b(t,e){return t.length>e&&(t=t.substring(0,e)+"…"),t}var T,S=function(){function t(e,i){this.hexDigits="0123456789ABCDEF",e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=i)}return t.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset ".concat(t," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]},t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e,i){for(var r="",n=t;n176)return!1}return!0},t.prototype.parseStringISO=function(t,e){for(var i="",r=t;r191&&n<224?String.fromCharCode((31&n)<<6|63&this.get(r++)):String.fromCharCode((15&n)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return i},t.prototype.parseStringBMP=function(t,e){for(var i,r,n="",s=t;s127,s=n?255:0,o="";r==s&&++t4){for(o=r,i<<=3;0==(128&(+o^s));)o=+o<<1,--i;o="("+i+" bit)\n"}n&&(r-=256);for(var h=new v(r),a=t+1;a=a;--u)s+=h>>u&1?"1":"0";if(s.length>i)return n+b(s,i)}return n+s},t.prototype.parseOctetString=function(t,e,i){if(this.isASCII(t,e))return b(this.parseStringISO(t,e),i);var r=e-t,n="("+r+" byte)\n";r>(i/=2)&&(e=t+i);for(var s=t;si&&(n+="…"),n},t.prototype.parseOID=function(t,e,i){for(var r="",n=new v,s=0,o=t;oi)return b(r,i);n=new v,s=0}}return s>0&&(r+=".incomplete"),r},t}(),E=function(){function t(t,e,i,r,n){if(!(r instanceof w))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=i,this.tag=r,this.sub=n}return t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},t.prototype.content=function(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),i=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+i);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+i,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);case 6:return this.stream.parseOID(e,e+i,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return b(this.stream.parseStringUTF(e,e+i),t);case 18:case 19:case 20:case 21:case 22:case 26:return b(this.stream.parseStringISO(e,e+i),t);case 30:return b(this.stream.parseStringBMP(e,e+i),t);case 23:case 24:return this.stream.parseTime(e,e+i,23==this.tag.tagNumber)}return null},t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},t.prototype.toPrettyString=function(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var i=0,r=this.sub.length;i6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===i)return null;e=0;for(var r=0;r>6,this.tagConstructed=0!=(32&e),this.tagNumber=31&e,31==this.tagNumber){var i=new v;do{e=t.get(),i.mulAdd(128,127&e)}while(128&e);this.tagNumber=i.simplify()}}return t.prototype.isUniversal=function(){return 0===this.tagClass},t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},t}(),D=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],x=(1<<26)/D[D.length-1],R=function(){function i(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}return i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var i;if(16==e)i=4;else if(8==e)i=3;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return this.toRadix(e);i=2}var r,n=(1<0)for(a>a)>0&&(s=!0,o=t(r));h>=0;)a>(a+=this.DB-i)):(r=this[h]>>(a-=i)&n,a<=0&&(a+=this.DB,--h)),r>0&&(s=!0),s&&(o+=t(r));return s?o:"0"},i.prototype.negate=function(){var t=I();return i.ZERO.subTo(this,t),t},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+C(this[this.t-1]^this.s&this.DM)},i.prototype.mod=function(t){var e=I();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(i.ZERO)>0&&t.subTo(e,e),e},i.prototype.modPowInt=function(t,e){var i;return i=t<256||e.isEven()?new O(e):new A(e),this.exp(t,i)},i.prototype.clone=function(){var t=I();return this.copyTo(t),t},i.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},i.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var i,r=this.DB-t*this.DB%8,n=0;if(t-- >0)for(r>r)!=(this.s&this.DM)>>r&&(e[n++]=i|this.s<=0;)r<8?(i=(this[t]&(1<>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==n&&(128&this.s)!=(128&i)&&++n,(n>0||i!=this.s)&&(e[n++]=i);return e},i.prototype.equals=function(t){return 0==this.compareTo(t)},i.prototype.min=function(t){return this.compareTo(t)<0?this:t},i.prototype.max=function(t){return this.compareTo(t)>0?this:t},i.prototype.and=function(t){var i=I();return this.bitwiseTo(t,e,i),i},i.prototype.or=function(t){var e=I();return this.bitwiseTo(t,n,e),e},i.prototype.xor=function(t){var e=I();return this.bitwiseTo(t,s,e),e},i.prototype.andNot=function(t){var e=I();return this.bitwiseTo(t,o,e),e},i.prototype.not=function(){for(var t=I(),e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var c=I();for(r.sqrTo(o[1],c);h<=u;)o[h]=I(),r.mulTo(c,o[h-2],o[h]),h+=2}var f,l,p=t.t-1,g=!0,d=I();for(n=C(t[p])-1;p>=0;){for(n>=a?f=t[p]>>n-a&u:(f=(t[p]&(1<0&&(f|=t[p-1]>>this.DB+n-a)),h=i;0==(1&f);)f>>=1,--h;if((n-=h)<0&&(n+=this.DB,--p),g)o[f].copyTo(s),g=!1;else{for(;h>1;)r.sqrTo(s,d),r.sqrTo(d,s),h-=2;h>0?r.sqrTo(s,d):(l=s,s=d,d=l),r.mulTo(d,o[f],s)}for(;p>=0&&0==(t[p]&1<=0?(r.subTo(n,r),e&&s.subTo(h,s),o.subTo(a,o)):(n.subTo(r,n),e&&h.subTo(s,h),a.subTo(o,a))}return 0!=n.compareTo(i.ONE)?i.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},i.prototype.pow=function(t){return this.exp(t,new B)},i.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var r=e;e=i,i=r}var n=e.getLowestSetBit(),s=i.getLowestSetBit();if(s<0)return e;for(n0&&(e.rShiftTo(s,e),i.rShiftTo(s,i));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=i.getLowestSetBit())>0&&i.rShiftTo(n,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return s>0&&i.lShiftTo(s,i),i},i.prototype.isProbablePrime=function(t){var e,i=this.abs();if(1==i.t&&i[0]<=D[D.length-1]){for(e=0;e=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},i.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},i.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,s=!1,o=0;--n>=0;){var h=8==r?255&+t[n]:q(t,n);h<0?"-"==t.charAt(n)&&(s=!0):(s=!1,0==o?this[this.t++]=h:o+r>this.DB?(this[this.t-1]|=(h&(1<>this.DB-o):this[this.t-1]|=h<=this.DB&&(o-=this.DB))}8==r&&0!=(128&+t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},i.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s},i.prototype.drShiftTo=function(t,e){for(var i=t;i=0;--h)e[h+s+1]=this[h]>>r|o,o=(this[h]&n)<=0;--h)e[h]=0;e[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()},i.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)e.t=0;else{var r=t%this.DB,n=this.DB-r,s=(1<>r;for(var o=i+1;o>r;r>0&&(e[this.t-i-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;i>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[i++]=this.DV+r:r>0&&(e[i++]=r),e.t=i,e.clamp()},i.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),s=r.t;for(e.t=s+n.t;--s>=0;)e[s]=0;for(s=0;s=0;)t[i]=0;for(i=0;i=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},i.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var s=this.abs();if(s.t0?(n.lShiftTo(u,o),s.lShiftTo(u,r)):(n.copyTo(o),s.copyTo(r));var c=o.t,f=o[c-1];if(0!=f){var l=f*(1<1?o[c-2]>>this.F2:0),p=this.FV/l,g=(1<=0&&(r[r.t++]=1,r.subTo(y,r)),i.ONE.dlShiftTo(c,y),y.subTo(o,o);o.t=0;){var b=r[--v]==f?this.DM:Math.floor(r[v]*p+(r[v-1]+d)*g);if((r[v]+=o.am(0,b,r,m,0,c))0&&r.rShiftTo(u,r),h<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},i.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},i.prototype.exp=function(t,e){if(t>4294967295||t<1)return i.ONE;var r=I(),n=I(),s=e.convert(this),o=C(t)-1;for(s.copyTo(r);--o>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,s,r);else{var h=r;r=n,n=h}return e.revert(r)},i.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},i.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),r=H(i),n=I(),s=I(),o="";for(this.divRemTo(r,n,s);n.signum()>0;)o=(i+s.intValue()).toString(t).substr(1)+o,n.divRemTo(r,n,s);return s.intValue().toString(t)+o},i.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),s=!1,o=0,h=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(h,0),o=0,h=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(h,0)),s&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(i.ONE.shiftLeft(t-1),n,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(i.ONE.shiftLeft(t-1),this);else{var s=[],o=7&t;s.length=1+(t>>3),e.nextBytes(s),o>0?s[0]&=(1<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;i>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[i++]=r:r<-1&&(e[i++]=this.DV+r),e.t=i,e.clamp()},i.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},i.prototype.multiplyLowerTo=function(t,e,i){var r=Math.min(this.t+t.t,e);for(i.s=0,i.t=r;r>0;)i[--r]=0;for(var n=i.t-this.t;r=0;)i[r]=0;for(r=Math.max(e-this.t,0);r0)if(0==e)i=this[0]%t;else for(var r=this.t-1;r>=0;--r)i=(e*i+this[r])%t;return i},i.prototype.millerRabin=function(t){var e=this.subtract(i.ONE),r=e.getLowestSetBit();if(r<=0)return!1;var n=e.shiftRight(r);(t=t+1>>1)>D.length&&(t=D.length);for(var s=I(),o=0;o0&&(i.rShiftTo(o,i),r.rShiftTo(o,r));var h=function(){(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),(s=r.getLowestSetBit())>0&&r.rShiftTo(s,r),i.compareTo(r)>=0?(i.subTo(r,i),i.rShiftTo(1,i)):(r.subTo(i,r),r.rShiftTo(1,r)),i.signum()>0?setTimeout(h,0):(o>0&&r.lShiftTo(o,r),setTimeout((function(){e(r)}),0))};setTimeout(h,10)}},i.prototype.fromNumberAsync=function(t,e,r,s){if("number"==typeof e)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(i.ONE.shiftLeft(t-1),n,this),this.isEven()&&this.dAddOffset(1,0);var o=this,h=function(){o.dAddOffset(2,0),o.bitLength()>t&&o.subTo(i.ONE.shiftLeft(t-1),o),o.isProbablePrime(e)?setTimeout((function(){s()}),0):setTimeout(h,0)};setTimeout(h,0)}else{var a=[],u=7&t;a.length=1+(t>>3),e.nextBytes(a),u>0?a[0]&=(1<=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),A=function(){function t(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=I();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),V=function(){function t(t){this.m=t,this.r2=I(),this.q3=I(),R.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=I();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}();function I(){return new R(null)}function N(t,e){return new R(t,e)}var P="undefined"!=typeof navigator;P&&"Microsoft Internet Explorer"==navigator.appName?(R.prototype.am=function(t,e,i,r,n,s){for(var o=32767&e,h=e>>15;--s>=0;){var a=32767&this[t],u=this[t++]>>15,c=h*a+u*o;n=((a=o*a+((32767&c)<<15)+i[r]+(1073741823&n))>>>30)+(c>>>15)+h*u+(n>>>30),i[r++]=1073741823&a}return n},T=30):P&&"Netscape"!=navigator.appName?(R.prototype.am=function(t,e,i,r,n,s){for(;--s>=0;){var o=e*this[t++]+i[r]+n;n=Math.floor(o/67108864),i[r++]=67108863&o}return n},T=26):(R.prototype.am=function(t,e,i,r,n,s){for(var o=16383&e,h=e>>14;--s>=0;){var a=16383&this[t],u=this[t++]>>14,c=h*a+u*o;n=((a=o*a+((16383&c)<<14)+i[r]+n)>>28)+(c>>14)+h*u,i[r++]=268435455&a}return n},T=28),R.prototype.DB=T,R.prototype.DM=(1<>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}R.ZERO=H(0),R.ONE=H(1);var F,U,K=function(){function t(){this.i=0,this.j=0,this.S=[]}return t.prototype.init=function(t){var e,i,r;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[i],this.S[i]=r;this.i=0,this.j=0},t.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},t}(),k=null;if(null==k){k=[],U=0;var _=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var z=new Uint32Array(256);for(window.crypto.getRandomValues(z),_=0;_=256||U>=256)window.removeEventListener?window.removeEventListener("mousemove",G,!1):window.detachEvent&&window.detachEvent("onmousemove",G);else try{var e=t.x+t.y;k[U++]=255&e,Z+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",G,!1):window.attachEvent&&window.attachEvent("onmousemove",G))}function $(){if(null==F){for(F=new K;U<256;){var t=Math.floor(65536*Math.random());k[U++]=255&t}for(F.init(k),U=0;U0&&e.length>0?(this.n=N(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3,i=function(t,e){if(e=0&&e>0;){var n=t.charCodeAt(r--);n<128?i[--e]=n:n>127&&n<2048?(i[--e]=63&n|128,i[--e]=n>>6|192):(i[--e]=63&n|128,i[--e]=n>>6&63|128,i[--e]=n>>12|224)}i[--e]=0;for(var s=new Y,o=[];e>2;){for(o[0]=0;0==o[0];)s.nextBytes(o);i[--e]=o[0]}return i[--e]=2,i[--e]=0,new R(i)}(t,e);if(null==i)return null;var r=this.doPublic(i);if(null==r)return null;for(var n=r.toString(16),s=n.length,o=0;o<2*e-s;o++)n="0"+n;return n},t.prototype.setPrivate=function(t,e,i){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=N(t,16),this.e=parseInt(e,16),this.d=N(i,16)):console.error("Invalid RSA private key")},t.prototype.setPrivateEx=function(t,e,i,r,n,s,o,h){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=N(t,16),this.e=parseInt(e,16),this.d=N(i,16),this.p=N(r,16),this.q=N(n,16),this.dmp1=N(s,16),this.dmq1=N(o,16),this.coeff=N(h,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var i=new Y,r=t>>1;this.e=parseInt(e,16);for(var n=new R(e,16);;){for(;this.p=new R(t-r,1,i),0!=this.p.subtract(R.ONE).gcd(n).compareTo(R.ONE)||!this.p.isProbablePrime(10););for(;this.q=new R(r,1,i),0!=this.q.subtract(R.ONE).gcd(n).compareTo(R.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q,this.q=s}var o=this.p.subtract(R.ONE),h=this.q.subtract(R.ONE),a=o.multiply(h);if(0==a.gcd(n).compareTo(R.ONE)){this.n=this.p.multiply(this.q),this.d=n.modInverse(a),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=N(t,16),i=this.doPrivate(e);return null==i?null:function(t,e){for(var i=t.toByteArray(),r=0;r=i.length)return null;for(var n="";++r191&&s<224?(n+=String.fromCharCode((31&s)<<6|63&i[r+1]),++r):(n+=String.fromCharCode((15&s)<<12|(63&i[r+1])<<6|63&i[r+2]),r+=2)}return n}(i,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,i){var r=new Y,n=t>>1;this.e=parseInt(e,16);var s=new R(e,16),o=this,h=function(){var e=function(){if(o.p.compareTo(o.q)<=0){var t=o.p;o.p=o.q,o.q=t}var e=o.p.subtract(R.ONE),r=o.q.subtract(R.ONE),n=e.multiply(r);0==n.gcd(s).compareTo(R.ONE)?(o.n=o.p.multiply(o.q),o.d=s.modInverse(n),o.dmp1=o.d.mod(e),o.dmq1=o.d.mod(r),o.coeff=o.q.modInverse(o.p),setTimeout((function(){i()}),0)):setTimeout(h,0)},a=function(){o.q=I(),o.q.fromNumberAsync(n,1,r,(function(){o.q.subtract(R.ONE).gcda(s,(function(t){0==t.compareTo(R.ONE)&&o.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(a,0)}))}))},u=function(){o.p=I(),o.p.fromNumberAsync(t-n,1,r,(function(){o.p.subtract(R.ONE).gcda(s,(function(t){0==t.compareTo(R.ONE)&&o.p.isProbablePrime(10)?setTimeout(a,0):setTimeout(u,0)}))}))};setTimeout(u,0)};setTimeout(h,0)},t.prototype.sign=function(t,e,i){var r=function(t,e){if(e15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+i).toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},W.asn1.DERAbstractString=function(t){W.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},Q.lang.extend(W.asn1.DERAbstractString,W.asn1.ASN1Object),W.asn1.DERAbstractTime=function(t){W.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e,i){var r=this.zeroPadding,n=this.localDateToUTC(t),s=String(n.getFullYear());"utc"==e&&(s=s.substr(2,2));var o=s+r(String(n.getMonth()+1),2)+r(String(n.getDate()),2)+r(String(n.getHours()),2)+r(String(n.getMinutes()),2)+r(String(n.getSeconds()),2);if(!0===i){var h=n.getMilliseconds();if(0!=h){var a=r(String(h),3);o=o+"."+(a=a.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,i,r,n,s){var o=new Date(Date.UTC(t,e-1,i,r,n,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},Q.lang.extend(W.asn1.DERAbstractTime,W.asn1.ASN1Object),W.asn1.DERAbstractStructured=function(t){W.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},Q.lang.extend(W.asn1.DERAbstractStructured,W.asn1.ASN1Object),W.asn1.DERBoolean=function(){W.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},Q.lang.extend(W.asn1.DERBoolean,W.asn1.ASN1Object),W.asn1.DERInteger=function(t){W.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=W.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new R(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Q.lang.extend(W.asn1.DERInteger,W.asn1.ASN1Object),W.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=W.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}W.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7=2?(n[n.length]=s,s=0,o=0):s<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return n}(t):g.unarmor(t),n=E.decode(r);if(3===n.sub.length&&(n=n.sub[2].sub[0]),9===n.sub.length){e=n.sub[1].getHexStringValue(),this.n=N(e,16),i=n.sub[2].getHexStringValue(),this.e=parseInt(i,16);var s=n.sub[3].getHexStringValue();this.d=N(s,16);var o=n.sub[4].getHexStringValue();this.p=N(o,16);var h=n.sub[5].getHexStringValue();this.q=N(h,16);var a=n.sub[6].getHexStringValue();this.dmp1=N(a,16);var c=n.sub[7].getHexStringValue();this.dmq1=N(c,16);var f=n.sub[8].getHexStringValue();this.coeff=N(f,16)}else{if(2!==n.sub.length)return!1;if(n.sub[0].sub){var l=n.sub[1].sub[0];e=l.sub[0].getHexStringValue(),this.n=N(e,16),i=l.sub[1].getHexStringValue(),this.e=parseInt(i,16)}else e=n.sub[0].getHexStringValue(),this.n=N(e,16),i=n.sub[1].getHexStringValue(),this.e=parseInt(i,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new W.asn1.DERInteger({int:0}),new W.asn1.DERInteger({bigint:this.n}),new W.asn1.DERInteger({int:this.e}),new W.asn1.DERInteger({bigint:this.d}),new W.asn1.DERInteger({bigint:this.p}),new W.asn1.DERInteger({bigint:this.q}),new W.asn1.DERInteger({bigint:this.dmp1}),new W.asn1.DERInteger({bigint:this.dmq1}),new W.asn1.DERInteger({bigint:this.coeff})]};return new W.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return f(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new W.asn1.DERSequence({array:[new W.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new W.asn1.DERNull]}),e=new W.asn1.DERSequence({array:[new W.asn1.DERInteger({bigint:this.n}),new W.asn1.DERInteger({int:this.e})]}),i=new W.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new W.asn1.DERSequence({array:[t,i]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return f(this.getPublicBaseKey())},e.wordwrap=function(t,e){if(!t)return t;var i="(.{1,"+(e=e||64)+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(i,"g")).join("\n")},e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return(t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return(t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},e.hasPublicKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")},e.hasPrivateKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(J),nt=i(155),st=void 0!==nt?null===(et=nt.env)||void 0===et?void 0:"3.3.1":void 0;const ot=function(){function t(t){void 0===t&&(t={}),t=t||{},this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return t.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new rt(t)},t.prototype.setPrivateKey=function(t){this.setKey(t)},t.prototype.setPublicKey=function(t){this.setKey(t)},t.prototype.decrypt=function(t){try{return this.getKey().decrypt(l(t))}catch(t){return!1}},t.prototype.encrypt=function(t){try{return f(this.getKey().encrypt(t))}catch(t){return!1}},t.prototype.sign=function(t,e,i){try{return f(this.getKey().sign(t,e,i))}catch(t){return!1}},t.prototype.verify=function(t,e,i){try{return this.getKey().verify(t,l(e),i)}catch(t){return!1}},t.prototype.getKey=function(t){if(!this.key){if(this.key=new rt,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},t.version=st,t}()})(),r.default})()));
\ No newline at end of file
diff --git a/assets/map/100.png b/assets/map/100.png
new file mode 100644
index 0000000..2639bba
Binary files /dev/null and b/assets/map/100.png differ
diff --git a/assets/map/50.png b/assets/map/50.png
new file mode 100644
index 0000000..e67c5d0
Binary files /dev/null and b/assets/map/50.png differ
diff --git a/assets/map/c.png b/assets/map/c.png
new file mode 100644
index 0000000..23b2c8d
Binary files /dev/null and b/assets/map/c.png differ
diff --git a/assets/map/h.png b/assets/map/h.png
new file mode 100644
index 0000000..31cec4a
Binary files /dev/null and b/assets/map/h.png differ
diff --git a/assets/map/hh.png b/assets/map/hh.png
new file mode 100644
index 0000000..dc8c775
Binary files /dev/null and b/assets/map/hh.png differ
diff --git a/assets/map/index.html b/assets/map/index.html
new file mode 100644
index 0000000..5581383
--- /dev/null
+++ b/assets/map/index.html
@@ -0,0 +1,389 @@
+
+
+
+
+ 特殊作业扎点
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/map/jc.png b/assets/map/jc.png
new file mode 100644
index 0000000..38bbc8f
Binary files /dev/null and b/assets/map/jc.png differ
diff --git a/assets/map/l.png b/assets/map/l.png
new file mode 100644
index 0000000..165f498
Binary files /dev/null and b/assets/map/l.png differ
diff --git a/assets/map/ls.png b/assets/map/ls.png
new file mode 100644
index 0000000..fb06e6b
Binary files /dev/null and b/assets/map/ls.png differ
diff --git a/assets/map/map.html b/assets/map/map.html
new file mode 100644
index 0000000..94addd3
--- /dev/null
+++ b/assets/map/map.html
@@ -0,0 +1,137 @@
+
+
+
+
+
+ 地图
+
+
+
+
+
+
+
+
+
diff --git a/assets/tabbar/application.png b/assets/tabbar/application.png
new file mode 100644
index 0000000..374d201
Binary files /dev/null and b/assets/tabbar/application.png differ
diff --git a/assets/tabbar/application_cur.png b/assets/tabbar/application_cur.png
new file mode 100644
index 0000000..0ac6464
Binary files /dev/null and b/assets/tabbar/application_cur.png differ
diff --git a/assets/tabbar/basics.png b/assets/tabbar/basics.png
new file mode 100644
index 0000000..8522b0f
Binary files /dev/null and b/assets/tabbar/basics.png differ
diff --git a/assets/tabbar/basics_cur.png b/assets/tabbar/basics_cur.png
new file mode 100644
index 0000000..4a985aa
Binary files /dev/null and b/assets/tabbar/basics_cur.png differ
diff --git a/assets/tabbar/my.png b/assets/tabbar/my.png
new file mode 100644
index 0000000..bccbace
Binary files /dev/null and b/assets/tabbar/my.png differ
diff --git a/assets/tabbar/my_cur.png b/assets/tabbar/my_cur.png
new file mode 100644
index 0000000..a001fe2
Binary files /dev/null and b/assets/tabbar/my_cur.png differ
diff --git a/assets/tabbar/works.png b/assets/tabbar/works.png
new file mode 100644
index 0000000..09a1f09
Binary files /dev/null and b/assets/tabbar/works.png differ
diff --git a/assets/tabbar/works_cur.png b/assets/tabbar/works_cur.png
new file mode 100644
index 0000000..feaf442
Binary files /dev/null and b/assets/tabbar/works_cur.png differ
diff --git a/devtools_options.yaml b/devtools_options.yaml
new file mode 100644
index 0000000..fa0b357
--- /dev/null
+++ b/devtools_options.yaml
@@ -0,0 +1,3 @@
+description: This file stores settings for Dart & Flutter DevTools.
+documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
+extensions:
diff --git a/ios/.gitignore b/ios/.gitignore
new file mode 100644
index 0000000..7a7f987
--- /dev/null
+++ b/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/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist
new file mode 100644
index 0000000..1dc6cf7
--- /dev/null
+++ b/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
+ 13.0
+
+
diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig
new file mode 100644
index 0000000..ec97fc6
--- /dev/null
+++ b/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/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig
new file mode 100644
index 0000000..c4855bf
--- /dev/null
+++ b/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/ios/Podfile b/ios/Podfile
new file mode 100644
index 0000000..620e46e
--- /dev/null
+++ b/ios/Podfile
@@ -0,0 +1,43 @@
+# Uncomment this line to define a global platform for your project
+# platform :ios, '13.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
+ use_frameworks!
+
+ flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+ target 'RunnerTests' do
+ inherit! :search_paths
+ end
+end
+
+post_install do |installer|
+ installer.pods_project.targets.each do |target|
+ flutter_additional_ios_build_settings(target)
+ end
+end
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
new file mode 100644
index 0000000..5b28235
--- /dev/null
+++ b/ios/Podfile.lock
@@ -0,0 +1,237 @@
+PODS:
+ - BaiduMapKit/Base (6.6.4)
+ - BaiduMapKit/Map (6.6.4):
+ - BaiduMapKit/Base
+ - BaiduMapKit/Utils (6.6.4):
+ - BaiduMapKit/Base
+ - camera_avfoundation (0.0.1):
+ - Flutter
+ - connectivity_plus (0.0.1):
+ - Flutter
+ - device_info_plus (0.0.1):
+ - Flutter
+ - DKImagePickerController/Core (4.3.9):
+ - DKImagePickerController/ImageDataManager
+ - DKImagePickerController/Resource
+ - DKImagePickerController/ImageDataManager (4.3.9)
+ - DKImagePickerController/PhotoGallery (4.3.9):
+ - DKImagePickerController/Core
+ - DKPhotoGallery
+ - DKImagePickerController/Resource (4.3.9)
+ - DKPhotoGallery (0.0.19):
+ - DKPhotoGallery/Core (= 0.0.19)
+ - DKPhotoGallery/Model (= 0.0.19)
+ - DKPhotoGallery/Preview (= 0.0.19)
+ - DKPhotoGallery/Resource (= 0.0.19)
+ - SDWebImage
+ - SwiftyGif
+ - DKPhotoGallery/Core (0.0.19):
+ - DKPhotoGallery/Model
+ - DKPhotoGallery/Preview
+ - SDWebImage
+ - SwiftyGif
+ - DKPhotoGallery/Model (0.0.19):
+ - SDWebImage
+ - SwiftyGif
+ - DKPhotoGallery/Preview (0.0.19):
+ - DKPhotoGallery/Model
+ - DKPhotoGallery/Resource
+ - SDWebImage
+ - SwiftyGif
+ - DKPhotoGallery/Resource (0.0.19):
+ - SDWebImage
+ - SwiftyGif
+ - file_picker (0.0.1):
+ - DKImagePickerController/PhotoGallery
+ - Flutter
+ - Flutter (1.0.0)
+ - flutter_baidu_mapapi_base (3.9.0):
+ - BaiduMapKit/Utils (= 6.6.4)
+ - Flutter
+ - flutter_baidu_mapapi_map (3.9.0):
+ - BaiduMapKit/Map (= 6.6.4)
+ - Flutter
+ - flutter_baidu_mapapi_base
+ - flutter_baidu_mapapi_utils (3.9.0):
+ - BaiduMapKit/Utils (= 6.6.4)
+ - Flutter
+ - flutter_baidu_mapapi_base
+ - flutter_native_splash (2.4.3):
+ - Flutter
+ - flutter_new_badger (0.0.1):
+ - Flutter
+ - fluttertoast (0.0.2):
+ - Flutter
+ - geolocator_apple (1.2.0):
+ - Flutter
+ - FlutterMacOS
+ - image_picker_ios (0.0.1):
+ - Flutter
+ - mobile_scanner (7.0.0):
+ - Flutter
+ - FlutterMacOS
+ - nfc_manager (0.0.1):
+ - Flutter
+ - objective_c (0.0.1):
+ - Flutter
+ - open_file_ios (0.0.1):
+ - Flutter
+ - package_info_plus (0.4.5):
+ - Flutter
+ - pdfx (1.0.0):
+ - Flutter
+ - permission_handler_apple (9.3.0):
+ - Flutter
+ - photo_manager (3.8.0):
+ - Flutter
+ - FlutterMacOS
+ - SDWebImage (5.21.1):
+ - SDWebImage/Core (= 5.21.1)
+ - SDWebImage/Core (5.21.1)
+ - shared_preferences_foundation (0.0.1):
+ - Flutter
+ - FlutterMacOS
+ - SwiftyGif (5.4.5)
+ - url_launcher_ios (0.0.1):
+ - Flutter
+ - video_compress (0.3.0):
+ - Flutter
+ - video_player_avfoundation (0.0.1):
+ - Flutter
+ - FlutterMacOS
+ - wakelock_plus (0.0.1):
+ - Flutter
+ - webview_flutter_wkwebview (0.0.1):
+ - Flutter
+ - FlutterMacOS
+
+DEPENDENCIES:
+ - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
+ - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
+ - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
+ - file_picker (from `.symlinks/plugins/file_picker/ios`)
+ - Flutter (from `Flutter`)
+ - flutter_baidu_mapapi_base (from `.symlinks/plugins/flutter_baidu_mapapi_base/ios`)
+ - flutter_baidu_mapapi_map (from `.symlinks/plugins/flutter_baidu_mapapi_map/ios`)
+ - flutter_baidu_mapapi_utils (from `.symlinks/plugins/flutter_baidu_mapapi_utils/ios`)
+ - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
+ - flutter_new_badger (from `.symlinks/plugins/flutter_new_badger/ios`)
+ - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
+ - geolocator_apple (from `.symlinks/plugins/geolocator_apple/darwin`)
+ - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
+ - mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
+ - nfc_manager (from `.symlinks/plugins/nfc_manager/ios`)
+ - objective_c (from `.symlinks/plugins/objective_c/ios`)
+ - open_file_ios (from `.symlinks/plugins/open_file_ios/ios`)
+ - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
+ - pdfx (from `.symlinks/plugins/pdfx/ios`)
+ - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
+ - photo_manager (from `.symlinks/plugins/photo_manager/darwin`)
+ - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
+ - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
+ - video_compress (from `.symlinks/plugins/video_compress/ios`)
+ - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
+ - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
+ - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`)
+
+SPEC REPOS:
+ trunk:
+ - BaiduMapKit
+ - DKImagePickerController
+ - DKPhotoGallery
+ - SDWebImage
+ - SwiftyGif
+
+EXTERNAL SOURCES:
+ camera_avfoundation:
+ :path: ".symlinks/plugins/camera_avfoundation/ios"
+ connectivity_plus:
+ :path: ".symlinks/plugins/connectivity_plus/ios"
+ device_info_plus:
+ :path: ".symlinks/plugins/device_info_plus/ios"
+ file_picker:
+ :path: ".symlinks/plugins/file_picker/ios"
+ Flutter:
+ :path: Flutter
+ flutter_baidu_mapapi_base:
+ :path: ".symlinks/plugins/flutter_baidu_mapapi_base/ios"
+ flutter_baidu_mapapi_map:
+ :path: ".symlinks/plugins/flutter_baidu_mapapi_map/ios"
+ flutter_baidu_mapapi_utils:
+ :path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios"
+ flutter_native_splash:
+ :path: ".symlinks/plugins/flutter_native_splash/ios"
+ flutter_new_badger:
+ :path: ".symlinks/plugins/flutter_new_badger/ios"
+ fluttertoast:
+ :path: ".symlinks/plugins/fluttertoast/ios"
+ geolocator_apple:
+ :path: ".symlinks/plugins/geolocator_apple/darwin"
+ image_picker_ios:
+ :path: ".symlinks/plugins/image_picker_ios/ios"
+ mobile_scanner:
+ :path: ".symlinks/plugins/mobile_scanner/darwin"
+ nfc_manager:
+ :path: ".symlinks/plugins/nfc_manager/ios"
+ objective_c:
+ :path: ".symlinks/plugins/objective_c/ios"
+ open_file_ios:
+ :path: ".symlinks/plugins/open_file_ios/ios"
+ package_info_plus:
+ :path: ".symlinks/plugins/package_info_plus/ios"
+ pdfx:
+ :path: ".symlinks/plugins/pdfx/ios"
+ permission_handler_apple:
+ :path: ".symlinks/plugins/permission_handler_apple/ios"
+ photo_manager:
+ :path: ".symlinks/plugins/photo_manager/darwin"
+ shared_preferences_foundation:
+ :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
+ url_launcher_ios:
+ :path: ".symlinks/plugins/url_launcher_ios/ios"
+ video_compress:
+ :path: ".symlinks/plugins/video_compress/ios"
+ video_player_avfoundation:
+ :path: ".symlinks/plugins/video_player_avfoundation/darwin"
+ wakelock_plus:
+ :path: ".symlinks/plugins/wakelock_plus/ios"
+ webview_flutter_wkwebview:
+ :path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
+
+SPEC CHECKSUMS:
+ BaiduMapKit: 84991811cb07b24c6ead7d59022c13245427782c
+ camera_avfoundation: 5675ca25298b6f81fa0a325188e7df62cc217741
+ connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
+ device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
+ DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
+ DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
+ file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be
+ Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
+ flutter_baidu_mapapi_base: 24dd82034374c6f52a73e90316834c63ff8d4f64
+ flutter_baidu_mapapi_map: f799cc1bb3d39196b8d3d59399ca8635e690bd44
+ flutter_baidu_mapapi_utils: 0c69394243d51e97f521f396e150aaaf31e84e29
+ flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
+ flutter_new_badger: 133aaf93e9a5542bf905c8483d8b83c5ef4946ea
+ fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1
+ geolocator_apple: ab36aa0e8b7d7a2d7639b3b4e48308394e8cef5e
+ image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
+ mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
+ nfc_manager: f6d5609c09b4640b914a3dc67479a2e392965fd0
+ objective_c: 89e720c30d716b036faf9c9684022048eee1eee2
+ open_file_ios: 5ff7526df64e4394b4fe207636b67a95e83078bb
+ package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
+ pdfx: 77f4dddc48361fbb01486fa2bdee4532cbb97ef3
+ permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
+ photo_manager: 343d78032bf7ebe944d2ab9702204dc2eda07338
+ SDWebImage: f29024626962457f3470184232766516dee8dfea
+ shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
+ SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
+ url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
+ video_compress: f2133a07762889d67f0711ac831faa26f956980e
+ video_player_avfoundation: dd410b52df6d2466a42d28550e33e4146928280a
+ wakelock_plus: e29112ab3ef0b318e58cfa5c32326458be66b556
+ webview_flutter_wkwebview: 8ebf4fded22593026f7dbff1fbff31ea98573c8d
+
+PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e
+
+COCOAPODS: 1.16.2
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..b3c07f8
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -0,0 +1,777 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 54;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
+ 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 */; };
+ D5BBE0FD0EAD05B450AEE37D /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D535373899AA9DD1E6E7511 /* Pods_RunnerTests.framework */; };
+ F6873A5EEA3A9CD4CC30B8F1 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1EE4D2BDFD716FB80E3EB92 /* Pods_Runner.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 97C146E61CF9000F007C117D /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 97C146ED1CF9000F007C117D;
+ remoteInfo = Runner;
+ };
+/* End PBXContainerItemProxy 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 = ""; };
+ 1D535373899AA9DD1E6E7511 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
+ 45D597292E2F804B009DEAE7 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; };
+ 71118A79D1B878EF92EF0C82 /* 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 = ""; };
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; 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; };
+ 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 = ""; };
+ A56B7CF3BE602CF776E716CF /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; };
+ B32FA449F9E8B4334D347232 /* 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 = ""; };
+ D892E03EBCFFE7AEA26BADEF /* 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 = ""; };
+ E32A50F59BB884B8EEEA48BB /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; };
+ EB96BCD274E74DA46B53876B /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; };
+ F1EE4D2BDFD716FB80E3EB92 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 97C146EB1CF9000F007C117D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F6873A5EEA3A9CD4CC30B8F1 /* Pods_Runner.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 9AD71197BA5C33D24636B03A /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D5BBE0FD0EAD05B450AEE37D /* Pods_RunnerTests.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 331C8082294A63A400263BE5 /* RunnerTests */ = {
+ isa = PBXGroup;
+ children = (
+ 331C807B294A618700263BE5 /* RunnerTests.swift */,
+ );
+ path = RunnerTests;
+ 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 */,
+ 331C8082294A63A400263BE5 /* RunnerTests */,
+ D1B24C997F4A0101CD2D397B /* Pods */,
+ DB502A4E3FC0608DF67A6BF0 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ 97C146EF1CF9000F007C117D /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146EE1CF9000F007C117D /* Runner.app */,
+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 97C146F01CF9000F007C117D /* Runner */ = {
+ isa = PBXGroup;
+ children = (
+ 45D597292E2F804B009DEAE7 /* Runner.entitlements */,
+ 97C146FA1CF9000F007C117D /* Main.storyboard */,
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */,
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
+ 97C147021CF9000F007C117D /* Info.plist */,
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
+ );
+ path = Runner;
+ sourceTree = "";
+ };
+ D1B24C997F4A0101CD2D397B /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ D892E03EBCFFE7AEA26BADEF /* Pods-Runner.debug.xcconfig */,
+ 71118A79D1B878EF92EF0C82 /* Pods-Runner.release.xcconfig */,
+ B32FA449F9E8B4334D347232 /* Pods-Runner.profile.xcconfig */,
+ E32A50F59BB884B8EEEA48BB /* Pods-RunnerTests.debug.xcconfig */,
+ EB96BCD274E74DA46B53876B /* Pods-RunnerTests.release.xcconfig */,
+ A56B7CF3BE602CF776E716CF /* Pods-RunnerTests.profile.xcconfig */,
+ );
+ path = Pods;
+ sourceTree = "";
+ };
+ DB502A4E3FC0608DF67A6BF0 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ F1EE4D2BDFD716FB80E3EB92 /* Pods_Runner.framework */,
+ 1D535373899AA9DD1E6E7511 /* Pods_RunnerTests.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 331C8080294A63A400263BE5 /* RunnerTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
+ buildPhases = (
+ AB8878D34A77D2374C7913D0 /* [CP] Check Pods Manifest.lock */,
+ 331C807D294A63A400263BE5 /* Sources */,
+ 331C807F294A63A400263BE5 /* Resources */,
+ 9AD71197BA5C33D24636B03A /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 331C8086294A63A400263BE5 /* PBXTargetDependency */,
+ );
+ name = RunnerTests;
+ productName = RunnerTests;
+ productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 97C146ED1CF9000F007C117D /* Runner */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
+ buildPhases = (
+ DCD396AFC5D4EF84A1AB88FB /* [CP] Check Pods Manifest.lock */,
+ 9740EEB61CF901F6004384FC /* Run Script */,
+ 97C146EA1CF9000F007C117D /* Sources */,
+ 97C146EB1CF9000F007C117D /* Frameworks */,
+ 97C146EC1CF9000F007C117D /* Resources */,
+ 9705A1C41CF9048500538489 /* Embed Frameworks */,
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+ 9D4AB6A98949D5BF69896B41 /* [CP] Embed Pods Frameworks */,
+ 278BCE4BA5CD53A70DAEC00A /* [CP] Copy Pods Resources */,
+ );
+ 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 = {
+ BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 1510;
+ ORGANIZATIONNAME = "";
+ TargetAttributes = {
+ 331C8080294A63A400263BE5 = {
+ CreatedOnToolsVersion = 14.0;
+ TestTargetID = 97C146ED1CF9000F007C117D;
+ };
+ 97C146ED1CF9000F007C117D = {
+ CreatedOnToolsVersion = 7.3.1;
+ LastSwiftMigration = 1100;
+ };
+ };
+ };
+ 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 */,
+ 331C8080294A63A400263BE5 /* RunnerTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 331C807F294A63A400263BE5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 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 */
+ 278BCE4BA5CD53A70DAEC00A /* [CP] Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
+ );
+ name = "[CP] Copy Pods Resources";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
+ );
+ 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;
+ alwaysOutOfDate = 1;
+ 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";
+ };
+ 9D4AB6A98949D5BF69896B41 /* [CP] Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+ );
+ name = "[CP] Embed Pods Frameworks";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ AB8878D34A77D2374C7913D0 /* [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-RunnerTests-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;
+ };
+ DCD396AFC5D4EF84A1AB88FB /* [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;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 331C807D294A63A400263BE5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 97C146EA1CF9000F007C117D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 97C146ED1CF9000F007C117D /* Runner */;
+ targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency 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;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ 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;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ 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 = 13.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;
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CODE_SIGN_STYLE = Manual;
+ CURRENT_PROJECT_VERSION = 62;
+ DEVELOPMENT_TEAM = "";
+ "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8AKCJ9LW7D;
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.company.myapp2;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "qa-zsaq";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Profile;
+ };
+ 331C8088294A63A400263BE5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = E32A50F59BB884B8EEEA48BB /* Pods-RunnerTests.debug.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ DEVELOPMENT_TEAM = 8AKCJ9LW7D;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.company.myapp2.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Debug;
+ };
+ 331C8089294A63A400263BE5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = EB96BCD274E74DA46B53876B /* Pods-RunnerTests.release.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ DEVELOPMENT_TEAM = 8AKCJ9LW7D;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.company.myapp2.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Release;
+ };
+ 331C808A294A63A400263BE5 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = A56B7CF3BE602CF776E716CF /* Pods-RunnerTests.profile.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ DEVELOPMENT_TEAM = 8AKCJ9LW7D;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.company.myapp2.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Profile;
+ };
+ 97C147031CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
+ 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;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ 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 = 13.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;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
+ 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;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ 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 = 13.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 97C147061CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CODE_SIGN_STYLE = Manual;
+ CURRENT_PROJECT_VERSION = 62;
+ DEVELOPMENT_TEAM = "";
+ "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8AKCJ9LW7D;
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.company.myapp2;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "qa-zsaq";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Debug;
+ };
+ 97C147071CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CODE_SIGN_STYLE = Manual;
+ CURRENT_PROJECT_VERSION = 62;
+ DEVELOPMENT_TEAM = "";
+ "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8AKCJ9LW7D;
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.company.myapp2;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "qa-zsaq";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 331C8088294A63A400263BE5 /* Debug */,
+ 331C8089294A63A400263BE5 /* Release */,
+ 331C808A294A63A400263BE5 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 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/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..919434a
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
new file mode 100644
index 0000000..e3773d4
--- /dev/null
+++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..21a3cc1
--- /dev/null
+++ b/ios/Runner.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift
new file mode 100644
index 0000000..c2476be
--- /dev/null
+++ b/ios/Runner/AppDelegate.swift
@@ -0,0 +1,94 @@
+import UIKit
+import Flutter
+import AVFoundation
+
+@main
+@objc class AppDelegate: FlutterAppDelegate {
+ // 动态方向掩码(默认竖屏)
+ static var orientationMask: UIInterfaceOrientationMask = .portrait
+
+ override func application(
+ _ application: UIApplication,
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+ ) -> Bool {
+
+ let controller = window?.rootViewController as! FlutterViewController
+
+ // 1) orientation channel (你已有)
+ let orientationChannel = FlutterMethodChannel(name: "app.orientation",
+ binaryMessenger: controller.binaryMessenger)
+ orientationChannel.setMethodCallHandler { [weak self] call, result in
+ guard let self = self else { return }
+
+ if call.method == "setOrientation" {
+ guard let arg = call.arguments as? String else {
+ result(FlutterError(code: "BAD_ARGS", message: "need 'landscape' | 'portrait'", details: nil))
+ return
+ }
+
+ // 先更新允许的方向掩码
+ if arg == "landscape" {
+ AppDelegate.orientationMask = .landscape
+ } else if arg == "portrait" {
+ AppDelegate.orientationMask = .portrait
+ } else {
+ result(FlutterError(code: "BAD_ARGS", message: "unknown arg", details: nil))
+ return
+ }
+
+ // 再请求实际旋转
+ if #available(iOS 16.0, *) {
+ // 通知顶层 VC:其 supportedInterfaceOrientations 需要刷新
+ self.window?.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations()
+
+ if let scene = self.window?.windowScene {
+ let orientations: UIInterfaceOrientationMask =
+ (arg == "landscape") ? .landscape : .portrait
+ do {
+ try scene.requestGeometryUpdate(.iOS(interfaceOrientations: orientations))
+ } catch {
+ result(FlutterError(code: "GEOMETRY_UPDATE_FAILED",
+ message: error.localizedDescription, details: nil))
+ return
+ }
+ }
+ } else {
+ let target: UIInterfaceOrientation =
+ (arg == "landscape") ? .landscapeLeft : .portrait
+ UIDevice.current.setValue(target.rawValue, forKey: "orientation")
+ UIViewController.attemptRotationToDeviceOrientation()
+ }
+
+ result(true)
+ } else {
+ result(FlutterMethodNotImplemented)
+ }
+ }
+
+ // 2) permissions channel (新增): 用于 iOS 原生请求相机访问权限
+ let permissionChannel = FlutterMethodChannel(name: "qhd_prevention/permissions",
+ binaryMessenger: controller.binaryMessenger)
+ permissionChannel.setMethodCallHandler { (call: FlutterMethodCall, result: @escaping FlutterResult) in
+ if call.method == "requestCameraAccess" {
+ // AVCaptureDevice.requestAccess 会在首次调用时触发系统权限弹窗
+ AVCaptureDevice.requestAccess(for: .video) { granted in
+ DispatchQueue.main.async {
+ result(granted)
+ }
+ }
+ } else {
+ result(FlutterMethodNotImplemented)
+ }
+ }
+
+ GeneratedPluginRegistrant.register(with: self)
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+ }
+
+ // 关键:把当前的掩码提供给系统
+ override func application(_ application: UIApplication,
+ supportedInterfaceOrientationsFor window: UIWindow?)
+ -> UIInterfaceOrientationMask {
+ return AppDelegate.orientationMask
+ }
+}
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..d0d98aa
--- /dev/null
+++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1 @@
+{"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":"57x57","idiom":"iphone","filename":"Icon-App-57x57@1x.png","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@2x.png","scale":"2x"},{"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":"50x50","idiom":"ipad","filename":"Icon-App-50x50@1x.png","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@2x.png","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@1x.png","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@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"}}
\ No newline at end of file
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
new file mode 100644
index 0000000..5fa3a42
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
new file mode 100644
index 0000000..09a4baa
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
new file mode 100644
index 0000000..13b9886
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
new file mode 100644
index 0000000..f9dacfd
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
new file mode 100644
index 0000000..74c9145
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
new file mode 100644
index 0000000..470a8e1
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
new file mode 100644
index 0000000..772149b
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
new file mode 100644
index 0000000..13b9886
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
new file mode 100644
index 0000000..a30a68d
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
new file mode 100644
index 0000000..27d32eb
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png
new file mode 100644
index 0000000..feece6d
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png
new file mode 100644
index 0000000..4fa3790
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
new file mode 100644
index 0000000..bf80268
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png
new file mode 100644
index 0000000..9e5fc9d
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
new file mode 100644
index 0000000..27d32eb
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
new file mode 100644
index 0000000..fe44b93
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png
new file mode 100644
index 0000000..5337d5a
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png
new file mode 100644
index 0000000..342548c
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
new file mode 100644
index 0000000..a2dd400
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
new file mode 100644
index 0000000..ae77c36
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
new file mode 100644
index 0000000..c429f45
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json
new file mode 100644
index 0000000..9f447e1
--- /dev/null
+++ b/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "background.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png b/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png
new file mode 100644
index 0000000..4ebb677
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
new file mode 100644
index 0000000..00cabce
--- /dev/null
+++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "filename" : "LaunchImage.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "LaunchImage@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "LaunchImage@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
new file mode 100644
index 0000000..e815fd6
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
new file mode 100644
index 0000000..e815fd6
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
new file mode 100644
index 0000000..e815fd6
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
new file mode 100644
index 0000000..89c2725
--- /dev/null
+++ b/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/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 0000000..55c0cae
--- /dev/null
+++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..f3c2851
--- /dev/null
+++ b/ios/Runner/Base.lproj/Main.storyboard
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
new file mode 100644
index 0000000..13a000c
--- /dev/null
+++ b/ios/Runner/Info.plist
@@ -0,0 +1,91 @@
+
+
+
+
+ CADisableMinimumFrameDurationOnPhone
+
+ CFBundleDisplayName
+ ${PRODUCT_NAME}
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ 秦港双控
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ $(FLUTTER_BUILD_NAME)
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ $(FLUTTER_BUILD_NUMBER)
+ LSApplicationQueriesSchemes
+
+ baidumap
+
+ LSRequiresIPhoneOS
+
+ NFCReaderUsageDescription
+ 需要NFC权限来读取和写入标签
+ NSAppTransportSecurity
+
+ NSAllowsArbitraryLoads
+
+
+ NSBluetoothAlwaysUsageDescription
+ app需要蓝牙权限连接设备
+ NSCameraUsageDescription
+ app需要相机权限来扫描二维码
+ NSContactsUsageDescription
+ app需要通讯录权限添加好友
+ NSHealthShareUsageDescription
+ app需要读取健康数据
+ NSHealthUpdateUsageDescription
+ app需要写入健康数据
+ NSLocalNetworkUsageDescription
+ app需要发现本地网络设备
+ NSLocationAlwaysAndWhenInUseUsageDescription
+ 我们需要访问您的位置来提供基于位置的服务,例如获取位置展示地图。您的位置数据不会用于其他目的。
+ NSLocationAlwaysUsageDescription
+ 我们需要访问您的位置来提供基于位置的服务,例如获取位置展示地图。您的位置数据不会用于其他目的。
+ NSLocationWhenInUseUsageDescription
+ 我们需要访问您的位置来提供基于位置的服务,例如获取位置展示地图。您的位置数据不会用于其他目的。
+ NSMicrophoneUsageDescription
+ app需要麦克风权限进行语音通话
+ NSMotionUsageDescription
+ app需要访问运动数据统计步数
+ NSPhotoLibraryAddUsageDescription
+ app需要保存图片到相册
+ NSPhotoLibraryUsageDescription
+ app需要访问相册以上传图片
+ NSUserNotificationsUsageDescription
+ app需要发送通知提醒重要信息
+ UIApplicationSupportsIndirectInputEvents
+
+ UIBackgroundModes
+
+ remote-notification
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UIStatusBarHidden
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+
+ com.apple.developer.nfc.readersession.formats
+
+ TAG
+ NDEF
+
+
+
\ No newline at end of file
diff --git a/ios/Runner/Resources/InfoPlist.strings b/ios/Runner/Resources/InfoPlist.strings
new file mode 100644
index 0000000..497d27e
--- /dev/null
+++ b/ios/Runner/Resources/InfoPlist.strings
@@ -0,0 +1 @@
+"CFBundleDisplayName" = "秦港相关方";
\ No newline at end of file
diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h
new file mode 100644
index 0000000..308a2a5
--- /dev/null
+++ b/ios/Runner/Runner-Bridging-Header.h
@@ -0,0 +1 @@
+#import "GeneratedPluginRegistrant.h"
diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements
new file mode 100644
index 0000000..2bb4dee
--- /dev/null
+++ b/ios/Runner/Runner.entitlements
@@ -0,0 +1,10 @@
+
+
+
+
+ com.apple.developer.nfc.readersession.formats
+
+ TAG
+
+
+
diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift
new file mode 100644
index 0000000..86a7c3b
--- /dev/null
+++ b/ios/RunnerTests/RunnerTests.swift
@@ -0,0 +1,12 @@
+import Flutter
+import UIKit
+import XCTest
+
+class RunnerTests: XCTestCase {
+
+ func testExample() {
+ // If you add code to the Runner application, consider adding tests here.
+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
+ }
+
+}
diff --git a/lib/Model/list_model.dart b/lib/Model/list_model.dart
new file mode 100644
index 0000000..f1abb98
--- /dev/null
+++ b/lib/Model/list_model.dart
@@ -0,0 +1,6 @@
+/// 清单检查记录
+class RecordCheckModel {
+ final String title;
+ final String time;
+ RecordCheckModel(this.title, this.time);
+}
\ No newline at end of file
diff --git a/lib/common/route_aware_state.dart b/lib/common/route_aware_state.dart
new file mode 100644
index 0000000..4bd9bdd
--- /dev/null
+++ b/lib/common/route_aware_state.dart
@@ -0,0 +1,60 @@
+// lib/common/route_aware_state.dart
+import 'dart:async';
+import 'package:flutter/widgets.dart';
+import 'package:qhd_prevention/common/route_observer.dart';
+
+/// 可复用的 RouteAware State 基类
+/// 使用方式:class _MyPageState extends RouteAwareState { ... }
+abstract class RouteAwareState extends State with RouteAware {
+ /// 当页面真正可见(首次 push 或从上层 pop 返回)时会调用
+ @protected
+ FutureOr onVisible();
+
+ @override
+ void didChangeDependencies() {
+ super.didChangeDependencies();
+ final ModalRoute? route = ModalRoute.of(context);
+ if (route is PageRoute) {
+ routeObserver.subscribe(this, route);
+ }
+ }
+
+ @override
+ void dispose() {
+ try {
+ routeObserver.unsubscribe(this);
+ } catch (_) {}
+ super.dispose();
+ }
+
+ @override
+ void didPush() {
+ // 页面被 push 到栈顶(首次展示)
+ _safeCallOnVisible();
+ }
+
+ @override
+ void didPopNext() {
+ // 从上层 pop 回到当前页面(页面再次可见)
+ _safeCallOnVisible();
+ }
+
+ @override
+ void didPushNext() {
+ // 当前页面被新的页面覆盖(不可见)
+ super.didPushNext();
+ }
+
+ void _safeCallOnVisible() {
+ // 延后到当前帧完成后执行,避免在 build 期间触发 setState 导致断言
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (!mounted) return;
+ try {
+ final r = onVisible();
+ if (r is Future) {
+ r.catchError((_) {});
+ }
+ } catch (_) {}
+ });
+ }
+}
diff --git a/lib/common/route_model.dart b/lib/common/route_model.dart
new file mode 100644
index 0000000..c822df8
--- /dev/null
+++ b/lib/common/route_model.dart
@@ -0,0 +1,62 @@
+// models/route_model.dart
+import 'dart:convert';
+
+class RouteModel {
+ final String target;
+ final List children;
+ final bool hasMenu;
+ final String parentId;
+ final String routeId;
+ final String component;
+ final String path;
+ final String title;
+ final String parentIds;
+ final String meta;
+ final String routeOrder;
+
+ RouteModel({
+ required this.target,
+ required this.children,
+ required this.hasMenu,
+ required this.parentId,
+ required this.routeId,
+ required this.component,
+ required this.title,
+ required this.path,
+ required this.parentIds,
+ required this.meta,
+ required this.routeOrder,
+ });
+
+ factory RouteModel.fromJson(Map json) {
+ return RouteModel(
+ target: json['target'] ?? '',
+ children: (json['children'] as List? ?? [])
+ .map((child) => RouteModel.fromJson(child))
+ .toList(),
+ hasMenu: json['hasMenu'] ?? false,
+ parentId: json['parent_ID'] ?? '',
+ routeId: json['route_ID'] ?? '',
+ component: json['component'] ?? '',
+ parentIds: json['parent_IDS'] ?? '',
+ meta: json['meta'] ?? '',
+ path: json['path'] ?? '',
+ title: json['path'] ?? '',
+ routeOrder: json['route_ORDER'] ?? '0',
+ );
+ }
+
+ // // 解析meta字段获取title
+ // String get title {
+ // if (meta.isEmpty) return '';
+ // try {
+ // final metaMap = jsonDecode(meta) as Map;
+ // return metaMap['title'] ?? '';
+ // } catch (e) {
+ // return '';
+ // }
+ // }
+
+ // 判断是否是叶子节点(没有子节点的路由)
+ bool get isLeaf => children.isEmpty;
+}
\ No newline at end of file
diff --git a/lib/common/route_observer.dart b/lib/common/route_observer.dart
new file mode 100644
index 0000000..0756d32
--- /dev/null
+++ b/lib/common/route_observer.dart
@@ -0,0 +1,5 @@
+// lib/common/route_observer.dart
+import 'package:flutter/widgets.dart';
+
+/// 全局 RouteObserver(放在单独文件以避免循环导入)
+final RouteObserver routeObserver = RouteObserver();
diff --git a/lib/common/route_service.dart b/lib/common/route_service.dart
new file mode 100644
index 0000000..15d022d
--- /dev/null
+++ b/lib/common/route_service.dart
@@ -0,0 +1,58 @@
+import 'package:qhd_prevention/common/route_model.dart';
+/// 路由管理
+class RouteService {
+ static final RouteService _instance = RouteService._internal();
+ factory RouteService() => _instance;
+ RouteService._internal();
+
+ // 存储所有路由配置
+ List _allRoutes = [];
+
+ // 获取主Tab路由(第一级children)
+ List get mainTabs => _allRoutes.isNotEmpty
+ ? _allRoutes.first.children
+ : [];
+
+ // 初始化路由配置
+ void initializeRoutes(List routeList) {
+ _allRoutes = routeList.map((route) => RouteModel.fromJson(route)).toList();
+ }
+
+ // 根据路径查找路由
+ RouteModel? findRouteByPath(String path) {
+ for (final route in _allRoutes) {
+ final found = _findRouteRecursive(route, path);
+ if (found != null) return found;
+ }
+ return null;
+ }
+
+ RouteModel? _findRouteRecursive(RouteModel route, String path) {
+ if (route.path == path) return route;
+ for (final child in route.children) {
+ final found = _findRouteRecursive(child, path);
+ if (found != null) return found;
+ }
+ return null;
+ }
+
+ // 获取某个Tab下的所有可显示的路由(hasMenu为true的叶子节点)
+ List getRoutesForTab(RouteModel tab) {
+ final routes = [];
+ _collectLeafRoutes(tab, routes);
+ return routes;
+ }
+
+ void _collectLeafRoutes(RouteModel route, List collector) {
+ if (route.hasMenu) {
+ collector.add(route);
+ if (!route.isLeaf) {
+ for (final child in route.children) {
+ _collectLeafRoutes(child, collector);
+ }
+ }
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/lib/constants/app_enums.dart b/lib/constants/app_enums.dart
new file mode 100644
index 0000000..cc7bf9c
--- /dev/null
+++ b/lib/constants/app_enums.dart
@@ -0,0 +1,322 @@
+/// 文件上传类型枚举
+///
+/// 该枚举定义了系统中所有支持的文件上传类型,包含类型标识符和对应的存储路径
+/// 使用示例:
+/// ```dart
+/// // 通过类型获取枚举
+/// UploadFileType? fileType = UploadFileType.fromType('102');
+///
+/// // 通过路径获取枚举
+/// UploadFileType? fileType = UploadFileType.fromPath('hidden_danger_video');
+///
+/// // 直接使用枚举值
+/// String type = UploadFileType.userAvatar.type; // '13'
+/// String path = UploadFileType.userAvatar.path; // 'user_avatar'
+/// ```
+enum UploadFileType {
+ /// 隐患照片 - 类型: '3', 路径: 'hidden_danger_photo'
+ hiddenDangerPhoto('3', 'hidden_danger_photo'),
+
+ /// 隐患整改照片 - 类型: '4', 路径: 'hidden_danger_rectification_photo'
+ hiddenDangerRectificationPhoto('4', 'hidden_danger_rectification_photo'),
+
+ /// 隐患验证照片 - 类型: '5', 路径: 'hidden_danger_verification_photo'
+ hiddenDangerVerificationPhoto('5', 'hidden_danger_verification_photo'),
+
+ /// 证书照片 - 类型: '6', 路径: 'certificate_photo'
+ certificatePhoto('6', 'certificate_photo'),
+
+ /// 受限空间平面图 - 类型: '7', 路径: 'confined_space_plan'
+ confinedSpacePlan('7', 'confined_space_plan'),
+
+ /// 隐患整改方案图 - 类型: '8', 路径: 'hidden_danger_rectification_plan'
+ hiddenDangerRectificationPlan('8', 'hidden_danger_rectification_plan'),
+
+ /// 有限空间确认人签字 - 类型: '9', 路径: 'confined_space_confirmation_signature'
+ confinedSpaceConfirmationSignature('9', 'confined_space_confirmation_signature'),
+
+ /// 劳动合同图片 - 类型: '10', 路径: 'labor_contract_image'
+ laborContractImage('10', 'labor_contract_image'),
+
+ /// 商业保险图片 - 类型: '11', 路径: 'commercial_insurance_image'
+ commercialInsuranceImage('11', 'commercial_insurance_image'),
+
+ /// 证书信息 - 类型: '12', 路径: 'certificate_information'
+ certificateInformation('12', 'certificate_information'),
+
+ /// 用户头像 - 类型: '13', 路径: 'user_avatar'
+ userAvatar('13', 'user_avatar'),
+
+ /// 身份证照片 - 类型: '14', 路径: 'id_card_photo'
+ idCardPhoto('14', 'id_card_photo'),
+
+ /// 社保卡照片 - 类型: '15', 路径: 'social_security_card_photo'
+ socialSecurityCardPhoto('15', 'social_security_card_photo'),
+
+ /// 工伤保险凭证 - 类型: '16', 路径: 'work_related_injury_insurance_certificate'
+ workRelatedInjuryInsuranceCertificate('16', 'work_related_injury_insurance_certificate'),
+
+ /// 特种设备巡检照片 - 类型: '17', 路径: 'special_equipment_inspection_photo'
+ specialEquipmentInspectionPhoto('17', 'special_equipment_inspection_photo'),
+
+ /// 人员证书 - 类型: '18', 路径: 'personnel_certificate'
+ personnelCertificate('18', 'personnel_certificate'),
+
+ /// 三级教育培训 - 类型: '19', 路径: 'three_level_safety_education_training'
+ threeLevelSafetyEducationTraining('19', 'three_level_safety_education_training'),
+
+ /// 重大危险源报警处置前照片 - 类型: '20', 路径: 'major_hazard_source_alarm_before_handling_photo'
+ majorHazardSourceAlarmBeforeHandlingPhoto('20', 'major_hazard_source_alarm_before_handling_photo'),
+
+ /// 重大危险源报警处置后照片 - 类型: '21', 路径: 'major_hazard_source_alarm_after_handling_photo'
+ majorHazardSourceAlarmAfterHandlingPhoto('21', 'major_hazard_source_alarm_after_handling_photo'),
+
+ /// 智能门禁外来车辆驾驶证照片 - 类型: '22', 路径: 'smart_access_control_external_vehicle_driver_license_photo'
+ smartAccessControlExternalVehicleDriverLicensePhoto('22', 'smart_access_control_external_vehicle_driver_license_photo'),
+
+ /// 智能门禁外来车辆行驶证照片 - 类型: '23', 路径: 'smart_access_control_external_vehicle_registration_photo'
+ smartAccessControlExternalVehicleRegistrationPhoto('23', 'smart_access_control_external_vehicle_registration_photo'),
+
+ /// 安全环保检查终验图片 - 类型: '50', 路径: 'safety_and_environmental_inspection_final_acceptance_image'
+ safetyAndEnvironmentalInspectionFinalAcceptanceImage('50', 'safety_and_environmental_inspection_final_acceptance_image'),
+
+ /// 隐患延期临时措施附件 - 类型: '101', 路径: 'hidden_danger_extension_temporary_measures_attachment'
+ hiddenDangerExtensionTemporaryMeasuresAttachment('101', 'hidden_danger_extension_temporary_measures_attachment'),
+
+ /// 隐患视频 - 类型: '102', 路径: 'hidden_danger_video'
+ hiddenDangerVideo('102', 'hidden_danger_video'),
+
+ /// 盲板位置图 - 类型: '105', 路径: 'blind_plate_position_map'
+ blindPlatePositionMap('105', 'blind_plate_position_map'),
+
+ /// 临时处置信息 - 类型: '106', 路径: 'temporary_disposal_information'
+ temporaryDisposalInformation('106', 'temporary_disposal_information'),
+
+ /// 整改建议及方案 - 类型: '107', 路径: 'rectification_suggestions_and_plan'
+ rectificationSuggestionsAndPlan('107', 'rectification_suggestions_and_plan'),
+
+ /// 重大隐患上传隐患调查报告 - 类型: '108', 路径: 'major_hidden_danger_investigation_report'
+ majorHiddenDangerInvestigationReport('108', 'major_hidden_danger_investigation_report'),
+
+ /// 重大隐患安委会或党委会决议记录 - 类型: '109', 路径: 'major_hidden_danger_safety_committee_or_party_committee_resolution_record'
+ majorHiddenDangerSafetyCommitteeOrPartyCommitteeResolutionRecord('109', 'major_hidden_danger_safety_committee_or_party_committee_resolution_record'),
+
+ /// 较大隐患整改-临时处置措施 - 类型: '110', 路径: 'significant_hidden_danger_rectification_temporary_disposal_measures'
+ significantHiddenDangerRectificationTemporaryDisposalMeasures('110', 'significant_hidden_danger_rectification_temporary_disposal_measures'),
+
+ /// 较大隐患整改-隐患整改过程记录 - 类型: '111', 路径: 'significant_hidden_danger_rectification_hidden_danger_rectification_process_record'
+ significantHiddenDangerRectificationHiddenDangerRectificationProcessRecord('111', 'significant_hidden_danger_rectification_hidden_danger_rectification_process_record'),
+
+ /// 补充重大隐患信息 - 类型: '112', 路径: 'supplement_major_hidden_danger_information'
+ supplementMajorHiddenDangerInformation('112', 'supplement_major_hidden_danger_information'),
+
+ /// 安委会办公室会议记录 - 类型: '113', 路径: 'safety_committee_office_meeting_record'
+ safetyCommitteeOfficeMeetingRecord('113', 'safety_committee_office_meeting_record'),
+
+ /// 报警图片 - 类型: '114', 路径: 'alarm_photo'
+ alarmPhoto('114', 'alarm_photo'),
+
+ /// 消防器材类型合格表中照片 - 类型: '115', 路径: 'fire_equipment_type_qualification_photo'
+ fireEquipmentTypeQualificationPhoto('115', 'fire_equipment_type_qualification_photo'),
+
+ /// 动火人图片 - 类型: '116', 路径: 'hot_work_personnel_photo'
+ hotWorkPersonnelPhoto('116', 'hot_work_personnel_photo'),
+
+ /// 安全承诺书签名 - 类型: '117', 路径: 'safety_pledge_signature'
+ safetyPledgeSignature('117', 'safety_pledge_signature'),
+
+ /// 动火单位负责人确认签字 - 类型: '118', 路径: 'hot_work_unit_responsible_person_confirmation_signature'
+ hotWorkUnitResponsiblePersonConfirmationSignature('118', 'hot_work_unit_responsible_person_confirmation_signature'),
+
+ /// 现场管辖单位负责人签字 - 类型: '119', 路径: 'on_site_jurisdiction_unit_responsible_person_signature'
+ onSiteJurisdictionUnitResponsiblePersonSignature('119', 'on_site_jurisdiction_unit_responsible_person_signature'),
+
+ /// 动火许可证签发单位签字 - 类型: '120', 路径: 'hot_work_permit_issuing_unit_signature'
+ hotWorkPermitIssuingUnitSignature('120', 'hot_work_permit_issuing_unit_signature'),
+
+ /// 动火许可证签字 - 类型: '121', 路径: 'hot_work_permit_signature'
+ hotWorkPermitSignature('121', 'hot_work_permit_signature'),
+
+ /// 动火前管辖单位确认签字 - 类型: '122', 路径: 'pre_hot_work_jurisdiction_unit_confirmation_signature'
+ preHotWorkJurisdictionUnitConfirmationSignature('122', 'pre_hot_work_jurisdiction_unit_confirmation_signature'),
+
+ /// 现场负责人确实签字 - 类型: '123', 路径: 'on_site_responsible_person_confirmation_signature'
+ onSiteResponsiblePersonConfirmationSignature('123', 'on_site_responsible_person_confirmation_signature'),
+
+ /// 动火后现场管辖单位确认 - 类型: '124', 路径: 'post_hot_work_site_jurisdiction_unit_confirmation'
+ postHotWorkSiteJurisdictionUnitConfirmation('124', 'post_hot_work_site_jurisdiction_unit_confirmation'),
+
+ /// 延迟监火图片 - 类型: '125', 路径: 'delayed_fire_monitoring_pictures'
+ delayedFireMonitoringPictures('125', 'delayed_fire_monitoring_pictures'),
+
+ /// 安全环保检查发起签字 - 类型: '126', 路径: 'safety_and_environmental_inspection_initiation_signature'
+ safetyAndEnvironmentalInspectionInitiationSignature('126', 'safety_and_environmental_inspection_initiation_signature'),
+
+ /// 检查人确认签字 - 类型: '127', 路径: 'inspector_confirmation_signature'
+ inspectorConfirmationSignature('127', 'inspector_confirmation_signature'),
+
+ /// 被检查人确认签字 - 类型: '128', 路径: 'inspected_person_confirmation_signature'
+ inspectedPersonConfirmationSignature('128', 'inspected_person_confirmation_signature'),
+
+ /// 安全环保检查申辩签字 - 类型: '129', 路径: 'safety_and_environmental_inspection_appeal_signature'
+ safetyAndEnvironmentalInspectionAppealSignature('129', 'safety_and_environmental_inspection_appeal_signature'),
+
+ /// (港股安委办主任)安全总监签发 - 类型: '130', 路径: 'hk_safety_committee_office_director_safety_director_issuance'
+ hkSafetyCommitteeOfficeDirectorSafetyDirectorIssuance('130', 'hk_safety_committee_office_director_safety_director_issuance'),
+
+ /// 动火发包单位签字 - 类型: '131', 路径: 'hot_work_contracting_unit_signature'
+ hotWorkContractingUnitSignature('131', 'hot_work_contracting_unit_signature'),
+
+ /// 安全总监审批 - 类型: '132', 路径: 'safety_director_approval'
+ safetyDirectorApproval('132', 'safety_director_approval'),
+
+ /// 分公司安全总监审批 - 类型: '133', 路径: 'branch_safety_director_approval'
+ branchSafetyDirectorApproval('133', 'branch_safety_director_approval'),
+
+ /// 项目主管部门负责人审核 - 类型: '134', 路径: 'project_authority_review_signature'
+ projectAuthorityReviewSignature('134', 'project_authority_review_signature'),
+
+ /// 分公司主要负责人签批 - 类型: '135', 路径: 'branch_manager_approval_signature'
+ branchManagerApprovalSignature('135', 'branch_manager_approval_signature'),
+
+ /// 事故/事件 - 类型: '136', 路径: 'accident_incident'
+ accidentIncident1('136', 'accident_incident'),
+
+ /// 事故/事件 - 类型: '137', 路径: 'accident_incident'
+ accidentIncident2('137', 'accident_incident'),
+
+ /// 隐患处置方案 - 类型: '138', 路径: 'hidden_disposal_plan'
+ hiddenDisposalPlan('138', 'hidden_disposal_plan'),
+
+ /// 安全环保检查-检查签字 - 类型: '139', 路径: 'safety_environmental_inspection_inspection_signature'
+ safetyEnvironmentalInspectionInspectionSignature('139', 'safety_environmental_inspection_inspection_signature'),
+
+ /// 安全环保检查-检查情况 - 类型: '140', 路径: 'safety_environmental_inspection_inspection_situation'
+ safetyEnvironmentalInspectionInspectionSituation('140', 'safety_environmental_inspection_inspection_situation'),
+
+ /// 安全环保检查-检查人签字 - 类型: '141', 路径: 'safety_environmental_inspection_inspector_signature'
+ safetyEnvironmentalInspectionInspectorSignature('141', 'safety_environmental_inspection_inspector_signature'),
+
+ /// 安全环保检查-被检查人签字 - 类型: '142', 路径: 'safety_environmental_inspection_inspected_signature'
+ safetyEnvironmentalInspectionInspectedSignature('142', 'safety_environmental_inspection_inspected_signature'),
+
+ /// 安全环保检查-被检查文件 - 类型: '143', 路径: 'safety_environmental_inspection_inspected_file'
+ safetyEnvironmentalInspectionInspectedFile('143', 'safety_environmental_inspection_inspected_file'),
+
+ /// 安全环保检查-申辩签字 - 类型: '144', 路径: 'safety_environmental_inspection_defense_signature'
+ safetyEnvironmentalInspectionDefenseSignature('144', 'safety_environmental_inspection_defense_signature'),
+
+ /// 清单检查合格 - 类型: '145', 路径: 'qualified_list_inspection'
+ qualifiedListInspection('145', 'qualified_list_inspection'),
+
+ /// 安全环保检查-验收 - 类型: '146', 路径: 'safety_environmental_inspection_acceptance'
+ safetyEnvironmentalInspectionAcceptance('146', 'safety_environmental_inspection_acceptance'),
+
+ /// 隐患清单排查查签字 - 类型: '147', 路径: 'hidden_qualified_listInspection_signature'
+ hiddenQualifiedListInspectionSignature('147', 'hidden_qualified_listInspection_signature'),
+
+ /// 安全承诺书签字 - 类型: '150', 路径: 'promise_bookmark_photo'
+ promiseBookmarkPhoto('150', 'promise_bookmark_photo'),
+
+ /// 项目相关资料 - 类型: '151', 路径: 'project_related_materials'
+ projectRelatedMaterials('151', 'project_related_materials'),
+
+ /// 人脸识别图片上传 - 类型: '300', 路径: 'facial_recognition_images'
+ facialRecognitionImages('300', 'facial_recognition_images'),
+ /// ai识别图片 - 类型: '301', 路径: 'ai_recognition_images'
+ aiRecognitionImages('301', 'ai_recognition_images'),
+
+
+ /// 门口门禁车辆行驶证照片 - 类型: '601', 路径: 'gate_access_vehicle_license_photo'
+ gateAccessVehicleLicensePhoto('601', 'gate_access_vehicle_license_photo'),
+
+ /// 门口门禁车辆车辆照片 - 类型: '602', 路径: 'gate_access_vehicle_photo'
+ gateAccessVehiclePhoto('602', 'gate_access_vehicle_photo'),
+
+ /// 门口门禁车辆附件 - 类型: '603', 路径: 'gate_access_vehicle_attachment'
+ gateAccessVehicleAttachment('603', 'gate_access_vehicle_attachment'),
+
+ /// 排放标准证明 - 类型: '604', 路径: 'emission_standard_certificate'
+ emissionStandardCertificate('604', 'emission_standard_certificate'),
+
+ /// 机动车登记证书(绿本) - 类型: '605', 路径: 'motor_vehicle_registration_certificate_green_book'
+ motorVehicleRegistrationCertificateGreenBook('605', 'motor_vehicle_registration_certificate_green_book');
+
+ const UploadFileType(this.type, this.path);
+
+ /// 文件类型标识符(字符串格式)
+ final String type;
+
+ /// 文件存储路径
+ final String path;
+
+ /// 通过类型字符串查找对应的枚举值
+ ///
+ /// 参数:
+ /// - [type]: 文件类型字符串,如 '102'
+ ///
+ /// 返回值:
+ /// - 对应的 UploadFileType 枚举值,如果未找到则返回 null
+ ///
+ /// 示例:
+ /// ```dart
+ /// UploadFileType? fileType = UploadFileType.fromType('102');
+ /// if (fileType != null) {
+ /// print(fileType.path); // 输出: hidden_danger_video
+ /// }
+ /// ```
+ static UploadFileType? fromType(String type) {
+ try {
+ return values.firstWhere((element) => element.type == type);
+ } catch (e) {
+ return null;
+ }
+ }
+
+ /// 通过路径查找对应的枚举值
+ ///
+ /// 参数:
+ /// - [path]: 文件存储路径,如 'hidden_danger_video'
+ ///
+ /// 返回值:
+ /// - 对应的 UploadFileType 枚举值,如果未找到则返回 null
+ ///
+ /// 示例:
+ /// ```dart
+ /// UploadFileType? fileType = UploadFileType.fromPath('hidden_danger_video');
+ /// if (fileType != null) {
+ /// print(fileType.type); // 输出: 102
+ /// }
+ /// ```
+ static UploadFileType? fromPath(String path) {
+ try {
+ return values.firstWhere((element) => element.path == path);
+ } catch (e) {
+ return null;
+ }
+ }
+
+ /// 获取所有文件类型字符串的列表
+ ///
+ /// 返回值:
+ /// - 包含所有文件类型字符串的列表
+ ///
+ /// 示例:
+ /// ```dart
+ /// List allTypes = UploadFileType.allTypes;
+ /// print(allTypes.contains('102')); // 输出: true
+ /// ```
+ static List get allTypes => values.map((e) => e.type).toList();
+
+ /// 获取所有文件存储路径的列表
+ ///
+ /// 返回值:
+ /// - 包含所有文件存储路径的列表
+ ///
+ /// 示例:
+ /// ```dart
+ /// List allPaths = UploadFileType.allPaths;
+ /// print(allPaths.contains('hidden_danger_video')); // 输出: true
+ /// ```
+ static List get allPaths => values.map((e) => e.path).toList();
+}
\ No newline at end of file
diff --git a/lib/customWidget/BaiDuMap/BaiduMapWebView.dart b/lib/customWidget/BaiDuMap/BaiduMapWebView.dart
new file mode 100644
index 0000000..1079e85
--- /dev/null
+++ b/lib/customWidget/BaiDuMap/BaiduMapWebView.dart
@@ -0,0 +1,71 @@
+import 'package:flutter/material.dart';
+import 'package:qhd_prevention/customWidget/custom_button.dart';
+import 'package:webview_flutter/webview_flutter.dart';
+import 'package:qhd_prevention/customWidget/toast_util.dart';
+
+/// 可复用的地图 WebView 组件
+/// BaiduMapWebView(
+/// controller: _controller,
+/// isLoading: _isLoading,
+/// errorMessage: _errorMessage,
+/// onRetry: _initLocation,
+/// )
+/// ```
+class BaiduMapWebView extends StatelessWidget {
+ final WebViewController? controller;
+ final bool isLoading;
+ final String? errorMessage;
+ final VoidCallback onRetry;
+
+ const BaiduMapWebView({
+ super.key,
+ required this.controller,
+ required this.isLoading,
+ required this.errorMessage,
+ required this.onRetry,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ if (errorMessage != null) {
+ return Center(
+ child: Padding(
+ padding: const EdgeInsets.all(20.0),
+ child: Column(mainAxisSize: MainAxisSize.min, children: [
+ const Icon(Icons.error_outline, color: Colors.red, size: 50),
+ const SizedBox(height: 16),
+ Text(
+ errorMessage!,
+ textAlign: TextAlign.center,
+ style: const TextStyle(fontSize: 16),
+ ),
+ const SizedBox(height: 24),
+ CustomButton(text: '重试', backgroundColor: Colors.blue, onPressed: onRetry)
+ ]),
+ ),
+ );
+ }
+
+ if (isLoading) {
+ return const Center(child: CircularProgressIndicator());
+ }
+
+ // 非加载且无错误时,controller 应该存在;若为空则显示提示
+ if (controller == null) {
+ return Center(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const Icon(Icons.map_outlined, size: 48),
+ const SizedBox(height: 8),
+ const Text('地图未初始化'),
+ const SizedBox(height: 12),
+ CustomButton(text: '重试初始化', backgroundColor: Colors.blue, onPressed: onRetry,),
+ ],
+ ),
+ );
+ }
+
+ return WebViewWidget(controller: controller!);
+ }
+}
diff --git a/lib/customWidget/BaiDuMap/Map_page.dart b/lib/customWidget/BaiDuMap/Map_page.dart
new file mode 100644
index 0000000..98f0dd0
--- /dev/null
+++ b/lib/customWidget/BaiDuMap/Map_page.dart
@@ -0,0 +1,197 @@
+import 'dart:convert';
+import 'package:flutter/material.dart';
+import 'package:qhd_prevention/customWidget/BaiDuMap/BaiduMapWebView.dart';
+import 'package:qhd_prevention/customWidget/toast_util.dart';
+import 'package:qhd_prevention/pages/my_appbar.dart';
+import 'package:qhd_prevention/services/location_service.dart';
+import 'package:qhd_prevention/tools/coord_convert.dart';
+import 'package:qhd_prevention/tools/tools.dart';
+import 'package:shared_preferences/shared_preferences.dart';
+import 'package:webview_flutter/webview_flutter.dart';
+import 'package:geolocator/geolocator.dart';
+
+class MapPage extends StatefulWidget {
+ final String gson;
+
+ const MapPage({super.key, required this.gson});
+
+ @override
+ State createState() => _MapPageState();
+}
+
+class _MapPageState extends State {
+ late final WebViewController _controller;
+ bool _isLoading = true;
+ String? _errorMessage;
+ double? _longitude;
+ double? _latitude;
+ List _gsonList = [];
+ late Map mapData = {};
+ @override
+ void initState() {
+ super.initState();
+ _loadWebView();
+ }
+
+ /// 获取定位(并初始化 WebView 控制器)
+ // Future _initLocation() async {
+ // setState(() {
+ // _isLoading = true;
+ // _errorMessage = null;
+ // });
+ // Map prefs = geographicCentroid(_gsonList);
+ // _loadWebView(LocationResult(latitude: prefs['lat'].toString(), longitude: prefs['lon'].toString()));
+ //
+ // }
+ Future _loadWebView() async {
+ // 解析 gson
+ try {
+ final parsed = jsonDecode(widget.gson);
+ if (parsed is List) {
+ _gsonList = parsed;
+ } else {
+ _gsonList = [];
+ }
+ } catch (e) {
+ debugPrint('解析 gson 失败: $e');
+ _gsonList = [];
+ }
+ if (!mounted) return;
+ Map prefs = geographicCentroid(_gsonList);
+ // _loadWebView(LocationResult(latitude: prefs['lat'].toString(), longitude: prefs['lon'].toString()));
+ setState(() {
+ _longitude = prefs['lon'];
+ _latitude = prefs['lat'];
+ });
+
+
+ // 初始化 WebViewController 并加载本地页面
+ _controller = WebViewController()
+ ..setJavaScriptMode(JavaScriptMode.unrestricted)
+ // 注册 JS 通道 'JS' —— 对应 HTML 中的 window.JS.postMessage(...)
+ ..addJavaScriptChannel('JS', onMessageReceived: (dynamic message) {
+ // message 是动态对象,不在签名中引用具体类型以避免 "Undefined class" 问题
+ String payload;
+ try {
+ payload = message.message ?? message.toString();
+ } catch (e) {
+ payload = message.toString();
+ }
+ _onJsMessage(payload);
+ })
+ // 也保留一个备用通道 'Flutter'
+ ..addJavaScriptChannel('Flutter', onMessageReceived: (dynamic message) {
+ String payload;
+ try {
+ payload = message.message ?? message.toString();
+ } catch (e) {
+ payload = message.toString();
+ }
+ _onJsMessage(payload);
+ })
+ ..setNavigationDelegate(
+ NavigationDelegate(
+ onPageFinished: (String url) async {
+ debugPrint('网页加载完成: $url');
+ await _injectLocationParams();
+ },
+ onWebResourceError: (err) {
+ debugPrint('Web resource error: ${err.description}');
+ },
+ ),
+ );
+
+ // 加载本地 assets 中的 HTML
+ // await _controller.loadFlutterAsset('assets/map/index.html');
+ await _controller.loadRequest(Uri.parse('http://47.92.102.56:7811/file/fluteightmap/index.html'));
+
+ setState(() {
+ _isLoading = false;
+ });
+ }
+
+ /// 注入参数并调用页面初始化函数 window.initWithData(...)
+ Future _injectLocationParams() async {
+ if (_longitude == null || _latitude == null) {
+ debugPrint('位置尚未准备好,跳过注入');
+ return;
+ }
+
+ final params = {
+ 'longitude': _longitude,
+ 'latitude': _latitude,
+ 'GSON': _gsonList,
+ 't': DateTime.now().millisecondsSinceEpoch,
+ };
+ debugPrint('网页初始化参数: ${jsonEncode(params)}');
+
+ final jsonParams = jsonEncode(params);
+
+ try {
+ await _controller.runJavaScript('''
+ (function(){
+ try {
+ if (typeof window.initWithData === 'function') {
+ window.initWithData($jsonParams);
+ } else if (typeof window.initMap === 'function') {
+ window.initMap($jsonParams);
+ } else {
+ console.error('initWithData / initMap function not found');
+ }
+ } catch(e) {
+ console.error('call initWithData error', e);
+ }
+ })();
+ ''');
+ debugPrint('已注入地图初始化参数');
+ } catch (e) {
+ debugPrint('注入位置参数失败: $e');
+ }
+ }
+
+ /// 处理来自 Web 的消息(字符串或 JSON)
+ void _onJsMessage(String message) {
+ debugPrint('收到来自 Web 的消息: $message');
+ if (message.isEmpty) return;
+ try {
+ Map data = jsonDecode(message);
+ if (FormUtils.hasValue(data, 'ok') && data['ok'] == true) {
+ }else{
+ if (FormUtils.hasValue(data, 'type') && data['type'] == 'converted') {
+ setState(() {
+ mapData = data;
+ });
+ }else{
+ ToastUtil.showNormal(context, '当前选择点位不在区域中');
+ setState(() {
+ mapData = {};
+ });
+ }
+ }
+ } catch (_) {
+ setState(() {
+ mapData = {};
+ });
+ ToastUtil.showNormal(context, '当前选择点位不在区域中');
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: MyAppbar(title: '地图选择', actions: [
+ if (mapData.isNotEmpty)
+ TextButton(onPressed: (){
+ Navigator.of(context).pop((mapData));
+ }, child: Text('确定', style: TextStyle(color: Colors.white, fontSize: 17),))
+ ],),
+ body: SafeArea(
+ child: BaiduMapWebView(
+ controller: _isLoading || _errorMessage != null ? null : _controller,
+ isLoading: _isLoading,
+ errorMessage: _errorMessage,
+ onRetry: _loadWebView,
+ ),),
+ );
+ }
+}
diff --git a/lib/customWidget/BaiDuMap/map_webview_page.dart b/lib/customWidget/BaiDuMap/map_webview_page.dart
new file mode 100644
index 0000000..316bc67
--- /dev/null
+++ b/lib/customWidget/BaiDuMap/map_webview_page.dart
@@ -0,0 +1,488 @@
+// lib/pages/map_webview_page.dart
+import 'dart:async';
+import 'dart:convert';
+import 'dart:math' as math;
+
+import 'package:flutter/material.dart';
+import 'package:geolocator/geolocator.dart';
+import 'package:qhd_prevention/customWidget/toast_util.dart';
+import 'package:qhd_prevention/pages/my_appbar.dart';
+import 'package:webview_flutter/webview_flutter.dart';
+
+class MapWebViewPage extends StatefulWidget {
+ const MapWebViewPage({this.canEdit = true,this.oldLongitude = '',this.oldLatitude = '', Key? key}) : super(key: key);
+
+ final bool canEdit;
+ final String oldLongitude;
+ final String oldLatitude;
+
+ @override
+ State createState() => _MapWebViewPageState();
+}
+
+class _MapWebViewPageState extends State {
+ late final WebViewController _controller;
+ bool _loading = true;
+ String _mapUrl = '';
+ double? _selectedLongitude;
+ double? _selectedLatitude;
+ bool _locationError = false;
+
+ // 默认坐标(北京)
+ static const double defaultLongitude = 116.397428;
+ static const double defaultLatitude = 39.90923;
+
+ @override
+ void initState() {
+ super.initState();
+ _initializeWebView();
+ _initializeMap();
+ }
+
+ void _initializeWebView() {
+ _controller = WebViewController()
+ ..setJavaScriptMode(JavaScriptMode.unrestricted)
+ ..addJavaScriptChannel('FlutterChannel', onMessageReceived: _onMessageReceived)
+ ..setNavigationDelegate(NavigationDelegate(
+ onPageStarted: (url) {
+ debugPrint('页面开始加载: $url');
+ },
+ onPageFinished: (url) {
+ debugPrint('页面加载完成: $url');
+ setState(() {
+ _loading = false;
+ });
+ _injectFlutterBridge();
+ },
+ onWebResourceError: (error) {
+ debugPrint('Web资源错误: ${error.errorCode} - ${error.description}');
+ setState(() {
+ _loading = false;
+ });
+ },
+ onNavigationRequest: (request) {
+ debugPrint('导航请求: ${request.url}');
+ return NavigationDecision.navigate;
+ },
+ ));
+ }
+
+ Future _initializeMap() async {
+ try {
+ debugPrint('开始获取位置信息...');
+
+ // 先设置默认URL,避免长时间等待
+ final defaultCoord = _gcj02ToBd09(defaultLongitude, defaultLatitude);
+ _setMapUrl(defaultCoord[0], defaultCoord[1]);
+
+ var position ;
+ if(widget.canEdit){
+ // 异步获取当前位置
+ position = await _getCurrentLocationWithTimeout();
+ }else{
+ try{
+ double oldLongitude = double.parse(widget.oldLongitude);
+ double oldLatitude = double.parse(widget.oldLatitude);
+ position = Position(longitude: oldLongitude, latitude:oldLatitude ,
+ timestamp: DateTime.now(), accuracy: 0.0, altitude: 0.0, altitudeAccuracy: 0.0, heading: 0.0,
+ headingAccuracy: 0.0, speed: 0.0, speedAccuracy: 0.0);
+ }catch (e) {
+ // 异步获取当前位置
+ position = await _getCurrentLocationWithTimeout();
+ }
+ }
+
+ if (position != null) {
+ debugPrint('成功获取位置: ${position.longitude}, ${position.latitude}');
+ // GCJ02 -> BD09 坐标转换
+ final bd09Coord = _gcj02ToBd09(position.longitude, position.latitude);
+ _setMapUrl(bd09Coord[0], bd09Coord[1]);
+ } else {
+ debugPrint('使用默认位置');
+ _showToast('使用默认位置,您可以手动选择位置');
+ }
+
+ // 加载地图
+ await _controller.loadRequest(Uri.parse(_mapUrl));
+
+ } catch (e) {
+ debugPrint('地图初始化失败: $e');
+ // 即使出错也继续加载地图,使用默认位置
+ _showToast('位置获取失败,使用默认位置');
+ await _controller.loadRequest(Uri.parse(_mapUrl));
+ }
+ }
+
+ Future _getCurrentLocationWithTimeout() async {
+ try {
+ // 首先检查定位服务是否开启
+ bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
+ if (!serviceEnabled) {
+ debugPrint('定位服务未开启');
+ _showToast('定位服务未开启,使用默认位置');
+ return null;
+ }
+
+ // 检查权限
+ LocationPermission permission = await Geolocator.checkPermission();
+ debugPrint('当前定位权限: $permission');
+
+ if (permission == LocationPermission.denied) {
+ permission = await Geolocator.requestPermission();
+ debugPrint('请求后定位权限: $permission');
+ }
+
+ if (permission == LocationPermission.denied ||
+ permission == LocationPermission.deniedForever) {
+ debugPrint('定位权限被拒绝');
+ _showToast('定位权限被拒绝,使用默认位置');
+ return null;
+ }
+
+ // 设置超时
+ final position = await Geolocator.getCurrentPosition(
+ desiredAccuracy: LocationAccuracy.best,
+ ).timeout(const Duration(seconds: 10));
+
+ return position;
+ } catch (e) {
+ debugPrint('获取位置异常: $e');
+ // 尝试获取最后已知位置
+ try {
+ final lastPosition = await Geolocator.getLastKnownPosition();
+ if (lastPosition != null) {
+ debugPrint('使用最后已知位置: ${lastPosition.longitude}, ${lastPosition.latitude}');
+ return lastPosition;
+ }
+ } catch (e) {
+ debugPrint('获取最后已知位置失败: $e');
+ }
+ return null;
+ }
+ }
+
+ void _setMapUrl(double longitude, double latitude) {
+ final timestamp = DateTime.now().millisecondsSinceEpoch;
+ setState(() {
+ _mapUrl = 'https://skqhdg.porthebei.com:9004/map/map.html?'
+ 'longitude=$longitude&'
+ 'latitude=$latitude&'
+ 't=$timestamp';
+ });
+ debugPrint('地图URL: $_mapUrl');
+ }
+
+ void _injectFlutterBridge() {
+ const bridgeScript = '''
+ // 重写uni.postMessage以发送到Flutter
+ if (typeof uni !== 'undefined') {
+ const originalPostMessage = uni.postMessage;
+ uni.postMessage = function(data) {
+ console.log('uni.postMessage被调用:', data);
+ // 发送到Flutter
+ if (window.FlutterChannel) {
+ try {
+ window.FlutterChannel.postMessage(JSON.stringify(data));
+ } catch(e) {
+ console.log('发送到Flutter失败:', e);
+ }
+ }
+ // 保持原有逻辑
+ if (typeof originalPostMessage === 'function') {
+ originalPostMessage(data);
+ }
+ };
+
+ // 确保plus环境检测返回true
+ uni.getEnv = function(callback) {
+ if (typeof callback === 'function') {
+ callback({ plus: true });
+ }
+ };
+ }
+
+ // 添加Flutter专用的消息发送方法
+ window.sendToFlutter = function(data) {
+ console.log('sendToFlutter被调用:', data);
+ if (window.FlutterChannel) {
+ try {
+ window.FlutterChannel.postMessage(JSON.stringify(data));
+ } catch(e) {
+ console.log('发送到Flutter失败:', e);
+ }
+ }
+ };
+
+ console.log('Flutter bridge注入完成');
+ ''';
+
+ _controller.runJavaScript(bridgeScript).catchError((error) {
+ debugPrint('注入Flutter bridge失败: $error');
+ });
+ }
+
+ void _onMessageReceived(JavaScriptMessage message) {
+ try {
+ debugPrint('收到原始消息: ${message.message}');
+ final data = jsonDecode(message.message);
+ debugPrint('解析后的消息: $data');
+
+ // 解析坐标数据
+ if (data != null) {
+ final coords = data['data'];
+ setState(() {
+ _selectedLongitude = coords['longitue'];
+ _selectedLatitude = coords['latitude'];
+ });
+
+ debugPrint('选中坐标: $_selectedLongitude, $_selectedLatitude');
+ } else {
+ debugPrint('无法从消息中提取坐标');
+ }
+ } catch (e) {
+ debugPrint('解析地图消息失败: $e');
+ debugPrint('原始消息内容: ${message.message}');
+ }
+ }
+
+ Map? _extractCoordinates(dynamic data) {
+ try {
+ debugPrint('开始提取坐标,数据类型: ${data.runtimeType}');
+
+ if (data is Map) {
+ // 处理不同的数据结构
+ dynamic coordsData = data;
+
+ // 处理嵌套结构
+ if (data.containsKey('data') && data['data'] is List && data['data'].isNotEmpty) {
+ coordsData = data['data'][0];
+ debugPrint('从data数组中提取坐标数据');
+ }
+
+ if (coordsData is Map) {
+ debugPrint('坐标数据键: ${coordsData.keys}');
+
+ // 处理拼写错误 (longitue -> longitude)
+ final longitude = _toDouble(coordsData['longitude']) ??
+ _toDouble(coordsData['longitue']);
+ final latitude = _toDouble(coordsData['latitude']);
+
+ debugPrint('解析结果 - 经度: $longitude, 纬度: $latitude');
+
+ if (longitude != null && latitude != null) {
+ return {
+ 'longitude': longitude,
+ 'latitude': latitude,
+ };
+ }
+ }
+ } else if (data is String) {
+ // 尝试从字符串中提取坐标
+ debugPrint('尝试从字符串中提取坐标');
+ final coordPattern = RegExp(r'[-+]?\d+\.\d+');
+ final matches = coordPattern.allMatches(data).toList();
+ if (matches.length >= 2) {
+ final longitude = double.tryParse(matches[0].group(0)!);
+ final latitude = double.tryParse(matches[1].group(0)!);
+ if (longitude != null && latitude != null) {
+ return {
+ 'longitude': longitude,
+ 'latitude': latitude,
+ };
+ }
+ }
+ }
+ } catch (e) {
+ debugPrint('提取坐标失败: $e');
+ }
+ return null;
+ }
+
+ double? _toDouble(dynamic value) {
+ if (value == null) return null;
+ if (value is double) return value;
+ if (value is int) return value.toDouble();
+ if (value is String) {
+ // 处理可能的字符串格式
+ final cleaned = value.replaceAll(RegExp(r'[^\d.-]'), '');
+ return double.tryParse(cleaned);
+ }
+ return null;
+ }
+
+ void _showToast(String message) {
+ if (!mounted) return;
+ ToastUtil.showNormal(context, message);
+ }
+
+ Future _confirmSelection() async {
+ if (_selectedLongitude == null || _selectedLatitude == null) {
+ // 如果没有选中位置,尝试从页面获取当前位置
+ await _getCurrentLocationFromPage();
+ }
+
+ if (_selectedLongitude != null && _selectedLatitude != null) {
+ final result = {
+ 'longitude': _selectedLongitude!,
+ 'latitude': _selectedLatitude!,
+ };
+
+ debugPrint('返回坐标结果: $result');
+ Navigator.of(context).pop(result);
+ } else {
+ _showToast('请先在地图上选择位置');
+ }
+ }
+
+ Future _getCurrentLocationFromPage() async {
+ try {
+ debugPrint('尝试从页面获取选中位置');
+ const getterScript = '''
+ (function(){
+ try {
+ // 尝试多种方式获取选中位置
+ if (typeof getSelectedLocation === 'function') {
+ var result = getSelectedLocation();
+ if (result) return JSON.stringify(result);
+ }
+
+ if (window.selectedLocation) {
+ return JSON.stringify(window.selectedLocation);
+ }
+
+ // 如果没有选中位置,返回地图中心
+ if (map && typeof map.getCenter === 'function') {
+ var center = map.getCenter();
+ return JSON.stringify({
+ longitude: center.getLng(),
+ latitude: center.getLat()
+ });
+ }
+
+ return null;
+ } catch(e) {
+ console.log('获取位置错误:', e);
+ return null;
+ }
+ })();
+ ''';
+
+ final result = await _controller.runJavaScriptReturningResult(getterScript);
+ debugPrint('页面返回的位置结果: $result');
+
+ if (result != null) {
+ String resultString = result.toString();
+ // 处理可能的双重编码
+ if (resultString.startsWith('"') && resultString.endsWith('"')) {
+ resultString = resultString.substring(1, resultString.length - 1);
+ }
+
+ final coords = _extractCoordinates(jsonDecode(resultString));
+ if (coords != null) {
+ setState(() {
+ _selectedLongitude = coords['longitude'];
+ _selectedLatitude = coords['latitude'];
+ });
+ debugPrint('从页面获取到坐标: $_selectedLongitude, $_selectedLatitude');
+ }
+ }
+ } catch (e) {
+ debugPrint('从页面获取位置失败: $e');
+ }
+ }
+
+ void _retryLocation() async {
+ setState(() {
+ _loading = true;
+ _locationError = false;
+ });
+
+ await _initializeMap();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: MyAppbar(
+ title: '地图选点',
+ actions: [
+ if (_selectedLongitude != null&&widget.canEdit)
+ TextButton(
+ onPressed: _confirmSelection,
+ child: const Text(
+ '确定',
+ style: TextStyle(color: Colors.white, fontSize: 17),
+ ),
+ ),
+ ],
+ ),
+ body: Column(
+ children: [
+ // 状态提示栏
+ if (_locationError)
+ Container(
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+ color: Colors.orange[100],
+ child: Row(
+ children: [
+ Icon(Icons.warning_amber, color: Colors.orange[800], size: 16),
+ const SizedBox(width: 8),
+ Expanded(
+ child: Text(
+ '定位失败,使用默认位置',
+ style: TextStyle(color: Colors.orange[800], fontSize: 12),
+ ),
+ ),
+ TextButton(
+ onPressed: _retryLocation,
+ child: Text(
+ '重试',
+ style: TextStyle(color: Colors.orange[800], fontSize: 12),
+ ),
+ ),
+ ],
+ ),
+ ),
+
+ // 地图区域
+ Expanded(
+ child: Stack(
+ children: [
+ if (_mapUrl.isNotEmpty)
+ WebViewWidget(controller: _controller),
+
+ if (_loading)
+ const Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ CircularProgressIndicator(),
+ SizedBox(height: 16),
+ Text('地图加载中...'),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ // GCJ02 -> BD09 坐标转换
+ List _gcj02ToBd09(double lng, double lat) {
+ const double xPi = math.pi * 3000.0 / 180.0;
+ final double z = math.sqrt(lng * lng + lat * lat) + 0.00002 * math.sin(lat * xPi);
+ final double theta = math.atan2(lat, lng) + 0.000003 * math.cos(lng * xPi);
+ final double bdLng = z * math.cos(theta) + 0.0065;
+ final double bdLat = z * math.sin(theta) + 0.006;
+ return [bdLng, bdLat];
+ }
+
+ @override
+ void dispose() {
+ super.dispose();
+ debugPrint('地图页面销毁');
+ }
+}
\ No newline at end of file
diff --git a/lib/customWidget/DangerPartsPicker.dart b/lib/customWidget/DangerPartsPicker.dart
new file mode 100644
index 0000000..59279ce
--- /dev/null
+++ b/lib/customWidget/DangerPartsPicker.dart
@@ -0,0 +1,510 @@
+import 'dart:convert';
+import 'package:flutter/material.dart';
+import 'package:qhd_prevention/customWidget/search_bar_widget.dart';
+import 'package:qhd_prevention/http/ApiService.dart';
+
+// 数据字典模型
+class DictCategory {
+ final String id;
+ final String name;
+ final Map extValues;
+ final String parentId;
+ final String hiddenregionId;
+ final String hiddenregion;
+ final String? responsibleDeptName;
+ final String? responsibleDeptId;
+ final String? responsibleUserName;
+ final String? responsibleUserId;
+ final int sortindex;
+ final String? comments;
+ final String? corpinfoId;
+ final String? sbdl;
+ final String? sbmc;
+ final List? children;
+
+ DictCategory({
+ required this.id,
+ required this.name,
+ required this.extValues,
+ required this.parentId,
+ required this.hiddenregionId,
+ required this.hiddenregion,
+ this.responsibleDeptName,
+ this.responsibleDeptId,
+ this.responsibleUserName,
+ this.responsibleUserId,
+ required this.sortindex,
+ this.comments,
+ this.corpinfoId,
+ this.sbdl,
+ this.sbmc,
+ this.children,
+ });
+
+ factory DictCategory.fromJson(Map json) {
+ // 安全读取并兼容字符串或数字类型的 id
+ String parseString(dynamic v) {
+ if (v == null) return '';
+ if (v is String) return v;
+ return v.toString();
+ }
+
+ int parseInt(dynamic v) {
+ if (v == null) return 0;
+ if (v is int) return v;
+ if (v is String) return int.tryParse(v) ?? 0;
+ return 0;
+ }
+
+ // 处理子节点
+ final rawChildren = json['children'];
+ List? childrenList;
+ if (rawChildren is List && rawChildren.isNotEmpty) {
+ try {
+ childrenList = rawChildren
+ .where((e) => e != null)
+ .map((e) => DictCategory.fromJson(Map.from(e as Map)))
+ .toList();
+ } catch (e) {
+ childrenList = null;
+ }
+ }
+
+ // 处理扩展值
+ final extRaw = json['extValues'];
+ Map extMap = {};
+ if (extRaw is Map) {
+ extMap = Map.from(extRaw);
+ }
+
+ return DictCategory(
+ id: parseString(json['id']),
+ name: parseString(json['hiddenregion']), // 使用 hiddenregion 作为显示名称
+ extValues: extMap,
+ parentId: parseString(json['parentId']),
+ hiddenregionId: parseString(json['hiddenregionId']),
+ hiddenregion: parseString(json['hiddenregion']),
+ responsibleDeptName: parseString(json['responsibleDeptName']),
+ responsibleDeptId: parseString(json['responsibleDeptId']),
+ responsibleUserName: parseString(json['responsibleUserName']),
+ responsibleUserId: parseString(json['responsibleUserId']),
+ sortindex: parseInt(json['sortindex']),
+ comments: parseString(json['comments']),
+ corpinfoId: parseString(json['corpinfoId']),
+ sbdl: parseString(json['sbdl']),
+ sbmc: parseString(json['sbmc']),
+ children: childrenList,
+ );
+ }
+
+ // 转换为Map,便于使用
+ Map toMap() {
+ return {
+ 'id': id,
+ 'name': name,
+ 'hiddenregionId': hiddenregionId,
+ 'hiddenregion': hiddenregion,
+ 'parentId': parentId,
+ 'responsibleDeptName': responsibleDeptName,
+ 'responsibleDeptId': responsibleDeptId,
+ 'responsibleUserName': responsibleUserName,
+ 'responsibleUserId': responsibleUserId,
+ 'sortindex': sortindex,
+ 'comments': comments,
+ 'corpinfoId': corpinfoId,
+ 'sbdl': sbdl,
+ 'sbmc': sbmc,
+ 'extValues': extValues,
+ };
+ }
+}
+
+/// 数据字典选择器回调签名
+typedef DictSelectCallback = void Function(String id, String name, Map? extraData);
+
+class DangerPartsPicker extends StatefulWidget {
+
+ /// 回调,返回选中项的 id, name 和额外数据
+ final DictSelectCallback onSelected;
+
+ /// 是否显示搜索框
+ final bool showSearch;
+
+ /// 标题
+ final String title;
+
+ /// 确认按钮文本
+ final String confirmText;
+
+ /// 取消按钮文本
+ final String cancelText;
+
+ const DangerPartsPicker({
+ Key? key,
+ required this.onSelected,
+ this.showSearch = true,
+ this.title = '请选择',
+ this.confirmText = '确定',
+ this.cancelText = '取消',
+ }) : super(key: key);
+
+ @override
+ _DangerPartsPickerState createState() => _DangerPartsPickerState();
+}
+
+class _DangerPartsPickerState extends State {
+ String selectedId = '';
+ String selectedName = '';
+ Map? selectedExtraData;
+ Set expandedSet = {};
+
+ List original = [];
+ List filtered = [];
+ bool loading = true;
+ bool error = false;
+ String errorMessage = '';
+
+ final TextEditingController _searchController = TextEditingController();
+
+ @override
+ void initState() {
+ super.initState();
+ selectedId = '';
+ selectedName = '';
+ expandedSet = {};
+ _searchController.addListener(_onSearchChanged);
+ _loadDictData();
+ }
+
+ @override
+ void dispose() {
+ _searchController.removeListener(_onSearchChanged);
+ _searchController.dispose();
+ super.dispose();
+ }
+
+ Future _loadDictData() async {
+ try {
+ setState(() {
+ loading = true;
+ error = false;
+ });
+
+ final result = await HiddenDangerApi.getHiddenDangerAreas();
+ final raw = result['data'] as List;
+ setState(() {
+ original = raw.map((e) => DictCategory.fromJson(e as Map)).toList();
+ filtered = original;
+ loading = false;
+ });
+ } catch (e) {
+ setState(() {
+ loading = false;
+ error = true;
+ errorMessage = e.toString();
+ });
+ }
+ }
+
+ void _onSearchChanged() {
+ final query = _searchController.text.toLowerCase().trim();
+ setState(() {
+ filtered = query.isEmpty ? original : _filterCategories(original, query);
+ // 搜索时展开所有节点以便查看结果
+ if (query.isNotEmpty) {
+ expandedSet.addAll(_getAllExpandableIds(filtered));
+ }
+ });
+ }
+
+ Set _getAllExpandableIds(List categories) {
+ Set ids = {};
+ for (var category in categories) {
+ if (category.children != null && category.children!.isNotEmpty) {
+ ids.add(category.id);
+ ids.addAll(_getAllExpandableIds(category.children!));
+ }
+ }
+ return ids;
+ }
+
+ List _filterCategories(List list, String query) {
+ List result = [];
+ for (var cat in list) {
+ List? children;
+ if (cat.children != null) {
+ children = _filterCategories(cat.children!, query);
+ }
+
+ if (cat.name.toLowerCase().contains(query) ||
+ (children != null && children.isNotEmpty)) {
+ result.add(
+ DictCategory(
+ id: cat.id,
+ name: cat.name,
+ children: children,
+ extValues: cat.extValues,
+ parentId: cat.parentId,
+ hiddenregionId: cat.hiddenregionId,
+ hiddenregion: cat.hiddenregion,
+ responsibleDeptName: cat.responsibleDeptName,
+ responsibleDeptId: cat.responsibleDeptId,
+ responsibleUserName: cat.responsibleUserName,
+ responsibleUserId: cat.responsibleUserId,
+ sortindex: cat.sortindex,
+ comments: cat.comments,
+ corpinfoId: cat.corpinfoId,
+ sbdl: cat.sbdl,
+ sbmc: cat.sbmc,
+ ),
+ );
+ }
+ }
+ return result;
+ }
+
+ Widget _buildRow(DictCategory category, int indent) {
+ final hasChildren = category.children != null && category.children!.isNotEmpty;
+ final isExpanded = expandedSet.contains(category.id);
+ final isSelected = category.id == selectedId;
+
+ return Column(
+ children: [
+ InkWell(
+ onTap: () {
+ setState(() {
+ if (hasChildren) {
+ isExpanded
+ ? expandedSet.remove(category.id)
+ : expandedSet.add(category.id);
+ }
+ selectedId = category.id;
+ selectedName = category.name;
+ selectedExtraData = category.toMap();
+ });
+ },
+ child: Container(
+ color: Colors.white,
+ child: Row(
+ children: [
+ SizedBox(width: 16.0 * indent),
+ SizedBox(
+ width: 24,
+ child: hasChildren
+ ? Icon(
+ isExpanded
+ ? Icons.arrow_drop_down_rounded
+ : Icons.arrow_right_rounded,
+ size: 35,
+ color: Colors.grey[600],
+ )
+ : const SizedBox.shrink(),
+ ),
+ const SizedBox(width: 5),
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 12),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ category.name,
+ style: TextStyle(
+ fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
+ color: Colors.black,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Icon(
+ isSelected
+ ? Icons.radio_button_checked
+ : Icons.radio_button_unchecked,
+ color: Colors.blue,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ if (hasChildren && isExpanded)
+ ...category.children!.map((child) => _buildRow(child, indent + 1)),
+ ],
+ );
+ }
+
+ Widget _buildTitleBar() {
+ return Container(
+ color: Colors.white,
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
+ child: Center(
+ child: Text(
+ widget.title,
+ style: const TextStyle(
+ fontSize: 16,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ );
+ }
+
+ Widget _buildActionBar() {
+ return Container(
+ color: Colors.white,
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ child: Row(
+ children: [
+ // 取消按钮
+ GestureDetector(
+ onTap: () => Navigator.of(context).pop(),
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ child: Text(
+ widget.cancelText,
+ style: const TextStyle(fontSize: 16, color: Colors.grey),
+ ),
+ ),
+ ),
+
+ // 搜索框(如果有搜索功能)
+ if (widget.showSearch) ...[
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 12),
+ child: SearchBarWidget(
+ controller: _searchController,
+ isShowSearchButton: false,
+ onSearch: (keyboard) {},
+ ),
+ ),
+ ),
+ ] else ...[
+ const Expanded(child: SizedBox()),
+ ],
+
+ // 确定按钮
+ GestureDetector(
+ onTap: selectedId.isEmpty
+ ? null
+ : () {
+ Navigator.of(context).pop();
+ widget.onSelected(selectedId, selectedName, selectedExtraData);
+ },
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ child: Text(
+ widget.confirmText,
+ style: TextStyle(
+ fontSize: 16,
+ color: selectedId.isEmpty ? Colors.grey : Colors.blue,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ Widget _buildContent() {
+ if (loading) {
+ return const Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ CircularProgressIndicator(),
+ SizedBox(height: 16),
+ Text('加载中...'),
+ ],
+ ),
+ );
+ }
+
+ if (error) {
+ return Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ const Icon(Icons.error_outline, size: 48, color: Colors.red),
+ const SizedBox(height: 16),
+ const Text('加载失败', style: TextStyle(fontSize: 16)),
+ const SizedBox(height: 8),
+ Text(
+ errorMessage,
+ style: const TextStyle(fontSize: 12, color: Colors.grey),
+ textAlign: TextAlign.center,
+ ),
+ const SizedBox(height: 16),
+ ElevatedButton(
+ onPressed: _loadDictData,
+ child: const Text('重试'),
+ ),
+ ],
+ ),
+ );
+ }
+
+ if (filtered.isEmpty) {
+ return const Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Icon(Icons.search_off, size: 48, color: Colors.grey),
+ SizedBox(height: 16),
+ Text('暂无数据', style: TextStyle(fontSize: 16, color: Colors.grey)),
+ ],
+ ),
+ );
+ }
+
+ return Container(
+ color: Colors.white,
+ child: ListView.builder(
+ itemCount: filtered.length,
+ itemBuilder: (ctx, idx) => _buildRow(filtered[idx], 0),
+ ),
+ );
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ width: MediaQuery.of(context).size.width,
+ height: MediaQuery.of(context).size.height * 0.7,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: const BorderRadius.only(
+ topLeft: Radius.circular(12),
+ topRight: Radius.circular(12),
+ ),
+ boxShadow: [
+ BoxShadow(
+ color: Colors.black.withOpacity(0.1),
+ blurRadius: 10,
+ offset: const Offset(0, -2),
+ ),
+ ],
+ ),
+ child: Column(
+ children: [
+ // 标题行
+ // _buildTitleBar(),
+ // 操作行(取消、搜索、确定)
+ _buildActionBar(),
+ const Divider(height: 1),
+
+ // 内容区域
+ Expanded(
+ child: _buildContent(),
+ ),
+ ],
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/customWidget/DocumentPicker.dart b/lib/customWidget/DocumentPicker.dart
new file mode 100644
index 0000000..532d10c
--- /dev/null
+++ b/lib/customWidget/DocumentPicker.dart
@@ -0,0 +1,270 @@
+// 封装文件:document_picker.dart
+// 说明:只支持从相册选图片(单张或多张)和选择文件(pdf/任意文件),不支持拍照。
+// 同时在内部封装了一个从底部弹出的选择框(“从相册获取”、“选择文件”、“取消”),
+// 并在调用相册选择前检查权限(若未授权会引导用户去设置)。
+
+import 'dart:io';
+import 'dart:typed_data';
+
+import 'package:flutter/foundation.dart';
+import 'package:flutter/material.dart';
+import 'package:image_picker/image_picker.dart';
+import 'package:wechat_assets_picker/wechat_assets_picker.dart';
+import 'package:photo_manager/photo_manager.dart';
+import 'package:file_picker/file_picker.dart';
+
+/// 选中的文件统一结构
+class SelectedFile {
+ final String name;
+ final String? path; // 若无法直接拿到物理文件,则为 null
+ final Uint8List? bytes; // 当 path 不可用时,可能通过 bytes 提供内容
+ final int? size; // 字节数
+ final String? mimeType; // 可选 mime
+ final SourceType source;
+
+ SelectedFile({
+ required this.name,
+ this.path,
+ this.bytes,
+ this.size,
+ this.mimeType,
+ required this.source,
+ });
+
+ bool get hasFile => path != null || bytes != null;
+}
+
+enum SourceType { gallery, assetPicker, filePicker }
+
+class DocumentPicker {
+ DocumentPicker._(); // 不可实例化,使用静态方法
+
+ static final ImagePicker _imagePicker = ImagePicker();
+
+ /// 检查并请求相册/媒体库权限。
+ /// 返回 true 表示有权限可访问,false 表示拒绝或受限(limited 也视为可用)。
+ static Future ensurePhotoPermission() async {
+ final PermissionState ps = await PhotoManager.requestPermissionExtend();
+ return ps.isAuth || ps == PermissionState.limited;
+ }
+
+ /// 单张从相册选择(image_picker)
+ static Future pickSingleImageFromGallery({int? maxSizeInBytes}) async {
+ try {
+ final XFile? xfile = await _imagePicker.pickImage(source: ImageSource.gallery, imageQuality: 90);
+ if (xfile == null) return null;
+ final File f = File(xfile.path);
+ final int size = await f.length();
+ if (maxSizeInBytes != null && size > maxSizeInBytes) return null;
+ final bytes = await f.readAsBytes();
+ return SelectedFile(
+ name: xfile.name,
+ path: xfile.path,
+ bytes: bytes,
+ size: size,
+ mimeType: null,
+ source: SourceType.gallery,
+ );
+ } catch (e) {
+ debugPrint('pickSingleImageFromGallery error: $e');
+ return null;
+ }
+ }
+
+ /// 多选图片(推荐使用 wechat_assets_picker)
+ static Future> pickAssets({
+ required BuildContext context,
+ int maxAssets = 9,
+ int? maxSizeInBytes,
+ }) async {
+ try {
+ final hasAuth = await ensurePhotoPermission();
+ if (!hasAuth) {
+ // 未授权,返回空,需要调用者处理引导用户
+ debugPrint('Photo permission denied');
+ return [];
+ }
+
+ final List? result = await AssetPicker.pickAssets(
+ context,
+ pickerConfig: AssetPickerConfig(
+ maxAssets: maxAssets,
+ requestType: RequestType.image,
+ specialPickerType: SpecialPickerType.noPreview,
+ ),
+ );
+
+ if (result == null || result.isEmpty) return [];
+
+ final List out = [];
+ for (final asset in result) {
+ final File? file = await asset.file;
+ if (file != null) {
+ final int size = await file.length();
+ if (maxSizeInBytes != null && size > maxSizeInBytes) continue;
+ final bytes = await file.readAsBytes();
+ out.add(SelectedFile(
+ name: file.path.split('/').last,
+ path: file.path,
+ bytes: bytes,
+ size: size,
+ mimeType: null,
+ source: SourceType.assetPicker,
+ ));
+ } else {
+ final Uint8List? originData = await asset.originBytes;
+ if (originData == null) continue;
+ final int size = originData.lengthInBytes;
+ if (maxSizeInBytes != null && size > maxSizeInBytes) continue;
+ out.add(SelectedFile(
+ name: '${asset.id}.jpg',
+ path: null,
+ bytes: originData,
+ size: size,
+ mimeType: null,
+ source: SourceType.assetPicker,
+ ));
+ }
+ }
+ return out;
+ } catch (e) {
+ debugPrint('pickAssets error: $e');
+ return [];
+ }
+ }
+
+ /// 选择任意文件(如 pdf/doc 等)
+ static Future> pickFiles({
+ bool allowMultiple = false,
+ List? allowedExtensions,
+ int? maxSizeInBytes,
+ }) async {
+ try {
+ final FileType ft = (allowedExtensions == null) ? FileType.any : FileType.custom;
+
+ final FilePickerResult? result = await FilePicker.platform.pickFiles(
+ allowMultiple: allowMultiple,
+ type: ft,
+ allowedExtensions: allowedExtensions,
+ withData: true,
+ );
+
+ if (result == null) return [];
+
+ final List out = [];
+ for (final pf in result.files) {
+ final int size = pf.size ?? (pf.bytes?.lengthInBytes ?? 0);
+ if (maxSizeInBytes != null && size > maxSizeInBytes) continue;
+ out.add(SelectedFile(
+ name: pf.name,
+ path: pf.path,
+ bytes: pf.bytes,
+ size: size,
+ mimeType: pf.extension,
+ source: SourceType.filePicker,
+ ));
+ }
+
+ return out;
+ } catch (e) {
+ debugPrint('pickFiles error: $e');
+ return [];
+ }
+ }
+
+ /// 小工具:把 SelectedFile 转换为上传需要的 File (如果 path 可用),否则保存 bytes 到临时文件并返回 File
+ static Future toFile(SelectedFile sf) async {
+ try {
+ if (sf.path != null) return File(sf.path!);
+ if (sf.bytes != null) {
+ final temp = await File('${Directory.systemTemp.path}/${sf.name}').create();
+ await temp.writeAsBytes(sf.bytes!);
+ return temp;
+ }
+ return null;
+ } catch (e) {
+ debugPrint('toFile error: $e');
+ return null;
+ }
+ }
+
+ /// 底部弹窗,用户从 "从相册获取" / "选择文件" / "取消" 中选择。
+ /// 该方法会在用户选择后直接执行对应的选择逻辑并返回选中的文件列表。
+ /// - maxAssets: 多选图片时的最大数量
+ /// - maxSizeInBytes: 单个文件最大字节数限制
+ /// - allowedExtensions: 选择文件时允许的扩展名(为空表示不限制)
+ static Future> showPickerModal(
+ BuildContext context, {
+ int maxAssets = 9,
+ int? maxSizeInBytes,
+ List? allowedExtensions,
+ bool allowMultipleFiles = false,
+ }) async {
+ final choice = await showModalBottomSheet(
+ context: context,
+ builder: (c) {
+ return SafeArea(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ ListTile(
+ title: const Center(child: Text('从相册获取')),
+ onTap: () => Navigator.of(c).pop('gallery'),
+ ),
+ const Divider(height: 1),
+ ListTile(
+ title: const Center(child: Text('选择文件')),
+ onTap: () => Navigator.of(c).pop('file'),
+ ),
+ const Divider(height: 1),
+ ListTile(
+ title: const Center(child: Text('取消')),
+ onTap: () => Navigator.of(c).pop(null),
+ ),
+ ],
+ ),
+ );
+ },
+ );
+
+ if (choice == null) return [];
+
+ if (choice == 'gallery') {
+ final hasAuth = await ensurePhotoPermission();
+ if (!hasAuth) {
+ // 未授权,提示并引导用户去设置
+ await showDialog(
+ context: context,
+ builder: (d) {
+ return AlertDialog(
+ title: const Text('权限未开启'),
+ content: const Text('应用暂无相册权限,是否去设置开启?'),
+ actions: [
+ TextButton(onPressed: () => Navigator.of(d).pop(), child: const Text('取消')),
+ TextButton(
+ onPressed: () {
+ PhotoManager.openSetting();
+ Navigator.of(d).pop();
+ },
+ child: const Text('去设置'),
+ ),
+ ],
+ );
+ },
+ );
+ return [];
+ }
+
+ // 先提供多选(wechat_assets_picker),如果你只想要单选可替换为 pickSingleImageFromGallery
+ final images = await pickAssets(context: context, maxAssets: maxAssets, maxSizeInBytes: maxSizeInBytes);
+ return images;
+ }
+
+ if (choice == 'file') {
+ final files = await pickFiles(allowMultiple: allowMultipleFiles, allowedExtensions: allowedExtensions, maxSizeInBytes: maxSizeInBytes);
+ return files;
+ }
+
+ return [];
+ }
+}
diff --git a/lib/customWidget/IconBadgeButton.dart b/lib/customWidget/IconBadgeButton.dart
new file mode 100644
index 0000000..6ea47e4
--- /dev/null
+++ b/lib/customWidget/IconBadgeButton.dart
@@ -0,0 +1,112 @@
+import 'package:flutter/material.dart';
+
+class IconBadgeButton extends StatelessWidget {
+ final String iconPath;
+ final String title;
+ final int unreadCount;
+ final VoidCallback onTap;
+ final double width; // 可选:按钮宽度(默认 80)
+
+ const IconBadgeButton({
+ Key? key,
+ required this.iconPath,
+ required this.title,
+ required this.onTap,
+ this.unreadCount = 0,
+ this.width = 80,
+ }) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // badge 文本,超过 99 展示 99+
+ final String badgeText = unreadCount.toString();
+
+ // 文字两行的高度估算(可按需微调)
+ const double titleLineHeight = 18.0;
+ const double titleMaxLines = 2;
+ final double titleHeight = titleLineHeight * titleMaxLines + 2; // +2 兜底 padding
+
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: onTap,
+ child: SizedBox(
+ width: width,
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ // 图标 + 角标(固定高度容器)
+ SizedBox(
+ width: 50,
+ height: 50,
+ child: Stack(
+ clipBehavior: Clip.none,
+ children: [
+ // 圆形背景图标(始终居中)
+ Container(
+ width: 50,
+ height: 50,
+ decoration: BoxDecoration(
+ color: const Color(0xFFE8F4FD),
+ borderRadius: BorderRadius.circular(25),
+ ),
+ child: Center(
+ child: Image.asset(
+ iconPath,
+ width: 30,
+ height: 30,
+ fit: BoxFit.contain,
+ ),
+ ),
+ ),
+
+ // 角标(只有 unreadCount > 0 时显示)
+ if (unreadCount > 0)
+ Positioned(
+ top: -6,
+ right: -6,
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 5),
+ constraints: const BoxConstraints(minWidth: 18, minHeight: 18),
+ decoration: BoxDecoration(
+ color: Colors.red,
+ borderRadius: BorderRadius.circular(9),
+ border: Border.all(color: Colors.white, width: 1.5),
+ ),
+ alignment: Alignment.center,
+ child: Text(
+ badgeText,
+ style: const TextStyle(
+ color: Colors.white,
+ fontSize: 10,
+ fontWeight: FontWeight.bold,
+ ),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+
+ // 固定高度的文字区域(最多两行),保持图标位置不变
+ SizedBox(
+ height: titleHeight,
+ child: Center(
+ child: Text(
+ title,
+ style: const TextStyle(
+ fontSize: 12,
+ color: Colors.black87,
+ ),
+ textAlign: TextAlign.center,
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/customWidget/ItemWidgetFactory.dart b/lib/customWidget/ItemWidgetFactory.dart
new file mode 100644
index 0000000..03d1733
--- /dev/null
+++ b/lib/customWidget/ItemWidgetFactory.dart
@@ -0,0 +1,704 @@
+import 'package:flutter/material.dart';
+import 'package:qhd_prevention/customWidget/toast_util.dart';
+
+import '../http/ApiService.dart';
+import '../tools/tools.dart';
+
+/// 自定义组件
+class ListItemFactory {
+ /// 类型1:横向spaceBetween布局两个文本加按钮
+ static Widget createRowSpaceBetweenItem({
+ required String leftText,
+ required String rightText,
+ double verticalPadding = 10,
+ double horizontalPadding = 0,
+ Color textColor = Colors.black,
+ bool isRight = false,
+ bool isRequired = false,
+ }) {
+ return Padding(
+ padding: EdgeInsets.symmetric(
+ vertical: verticalPadding,
+ horizontal: horizontalPadding,
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(isRequired?'* ':' ', style: TextStyle(color: Colors.red)),
+ Text(
+ leftText,
+ style: TextStyle(
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ color: textColor,
+ ),
+ ),
+ ],
+ ),
+ if (isRight)
+ Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Flexible(
+ fit: FlexFit.loose,
+ child: Text(
+ _truncateText(rightText,20) ,
+ style: TextStyle(fontSize: 13, color: Colors.black54),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ ),
+ ),
+ SizedBox(width: 6),
+ Icon(
+ Icons.arrow_forward_ios_rounded,
+ color: Colors.black45,
+ size: 15,
+ ),
+ ],
+ )
+ else
+ Flexible(
+ fit: FlexFit.loose,
+ child: Text(
+ _truncateText(rightText,17) ,
+ style: TextStyle(fontSize: 13, color: Colors.grey),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ textAlign: TextAlign.right,
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ // 辅助函数:截断文本
+ static String _truncateText(String text, int maxLength) {
+ if (text.length <= maxLength) return text;
+ return text.substring(0, maxLength) + '...';
+ }
+
+ ///类型2:上下布局两个文本(自适应高度)
+ static Widget createColumnTextItem({
+ required String topText,
+ required String bottomText,
+ double verticalPadding = 15,
+ double horizontalPadding = 0,
+ }) {
+ return Padding(
+ padding: EdgeInsets.symmetric(
+ vertical: verticalPadding,
+ horizontal: horizontalPadding,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ topText,
+ style: TextStyle(
+ fontSize: 13,
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ ),
+ ),
+ const SizedBox(height: 5),
+ Text(
+ bottomText,
+ style: TextStyle(fontSize: 13, color: Colors.grey),
+ softWrap: true,
+ maxLines: null, // 允许无限行数
+ ),
+ ],
+ ),
+ );
+ }
+
+ /// 类型3:文本和图片上下布局
+ static Widget createTextImageItem({
+ required String text,
+ required List imageUrls,
+ double imageHeight = 90,
+ double verticalPadding = 10,
+ double horizontalPadding = 0,
+ // 点击图片时回调,index 为被点击图片的下标
+ void Function(int index)? onImageTapped,
+ }) {
+ return Padding(
+ padding: EdgeInsets.symmetric(
+ vertical: verticalPadding,
+ horizontal: horizontalPadding,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ text,
+ style: const TextStyle(
+ fontSize: 13,
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ ),
+ ),
+ const SizedBox(height: 10),
+ Wrap(
+ spacing: 8, // 水平间距
+ runSpacing: 8, // 垂直间距
+ children: List.generate(imageUrls.length, (i) {
+ final url = ApiService.baseImgPath + imageUrls[i];
+ Widget img;
+ if (url.startsWith('http')) {
+ img = Image.network(
+ url,
+ height: imageHeight,
+ width: imageHeight * 3 / 2,
+ fit: BoxFit.fill,
+ );
+ } else {
+ img = Image.asset(
+ url,
+ height: imageHeight,
+ width: imageHeight * 3 / 2,
+ fit: BoxFit.fill,
+ );
+ }
+ return GestureDetector(
+ onTap: () {
+ if (onImageTapped != null) onImageTapped(i);
+ },
+ child: ClipRRect(
+ borderRadius: BorderRadius.circular(4),
+ child: img,
+ ),
+ );
+ }),
+ ),
+ ],
+ ),
+ );
+ }
+
+ /// 类型6:文本和视频上下布局
+ static Widget createTextVideoItem({
+ required String text,
+ required String videoUrl,
+ double videoHeight = 90,
+ double verticalPadding = 10,
+ double horizontalPadding = 0,
+ VoidCallback? onVideoTapped,
+ }) {
+ return Padding(
+ padding: EdgeInsets.symmetric(
+ vertical: verticalPadding,
+ horizontal: horizontalPadding,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ text,
+ style: const TextStyle(
+ fontSize: 13,
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ ),
+ ),
+ const SizedBox(height: 10),
+ videoUrl.isNotEmpty
+ ? GestureDetector(
+ onTap: onVideoTapped,
+ child: Container(
+ height: videoHeight,
+ width: videoHeight * 3 / 2,
+ decoration: BoxDecoration(
+ color: Colors.grey[300],
+ borderRadius: BorderRadius.circular(4),
+ ),
+ child: const Center(
+ child: Icon(
+ Icons.play_circle_outline,
+ size: 40,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ )
+ : SizedBox(height: 10),
+ ],
+ ),
+ );
+ }
+
+ ///类型4:一个文本(自适应高度)
+ static Widget createAloneTextItem({
+ required String text,
+ double verticalPadding = 10,
+ double horizontalPadding = 0,
+ }) {
+ return Padding(
+ padding: EdgeInsets.symmetric(
+ vertical: verticalPadding,
+ horizontal: horizontalPadding,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ text,
+ style: TextStyle(fontSize: 13, color: Colors.grey),
+ softWrap: true,
+ maxLines: null, // 允许无限行数
+ ),
+ ],
+ ),
+ );
+ }
+
+ /// YesNo
+ static Widget createYesNoSection({
+ required String title,
+ String yesLabel = '是',
+ String noLabel = '否',
+ required bool? groupValue,
+ required ValueChanged onChanged,
+ double verticalPadding = 15,
+ double horizontalPadding = 10,
+ bool isEdit = true,
+ String text = '',
+ bool isRequired = false,
+ }) {
+ return Padding(
+ padding: EdgeInsets.only(
+ top: 0,
+ right: horizontalPadding,
+ left: horizontalPadding,
+ bottom: verticalPadding,
+ ),
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 10, vertical: isEdit ? 0 : verticalPadding),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(5),
+ ),
+ child: Row(
+ children: [
+ Expanded(
+ child: Row(
+ children: [
+ if (isRequired && isEdit)
+ Text('* ', style: TextStyle(color: Colors.red)),
+ Expanded(
+ child: Text(
+ title,
+ style: TextStyle(
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ if (isEdit)
+ Row(
+ children: [
+ Row(
+ children: [
+ Radio(
+ activeColor: Colors.blue,
+ value: true,
+ groupValue: groupValue,
+ onChanged: (val) => onChanged(val!),
+ ),
+ Text(yesLabel),
+ ],
+ ),
+ const SizedBox(width: 5),
+ Row(
+ children: [
+ Radio(
+ activeColor: Colors.blue,
+ value: false,
+ groupValue: groupValue,
+ onChanged: (val) => onChanged(val!),
+ ),
+ Text(noLabel),
+ ],
+ ),
+ ],
+ ),
+ if (!isEdit) Text(text, style: TextStyle()),
+ ],
+ ),
+ ),
+ );
+ }
+ /// 多个radio按钮
+ static Widget createMultiOptionSection({
+ required String title,
+ required List options,
+ required String? selectedValue,
+ required ValueChanged onChanged,
+ double verticalPadding = 15,
+ double horizontalPadding = 10,
+ bool isEdit = true,
+ String text = '',
+ bool isRequired = false,
+ Axis direction = Axis.horizontal, // 排列方向:水平或垂直
+ double spacing = 8.0, // 选项间距
+ }) {
+ return Padding(
+ padding: EdgeInsets.only(
+ top: verticalPadding,
+ right: horizontalPadding,
+ left: horizontalPadding,
+ bottom: verticalPadding,
+ ),
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 10, vertical: isEdit ? 0 : verticalPadding),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(5),
+ ),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Expanded(
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ if (isRequired && isEdit)
+ Text('* ', style: TextStyle(color: Colors.red)),
+ Expanded(
+ child: Text(
+ title,
+ style: TextStyle(
+ fontSize: 13,
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ if (isEdit)
+ _buildOptions(
+ options: options,
+ selectedValue: selectedValue,
+ onChanged: onChanged,
+ direction: direction,
+ spacing: spacing,
+ ),
+ if (!isEdit)
+ Text(
+ text.isNotEmpty ? text : (selectedValue ?? ''),
+ style: TextStyle(fontSize: 13),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ static Widget _buildOptions({
+ required List options,
+ required String? selectedValue,
+ required ValueChanged onChanged,
+ Axis direction = Axis.horizontal,
+ double spacing = 8.0,
+ }) {
+ final children = options.map((option) {
+ return GestureDetector(
+ onTap: () => onChanged(option),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Container(
+ width: 18,
+ height: 18,
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(
+ color: selectedValue == option ? Colors.blue : Colors.grey,
+ width: 2,
+ ),
+ color: selectedValue == option ? Colors.blue : Colors.transparent,
+ ),
+ child: selectedValue == option
+ ? Icon(
+ Icons.check,
+ size: 12,
+ color: Colors.white,
+ )
+ : null,
+ ),
+ SizedBox(width: 4),
+ Text(
+ option,
+ style: TextStyle(
+ fontSize: 13,
+ color: Colors.black,
+ ),
+ ),
+ ],
+ ),
+ );
+ }).toList();
+
+ if (direction == Axis.horizontal) {
+ return Wrap(
+ spacing: spacing,
+ children: children,
+ );
+ } else {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: children
+ .map((child) => Padding(
+ padding: EdgeInsets.only(bottom: spacing / 2),
+ child: child,
+ ))
+ .toList(),
+ );
+ }
+ }
+
+ /// 列表标题头(蓝色标识+文字)
+ static Widget createBuildSimpleSection(
+ String title, {
+ double horPadding = 10,
+ Color color = Colors.white,
+ }) {
+ return Container(
+ decoration: BoxDecoration(
+ color: color,
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Padding(
+ padding: EdgeInsets.symmetric(horizontal: horPadding, vertical: 10),
+ child: Row(
+ children: [
+ Container(width: 3, height: 15, color: Colors.blue),
+ const SizedBox(width: 8),
+ Text(
+ title,
+ style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ /// 列表标题头(蓝色圆点+文字)
+ static Widget createBlueDotSection(
+ String title,
+ {double horPadding = 10,
+ int color=0xFFf1f1f1}) {
+ return Container(
+ decoration: BoxDecoration(
+ color: Color(color),
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Padding(
+ padding: EdgeInsets.symmetric(horizontal: horPadding, vertical: 10),
+ child: Row(
+ children: [
+ Container(
+ width: 7,
+ height: 7,
+ decoration: BoxDecoration(
+ color: Colors.blue,
+ borderRadius: BorderRadius.circular(180),
+ ),
+ ),
+ const SizedBox(width: 8),
+ Expanded(
+ // 添加 Expanded
+ child: Text(
+ title,
+ style: const TextStyle(
+ fontSize: 16,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ /// 单纯标题
+ static Widget headerTitle(String title, {bool isRequired = false, double verticalPadding = 0,
+ double horizontalPadding = 0,}) {
+ return Container(
+ padding: EdgeInsets.symmetric(horizontal: horizontalPadding, vertical: verticalPadding),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Row(
+ children: [
+ if (isRequired) Text('* ', style: TextStyle(color: Colors.red)),
+ Text(
+ title,
+ maxLines: 5,
+ overflow: TextOverflow.ellipsis,
+ style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
+ )
+ ],
+ ),
+ );
+ }
+
+ /// 扩展项(根据需求自定义)
+ static Widget createCustomItem({
+ required Widget child,
+ double verticalPadding = 15,
+ double horizontalPadding = 0,
+ }) {
+ return Padding(
+ padding: EdgeInsets.symmetric(
+ vertical: verticalPadding,
+ horizontal: horizontalPadding,
+ ),
+ child: child,
+ );
+ }
+
+ /// 标题加输入框上下排列
+ static Widget createBuildMultilineInput(
+ String label,
+ String hint,
+ TextEditingController controller, {
+ bool isRequired = false,
+ int inputNum=120,
+ }) {
+ return Container(
+ height: 130,
+ padding: const EdgeInsets.only(top: 8),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ if (isRequired) Text('* ', style: TextStyle(color: Colors.red)),
+ // 标题
+ Expanded(
+ child:HhTextStyleUtils.mainTitle(label, fontSize: 13),
+ ),
+ ],
+ ),
+
+ const SizedBox(height: 8),
+ // 文本输入框,清除默认内边距以与标题左对齐
+ Expanded(
+ child: TextField(
+ autofocus: false,
+ controller: controller,
+ maxLength: inputNum,
+ keyboardType: TextInputType.multiline,
+ maxLines: null,
+ expands: true,
+ style: const TextStyle(fontSize: 13),
+ decoration: InputDecoration(
+ hintText: hint,
+ border: InputBorder.none,
+ contentPadding:
+ isRequired
+ ? EdgeInsets.symmetric(horizontal: 10)
+ : EdgeInsets.zero, // 去除默认内边距
+ ),
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ /// 分类头部
+ static Widget createYesNoSectionTwo({
+ required String title,
+ required String yesLabel,
+ required String noLabel,
+ required bool groupValue,
+ required bool canClick,
+ required BuildContext context,
+ required ValueChanged onChanged,
+ double verticalPadding = 15,
+ double horizontalPadding = 10,
+ }) {
+ return Padding(
+ padding: EdgeInsets.only(
+ top: 0,
+ right: horizontalPadding,
+ left: horizontalPadding,
+ bottom: verticalPadding,
+ ),
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 10),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(5),
+ ),
+ child: Row(
+ children: [
+ Expanded(
+ child: Text(
+ title,
+ style: TextStyle(
+ fontSize: 13,
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ ),
+ ),
+ ),
+ Row(
+ children: [
+ Row(
+ children: [
+ Radio(
+ activeColor: Colors.blue,
+ value: true,
+ groupValue: groupValue,
+ onChanged: (val) {
+ if (canClick) {
+ onChanged(val!);
+ } else {
+ ToastUtil.showNormal(context, "重大隐患不允许选此项");
+ }
+ },
+ // (val) => onChanged(val!),
+ ),
+ Text(yesLabel),
+ ],
+ ),
+ const SizedBox(width: 16),
+ Row(
+ children: [
+ Radio(
+ activeColor: Colors.blue,
+ value: false,
+ groupValue: groupValue,
+ onChanged: (val) => onChanged(val!),
+ ),
+ Text(noLabel),
+ ],
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/customWidget/MultiDictValuesPicker.dart b/lib/customWidget/MultiDictValuesPicker.dart
new file mode 100644
index 0000000..5374165
--- /dev/null
+++ b/lib/customWidget/MultiDictValuesPicker.dart
@@ -0,0 +1,475 @@
+import 'dart:convert';
+import 'package:flutter/material.dart';
+import 'package:qhd_prevention/customWidget/search_bar_widget.dart';
+import 'package:qhd_prevention/http/ApiService.dart';
+
+// 数据字典模型
+class DictCategory {
+ final String id;
+ final String name;
+ final Map extValues;
+ final String parentId;
+ final String dictValue;
+ final String dictLabel;
+ final List children;
+
+ late final String dingValue;
+ late final String dingName;
+
+ DictCategory({
+ required this.id,
+ required this.name,
+ required this.children,
+ required this.extValues,
+ required this.parentId,
+ required this.dictValue,
+ required this.dictLabel,
+
+ required this.dingValue,
+ required this.dingName,
+ });
+
+ factory DictCategory.fromJson(Map json) {
+ // 安全读取并兼容字符串或数字类型的 id
+ String parseString(dynamic v) {
+ if (v == null) return '';
+ if (v is String) return v;
+ return v.toString();
+ }
+
+ // 处理子节点
+ final rawChildren = json['children'];
+ List childrenList = [];
+ if (rawChildren is List) {
+ try {
+ childrenList = rawChildren
+ .where((e) => e != null)
+ .map((e) => DictCategory.fromJson(Map.from(e as Map)))
+ .toList();
+ } catch (e) {
+ childrenList = [];
+ }
+ }
+
+ // 处理扩展值
+ final extRaw = json['extValues'];
+ Map extMap = {};
+ if (extRaw is Map) {
+ extMap = Map.from(extRaw);
+ }
+
+ return DictCategory(
+ id: parseString(json['id']),
+ name: parseString(json['dictLabel'] ?? json['name']), // 兼容新旧字段
+ children: childrenList,
+ extValues: extMap,
+ parentId: parseString(json['parentId']),
+ dictValue: parseString(json['dictValue']),
+ dictLabel: parseString(json['dictLabel'] ?? json['name']),
+ dingValue: "",
+ dingName: "",
+ );
+ }
+
+ // 转换为Map,便于使用
+ Map toMap() {
+ return {
+ 'id': id,
+ 'name': name,
+ 'dictValue': dictValue,
+ 'dictLabel': dictLabel,
+ 'parentId': parentId,
+ 'extValues': extValues,
+ };
+ }
+}
+
+/// 数据字典选择器回调签名
+typedef DictSelectCallback = void Function(String id, String name, Map? extraData);
+
+class MultiDictValuesPicker extends StatefulWidget {
+ /// 字典类型
+ final String dictType;
+
+ /// 回调,返回选中项的 id, name 和额外数据
+ final DictSelectCallback onSelected;
+
+ /// 是否显示搜索框
+ final bool showSearch;
+
+ /// 标题
+ final String title;
+
+ /// 确认按钮文本
+ final String confirmText;
+
+ /// 取消按钮文本
+ final String cancelText;
+
+ const MultiDictValuesPicker({
+ Key? key,
+ required this.dictType,
+ required this.onSelected,
+ this.showSearch = true,
+ this.title = '请选择',
+ this.confirmText = '确定',
+ this.cancelText = '取消',
+ }) : super(key: key);
+
+ @override
+ _MultiDictValuesPickerState createState() => _MultiDictValuesPickerState();
+}
+
+class _MultiDictValuesPickerState extends State {
+ String selectedId = '';
+ String selectedName = '';
+ Map? selectedExtraData;
+ Set expandedSet = {};
+
+ List original = [];
+ List filtered = [];
+ bool loading = true;
+ bool error = false;
+ String errorMessage = '';
+
+ String dingValueWai = '';
+ String dingNameWai = '';
+
+ final TextEditingController _searchController = TextEditingController();
+
+ @override
+ void initState() {
+ super.initState();
+ selectedId = '';
+ selectedName = '';
+ expandedSet = {};
+ _searchController.addListener(_onSearchChanged);
+ _loadDictData();
+ }
+
+ @override
+ void dispose() {
+ _searchController.removeListener(_onSearchChanged);
+ _searchController.dispose();
+ super.dispose();
+ }
+
+ Future _loadDictData() async {
+ try {
+ setState(() {
+ loading = true;
+ error = false;
+ });
+
+ final result = await BasicInfoApi.getDictValues(widget.dictType);
+ final raw = result['data'] as List;
+ setState(() {
+ original = raw.map((e) => DictCategory.fromJson(e as Map)).toList();
+ filtered = original;
+ loading = false;
+ });
+ } catch (e) {
+ setState(() {
+ loading = false;
+ error = true;
+ errorMessage = e.toString();
+ });
+ }
+ }
+
+ void _onSearchChanged() {
+ final query = _searchController.text.toLowerCase().trim();
+ setState(() {
+ filtered = query.isEmpty ? original : _filterCategories(original, query);
+ // 搜索时展开所有节点以便查看结果
+ if (query.isNotEmpty) {
+ expandedSet.addAll(_getAllExpandableIds(filtered));
+ }
+ });
+ }
+
+ Set _getAllExpandableIds(List categories) {
+ Set ids = {};
+ for (var category in categories) {
+ if (category.children.isNotEmpty) {
+ ids.add(category.id);
+ ids.addAll(_getAllExpandableIds(category.children));
+ }
+ }
+ return ids;
+ }
+
+ List _filterCategories(List list, String query) {
+ List result = [];
+ for (var cat in list) {
+ final children = _filterCategories(cat.children, query);
+ if (cat.name.toLowerCase().contains(query) || children.isNotEmpty) {
+ result.add(
+ DictCategory(
+ id: cat.id,
+ name: cat.name,
+ children: children,
+ extValues: cat.extValues,
+ parentId: cat.parentId,
+ dictValue: cat.dictValue,
+ dictLabel: cat.dictLabel,
+ dingValue: "",
+ dingName: "",
+ ),
+ );
+ }
+ }
+ return result;
+ }
+
+ Widget _buildRow(DictCategory category, int indent) {
+ final hasChildren = category.children.isNotEmpty;
+ final isExpanded = expandedSet.contains(category.id);
+ final isSelected = category.id == selectedId;
+
+ return Column(
+ children: [
+ InkWell(
+ onTap: () {
+ setState(() {
+ if (hasChildren) {
+ isExpanded
+ ? expandedSet.remove(category.id)
+ : expandedSet.add(category.id);
+ }
+ selectedId = category.id;
+ selectedName = category.name;
+ selectedExtraData = category.toMap();
+ if(indent==0){
+ dingValueWai =category.dictValue;
+ dingNameWai =category.name;
+ }
+ });
+ },
+ child: Container(
+ color: Colors.white,
+ child: Row(
+ children: [
+ SizedBox(width: 16.0 * indent),
+ SizedBox(
+ width: 24,
+ child: hasChildren
+ ? Icon(
+ isExpanded
+ ? Icons.arrow_drop_down_rounded
+ : Icons.arrow_right_rounded,
+ size: 35,
+ color: Colors.grey[600],
+ )
+ : const SizedBox.shrink(),
+ ),
+ const SizedBox(width: 5),
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 12),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ category.name,
+ style: TextStyle(
+ fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
+ color: Colors.black,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Icon(
+ isSelected
+ ? Icons.radio_button_checked
+ : Icons.radio_button_unchecked,
+ color: Colors.blue,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ if (hasChildren && isExpanded)
+ ...category.children.map((child) => _buildRow(child, indent + 1)),
+ ],
+ );
+ }
+
+ Widget _buildTitleBar() {
+ return Container(
+ color: Colors.white,
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
+ child: Center(
+ child: Text(
+ widget.title,
+ style: const TextStyle(
+ fontSize: 16,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ );
+ }
+
+ Widget _buildActionBar() {
+ return Container(
+ color: Colors.white,
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ child: Row(
+ children: [
+ // 取消按钮
+ GestureDetector(
+ onTap: () => Navigator.of(context).pop(),
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ child: Text(
+ widget.cancelText,
+ style: const TextStyle(fontSize: 16, color: Colors.grey),
+ ),
+ ),
+ ),
+
+ // 搜索框(如果有搜索功能)
+ if (widget.showSearch) ...[
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 12),
+ child: SearchBarWidget(
+ controller: _searchController,
+ isShowSearchButton: false,
+ onSearch: (keyboard) {},
+ ),
+ ),
+ ),
+ ] else ...[
+ const Expanded(child: SizedBox()),
+ ],
+
+ // 确定按钮
+ GestureDetector(
+ onTap: selectedId.isEmpty
+ ? null
+ : () {
+ selectedExtraData?['dingValue']=dingValueWai ;
+ selectedExtraData?['dingName']=dingNameWai ;
+ Navigator.of(context).pop();
+ widget.onSelected(selectedId, selectedName, selectedExtraData);
+ },
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ child: Text(
+ widget.confirmText,
+ style: TextStyle(
+ fontSize: 16,
+ color: selectedId.isEmpty ? Colors.grey : Colors.blue,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ Widget _buildContent() {
+ if (loading) {
+ return const Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ CircularProgressIndicator(),
+ SizedBox(height: 16),
+ Text('加载中...'),
+ ],
+ ),
+ );
+ }
+
+ if (error) {
+ return Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ const Icon(Icons.error_outline, size: 48, color: Colors.red),
+ const SizedBox(height: 16),
+ const Text('加载失败', style: TextStyle(fontSize: 16)),
+ const SizedBox(height: 8),
+ Text(
+ errorMessage,
+ style: const TextStyle(fontSize: 12, color: Colors.grey),
+ textAlign: TextAlign.center,
+ ),
+ const SizedBox(height: 16),
+ ElevatedButton(
+ onPressed: _loadDictData,
+ child: const Text('重试'),
+ ),
+ ],
+ ),
+ );
+ }
+
+ if (filtered.isEmpty) {
+ return const Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Icon(Icons.search_off, size: 48, color: Colors.grey),
+ SizedBox(height: 16),
+ Text('暂无数据', style: TextStyle(fontSize: 16, color: Colors.grey)),
+ ],
+ ),
+ );
+ }
+
+ return Container(
+ color: Colors.white,
+ child: ListView.builder(
+ itemCount: filtered.length,
+ itemBuilder: (ctx, idx) => _buildRow(filtered[idx], 0),
+ ),
+ );
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ width: MediaQuery.of(context).size.width,
+ height: MediaQuery.of(context).size.height * 0.7,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: const BorderRadius.only(
+ topLeft: Radius.circular(12),
+ topRight: Radius.circular(12),
+ ),
+ boxShadow: [
+ BoxShadow(
+ color: Colors.black.withOpacity(0.1),
+ blurRadius: 10,
+ offset: const Offset(0, -2),
+ ),
+ ],
+ ),
+ child: Column(
+ children: [
+ // 标题行
+ // _buildTitleBar(),
+ // 操作行(取消、搜索、确定)
+ _buildActionBar(),
+ const Divider(height: 1),
+
+ // 内容区域
+ Expanded(
+ child: _buildContent(),
+ ),
+ ],
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/customWidget/big_video_viewer.dart b/lib/customWidget/big_video_viewer.dart
new file mode 100644
index 0000000..68d0000
--- /dev/null
+++ b/lib/customWidget/big_video_viewer.dart
@@ -0,0 +1,63 @@
+import 'package:flutter/material.dart';
+import 'package:photo_view/photo_view.dart';
+import 'package:qhd_prevention/customWidget/video_player_widget.dart';
+import 'package:qhd_prevention/pages/my_appbar.dart';
+import 'package:video_player/video_player.dart';
+// 查看视频
+class BigVideoViewer extends StatefulWidget {
+ const BigVideoViewer({Key? key, required this.videoUrl}) : super(key: key);
+
+ final String videoUrl;
+
+ @override
+ State createState() => _BigVideoViewerState();
+}
+
+class _BigVideoViewerState extends State {
+
+ VideoPlayerController? _videoController;
+
+ @override
+ void initState() {
+ // TODO: implement initState
+ super.initState();
+
+ _videoController?.removeListener(_controllerListener);
+ _videoController?.dispose();
+ _videoController = VideoPlayerController.networkUrl(Uri.parse(widget.videoUrl))
+ ..initialize().then((_) {
+ _videoController!
+ ..play()
+ ..addListener(_controllerListener);
+ });
+ }
+
+ void _controllerListener() {
+ if (mounted) setState(() {});
+ }
+
+ @override
+ void dispose() {
+ _videoController?.dispose();
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+
+ return Scaffold(
+ backgroundColor: Colors.black,
+ appBar: MyAppbar(
+ backgroundColor: Colors.transparent, title: '',
+ ),
+ body: SafeArea(child: Center(
+ child: VideoPlayerWidget(
+ allowSeek: false,
+ controller: _videoController,
+ coverUrl:"",
+ aspectRatio: _videoController?.value.aspectRatio ?? 16/9,
+ ),
+ ),)
+ );
+ }
+}
diff --git a/lib/customWidget/bottom_picker.dart b/lib/customWidget/bottom_picker.dart
new file mode 100644
index 0000000..1dc38c5
--- /dev/null
+++ b/lib/customWidget/bottom_picker.dart
@@ -0,0 +1,100 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:qhd_prevention/customWidget/toast_util.dart';
+
+/// 通用底部弹窗选择器
+/// Example:
+/// ```dart
+/// final choice = await BottomPicker.show(
+/// context,
+/// items: ['选项1', '选项2', '选项3'],
+/// itemBuilder: (item) => Text(item, textAlign: TextAlign.center),
+/// initialIndex: 1,
+/// );
+/// if (choice != null) {
+/// // 用户点击确定并选择了 choice
+/// }
+/// ```
+class BottomPicker {
+ /// 显示底部选择器弹窗
+ ///
+ /// [items]: 选项列表
+ /// [itemBuilder]: 每个选项的展示 Widget
+ /// [initialIndex]: 初始选中索引
+ /// [itemExtent]: 列表行高
+ /// [height]: 弹窗总高度
+ static Future show(
+ BuildContext context, {
+ required List items,
+ required Widget Function(T item) itemBuilder,
+ int initialIndex = 0,
+ double itemExtent = 50.0,
+ double height = 250,
+ }) {
+ if (items.isEmpty) return Future.value(null);
+
+ // 确保初始索引合法
+ final safeIndex = initialIndex.clamp(0, items.length - 1);
+ // 当前选中项
+ T selected = items[safeIndex];
+
+ return showModalBottomSheet(
+ context: context,
+ backgroundColor: Colors.white,
+ shape: const RoundedRectangleBorder(
+ borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
+ ),
+ builder: (ctx) {
+ return SizedBox(
+ height: height,
+ child: Column(
+ children: [
+ // 按钮行
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 16,
+ vertical: 8,
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ TextButton(
+ onPressed: () {
+ FocusScope.of(context).unfocus();
+ Navigator.of(ctx).pop();
+ },
+ child: const Text('取消', style: TextStyle(color: Colors.black54, fontSize: 16),),
+ ),
+ TextButton(
+ onPressed: () {
+ FocusScope.of(context).unfocus();
+ Navigator.of(ctx).pop(selected);
+ },
+ child: const Text('确定', style: TextStyle(color: Colors.blue, fontSize: 16),),
+ ),
+ ],
+ ),
+ ),
+ const Divider(height: 1),
+ // 滚动选择器
+ Expanded(
+ child: CupertinoPicker(
+ scrollController: FixedExtentScrollController(
+ initialItem: initialIndex,
+ ),
+ itemExtent: itemExtent,
+ onSelectedItemChanged: (index) {
+ selected = items[index];
+ },
+ // 把 itemBuilder 返回的 Widget 用 Center 包一层
+ children: items.map((item) => Center(child: itemBuilder(item))).toList(),
+ ),
+ ),
+
+ ],
+ ),
+ );
+ },
+ );
+ }
+}
diff --git a/lib/customWidget/bottom_picker_two.dart b/lib/customWidget/bottom_picker_two.dart
new file mode 100644
index 0000000..5467b37
--- /dev/null
+++ b/lib/customWidget/bottom_picker_two.dart
@@ -0,0 +1,114 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/cupertino.dart';
+
+/// 通用底部弹窗选择器
+/// Example:
+/// ```dart
+/// final choice = await BottomPickerTwo.show(
+/// context,
+/// items: ['选项1', '选项2', '选项3'],
+/// itemBuilder: (item) => Text(item, textAlign: TextAlign.center),
+/// initialIndex: 1,
+/// );
+/// if (choice != null) {
+/// // 用户点击确定并选择了 choice
+/// }
+/// ```
+class BottomPickerTwo {
+ /// 显示底部选择器弹窗
+ ///
+ /// [items]: 选项列表
+ /// [itemBuilder]: 每个选项的展示 Widget
+ /// [initialIndex]: 初始选中索引
+ /// [itemExtent]: 列表行高
+ /// [height]: 弹窗总高度
+ static Future show(
+ BuildContext context, {
+ required List items,
+ required Widget Function(dynamic item) itemBuilder,
+ int initialIndex = 0,
+ double itemExtent = 50.0,
+ double height = 250,
+ double desiredSpacing = 16.0,
+ String itemName='name',
+ }) {
+ // 当前选中项
+ dynamic selected = items[initialIndex];
+
+ return showModalBottomSheet(
+ context: context,
+ backgroundColor: Colors.white,
+ shape: const RoundedRectangleBorder(
+ borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
+ ),
+ builder: (ctx) {
+ return SizedBox(
+ height: height,
+ child: Column(
+ children: [
+ // 按钮行
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 16,
+ vertical: 8,
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ TextButton(
+ onPressed: () => Navigator.of(ctx).pop(),
+ child: const Text('取消'),
+ ),
+ TextButton(
+ onPressed: () => Navigator.of(ctx).pop(selected[itemName]),
+ child: const Text('确定'),
+ ),
+ ],
+ ),
+ ),
+ const Divider(height: 1),
+ // 滚动选择器
+ Expanded(
+ child: CupertinoPicker(
+ scrollController: FixedExtentScrollController(
+ initialItem: initialIndex,
+ ),
+ itemExtent: itemExtent,
+ onSelectedItemChanged: (index) {
+ selected = items[index];
+ },
+ // children: items.map(itemBuilder).toList(),
+ children: List.generate(items.length, (int index) {
+ return Padding(
+ // 通过Padding调整项间距
+ padding: EdgeInsets.symmetric(
+ vertical: desiredSpacing / 2,
+ ),
+ child: Center(
+ child: Text(
+ // '选项 $index',
+ items[index][itemName],
+ style: TextStyle(
+ fontSize: 15,
+ color:
+ index == selected
+ ? CupertinoColors.activeBlue
+ : CupertinoColors.black,
+ fontWeight:
+ index == selected
+ ? FontWeight.bold
+ : FontWeight.normal,
+ ),
+ ),
+ ),
+ );
+ }),
+ ),
+ ),
+ ],
+ ),
+ );
+ },
+ );
+ }
+}
diff --git a/lib/customWidget/center_multi_picker.dart b/lib/customWidget/center_multi_picker.dart
new file mode 100644
index 0000000..718c555
--- /dev/null
+++ b/lib/customWidget/center_multi_picker.dart
@@ -0,0 +1,263 @@
+import 'package:flutter/material.dart';
+import 'package:qhd_prevention/customWidget/custom_button.dart';
+import 'package:qhd_prevention/customWidget/toast_util.dart';
+
+/// 居中多选弹窗(Dialog)
+/// 返回 Future?>:用户点击确定返回所选项列表;取消或关闭返回 null。
+class CenterMultiPicker {
+ static Future?> show(
+ BuildContext context, {
+ required List items,
+ required Widget Function(T item) itemBuilder,
+ List? initialSelectedIndices,
+ int? maxSelection,
+ bool allowEmpty = false,
+ double itemHeight = 52,
+ double maxHeightFactor = 0.75, // 屏幕高度的最大占比
+ String? title,
+ }) {
+ if (items.isEmpty) return Future.value(null);
+
+ // 安全化初始索引
+ final initialSet = {};
+ if (initialSelectedIndices != null) {
+ for (final i in initialSelectedIndices) {
+ // if (i >= 0 && i < items.length) initialSet.add(i);
+ }
+ }
+
+ return showDialog?>(
+ context: context,
+ barrierDismissible: true,
+ builder: (ctx) {
+ return Dialog(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ insetPadding: const EdgeInsets.symmetric(
+ horizontal: 24,
+ vertical: 24,
+ ),
+ child: _CenterMultiPickerBody(
+ items: items,
+ itemBuilder: itemBuilder,
+ initialSelected: initialSet,
+ maxSelection: maxSelection,
+ allowEmpty: allowEmpty,
+ itemHeight: itemHeight,
+ maxHeightFactor: maxHeightFactor,
+ title: title,
+ ),
+ );
+ },
+ );
+ }
+}
+
+class _CenterMultiPickerBody extends StatefulWidget {
+ const _CenterMultiPickerBody({
+ Key? key,
+ required this.items,
+ required this.itemBuilder,
+ required this.initialSelected,
+ required this.maxSelection,
+ required this.allowEmpty,
+ required this.itemHeight,
+ required this.maxHeightFactor,
+ this.title,
+ }) : super(key: key);
+
+ final List items;
+ final Widget Function(T item) itemBuilder;
+ final Set initialSelected;
+ final int? maxSelection;
+ final bool allowEmpty;
+ final double itemHeight;
+ final double maxHeightFactor;
+ final String? title;
+
+ @override
+ State<_CenterMultiPickerBody> createState() =>
+ _CenterMultiPickerBodyState();
+}
+
+class _CenterMultiPickerBodyState extends State<_CenterMultiPickerBody> {
+ late Set _selected;
+
+ // 固定的 header / footer 高度估算
+ static const double _headerHeight = 56;
+ static const double _footerHeight = 58;
+ static const double _verticalPadding = 16; // Dialog 内上下 padding
+
+ @override
+ void initState() {
+ super.initState();
+ _selected = Set.from(widget.initialSelected);
+ }
+
+ void _toggle(int idx) {
+ setState(() {
+ if (_selected.contains(idx)) {
+ _selected.remove(idx);
+ } else {
+ if (widget.maxSelection != null &&
+ _selected.length >= widget.maxSelection!) {
+ ToastUtil.showNormal(context, '最多可选择 ${widget.maxSelection} 项');
+ return;
+ }
+ _selected.add(idx);
+ }
+ });
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final items = widget.items;
+ final screenH = MediaQuery.of(context).size.height;
+ final contentHeight =
+ items.length * widget.itemHeight +
+ _headerHeight +
+ _footerHeight +
+ _verticalPadding * 2;
+ final maxAllowed = screenH * widget.maxHeightFactor;
+ final dialogHeight =
+ contentHeight <= maxAllowed ? contentHeight : maxAllowed;
+
+ return Container(
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(10)
+ ),
+ width: double.infinity,
+ height: dialogHeight,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ // header
+ Container(
+ height: _headerHeight,
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ alignment: Alignment.centerLeft,
+ child: Row(
+ children: [
+ if (widget.title != null)
+ Expanded(
+ child: Text(
+ widget.title!,
+ style: const TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ )
+ else
+ Expanded(
+ child: Text(
+ '已选 ${_selected.length}${widget.maxSelection != null ? '/${widget.maxSelection}' : ''}',
+ style: const TextStyle(fontSize: 15),
+ ),
+ ),
+ // 可将一些快捷按钮放在右侧(如全选/反选),这里暂不显示
+ ],
+ ),
+ ),
+ const Divider(height: 1),
+ // 列表区域(可滚动)
+ Expanded(
+ child: Container(
+ padding: const EdgeInsets.symmetric(vertical: 8),
+ child: Scrollbar(
+ thumbVisibility: true,
+ child: ListView.separated(
+ physics: const BouncingScrollPhysics(),
+ itemCount: items.length,
+ separatorBuilder: (_, __) => const Divider(height: 1),
+ itemBuilder: (ctx, idx) {
+ final isSelected = _selected.contains(idx);
+ return InkWell(
+ onTap: () => _toggle(idx),
+ child: Container(
+ height: widget.itemHeight,
+ padding: const EdgeInsets.symmetric(
+ horizontal: 14,
+ vertical: 6,
+ ),
+ child: Row(
+ children: [
+ Container(
+ width: 22,
+ height: 22,
+ decoration: BoxDecoration(
+ color:
+ isSelected
+ ? Colors.blue
+ : Colors.transparent,
+ border: Border.all(
+ color:
+ isSelected ? Colors.blue : Colors.black26,
+ ),
+ borderRadius: BorderRadius.circular(4),
+ ),
+ child:
+ isSelected
+ ? const Icon(
+ Icons.check,
+ size: 18,
+ color: Colors.white,
+ )
+ : null,
+ ),
+ const SizedBox(width: 12),
+ Expanded(child: widget.itemBuilder(items[idx])),
+ ],
+ ),
+ ),
+ );
+ },
+ ),
+ ),
+ ),
+ ),
+ const Divider(height: 1),
+ // footer: 取消 / 确定(固定在底部)
+ Container(
+ height: _footerHeight,
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ child: Row(
+ children: [
+ Expanded(
+ child: CustomButton(
+ text: '取消',
+ backgroundColor: Colors.grey.shade200,
+ textStyle: TextStyle(fontSize: 14, color: Colors.black),
+ onPressed: () {
+ Navigator.of(context).pop(null);
+ },
+ ),
+ ),
+ const SizedBox(width: 12),
+ Expanded(
+ child: CustomButton(
+ text: '确定',
+ backgroundColor: Colors.blue,
+ onPressed: () {
+ if (!widget.allowEmpty && _selected.isEmpty) {
+ ToastUtil.showNormal(context, '请至少选择一项');
+ return;
+ }
+ final result = _selected
+ .map((i) => items[i])
+ .toList(growable: false);
+ Navigator.of(context).pop(result);
+ },
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/customWidget/custom_alert_dialog.dart b/lib/customWidget/custom_alert_dialog.dart
new file mode 100644
index 0000000..ad5c9ca
--- /dev/null
+++ b/lib/customWidget/custom_alert_dialog.dart
@@ -0,0 +1,301 @@
+// custom_alert_dialog.dart
+import 'package:flutter/material.dart';
+import 'package:qhd_prevention/main.dart'; // 导入全局 navigatorKey
+
+/// 对话框模式
+enum DialogMode { text, input }
+
+class CustomAlertDialog extends StatefulWidget {
+ final String title;
+ final String content;
+ final String hintText;
+ final String cancelText;
+ final String confirmText;
+ final VoidCallback? onCancel;
+ final VoidCallback? onConfirm;
+ final ValueChanged? onInputConfirm;
+ final DialogMode mode;
+ final bool force;
+
+ const CustomAlertDialog({
+ Key? key,
+ required this.title,
+ this.content = '',
+ this.hintText = '',
+ this.cancelText = '取消',
+ this.confirmText = '确定',
+ this.onCancel,
+ this.onConfirm,
+ this.onInputConfirm,
+ this.mode = DialogMode.text,
+ this.force = false,
+ }) : super(key: key);
+
+ // ------------------ 静态快捷方法 ------------------
+
+ static Future showConfirm(
+ BuildContext context, {
+ required String title,
+ String content = '',
+ String cancelText = '取消',
+ String confirmText = '确定',
+ bool barrierDismissible = true,
+ VoidCallback? onConfirm,
+ bool force = false,
+ }) async {
+ final result = await showDialog(
+ context: context,
+ barrierDismissible: force ? false : barrierDismissible,
+ builder: (_) => PopScope(
+ canPop: false,
+ child: CustomAlertDialog(
+ title: title,
+ content: content,
+ cancelText: cancelText,
+ confirmText: confirmText,
+ onConfirm: onConfirm,
+ force: force,
+ ),)
+ );
+ return result == true;
+ }
+
+ static Future showAlert(
+ BuildContext context, {
+ required String title,
+ String content = '',
+ String confirmText = '确定',
+ bool barrierDismissible = true,
+ VoidCallback? onConfirm,
+ bool force = false,
+ }) async {
+ await showDialog(
+ context: context,
+ barrierDismissible: force ? false : barrierDismissible,
+ builder: (_) => CustomAlertDialog(
+ title: title,
+ content: content,
+ cancelText: '',
+ confirmText: confirmText,
+ onConfirm: onConfirm,
+ force: force,
+ ),
+ );
+ }
+
+ static Future showInput(
+ BuildContext context, {
+ required String title,
+ String hintText = '',
+ String cancelText = '取消',
+ String confirmText = '确定',
+ bool barrierDismissible = true,
+ bool force = false,
+ }) async {
+ final result = await showDialog(
+ context: context,
+ barrierDismissible: force ? false : barrierDismissible,
+ builder: (_) => CustomAlertDialog(
+ title: title,
+ hintText: hintText,
+ cancelText: cancelText,
+ confirmText: confirmText,
+ mode: DialogMode.input,
+ force: force,
+ ),
+ );
+ // 取消/点遮罩会得到 null;确认会得到 String(可能为空串)
+ return result;
+ }
+
+
+ @override
+ _CustomAlertDialogState createState() => _CustomAlertDialogState();
+}
+
+class _CustomAlertDialogState extends State {
+ late TextEditingController _controller;
+ bool _isClosing = false;
+
+ @override
+ void initState() {
+ super.initState();
+ _controller = TextEditingController();
+ }
+
+ @override
+ void dispose() {
+ _controller.dispose();
+ super.dispose();
+ }
+
+ bool get hasCancel => !widget.force && widget.cancelText.isNotEmpty;
+
+ void _closeDialog([dynamic result]) {
+ if (_isClosing) return;
+ _isClosing = true;
+
+ // 优先使用当前上下文导航
+ if (mounted) {
+ Navigator.of(context).pop(result);
+ } else {
+ // 后备方案:使用全局导航键
+ navigatorKey.currentState?.pop(result);
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return PopScope(
+ canPop: !widget.force,
+ child: Dialog(
+ backgroundColor: Colors.transparent,
+ child: Container(
+ constraints: const BoxConstraints(minWidth: 280),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const SizedBox(height: 20),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 20),
+ child: Text(
+ widget.title,
+ style: const TextStyle(
+ fontSize: 18,
+ fontWeight: FontWeight.bold,
+ ),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ const SizedBox(height: 16),
+ if (widget.mode == DialogMode.text)
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 24),
+ child: Text(
+ widget.content,
+ style: const TextStyle(
+ fontSize: 16,
+ color: Colors.black54,
+ ),
+ textAlign: TextAlign.center,
+ ),
+ )
+ else
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 20),
+ child: TextField(
+ controller: _controller,
+ autofocus: true,
+ decoration: InputDecoration(
+ hintText: widget.hintText,
+ border: const OutlineInputBorder(),
+ focusedBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.blue, width: 1),
+ borderRadius: BorderRadius.circular(4),
+ ),
+ isDense: true,
+ contentPadding: const EdgeInsets.symmetric(
+ vertical: 10,
+ horizontal: 10,
+ ),
+ ),
+ ),
+ ),
+ const SizedBox(height: 20),
+ const Divider(height: 1),
+ hasCancel
+ ? _buildDoubleButtons(context)
+ : _buildSingleButton(context),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ Widget _buildDoubleButtons(BuildContext context) {
+ return Row(
+ children: [
+ Expanded(
+ child: InkWell(
+ onTap: () {
+ widget.onCancel?.call();
+ _closeDialog(widget.mode == DialogMode.text ? false : null);
+ },
+ child: Container(
+ padding: const EdgeInsets.symmetric(vertical: 12),
+ alignment: Alignment.center,
+ child: Text(
+ widget.cancelText,
+ style: const TextStyle(
+ fontWeight: FontWeight.w500,
+ color: Colors.black87,
+ fontSize: 18,
+ ),
+ ),
+ ),
+ ),
+ ),
+ Container(width: 1, height: 48, color: Colors.grey[300]),
+ Expanded(
+ child: InkWell(
+ onTap: () {
+ if (widget.mode == DialogMode.text) {
+ widget.onConfirm?.call();
+ _closeDialog(true);
+ } else {
+ final value = _controller.text.trim();
+ widget.onInputConfirm?.call(value);
+ _closeDialog(value);
+ }
+ },
+ child: Container(
+ padding: const EdgeInsets.symmetric(vertical: 12),
+ alignment: Alignment.center,
+ child: Text(
+ widget.confirmText,
+ style: const TextStyle(
+ color: Color(0xFF1C61FF),
+ fontWeight: FontWeight.w500,
+ fontSize: 18,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+
+ Widget _buildSingleButton(BuildContext context) {
+ return InkWell(
+ onTap: () {
+ if (widget.mode == DialogMode.text) {
+ widget.onConfirm?.call();
+ _closeDialog(true);
+ } else {
+ final value = _controller.text.trim();
+ widget.onInputConfirm?.call(value);
+ _closeDialog(value);
+ }
+ },
+ child: Container(
+ width: double.infinity,
+ padding: const EdgeInsets.symmetric(vertical: 14),
+ alignment: Alignment.center,
+ child: Text(
+ widget.confirmText,
+ style: const TextStyle(
+ color: Color(0xFF1C61FF),
+ fontWeight: FontWeight.w500,
+ fontSize: 18,
+ ),
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/customWidget/custom_button.dart b/lib/customWidget/custom_button.dart
new file mode 100644
index 0000000..fd145e2
--- /dev/null
+++ b/lib/customWidget/custom_button.dart
@@ -0,0 +1,174 @@
+import 'package:flutter/material.dart';
+
+/// 按钮样式类型
+enum ButtonStyleType {
+ primary, // 主样式:纯色背景,无边框
+ secondary, // 次样式:白色背景,深灰文字,深灰边框
+}
+
+/// 自定义默认按钮(支持不可点击/禁用状态和防连点功能)
+class CustomButton extends StatefulWidget {
+ final String text; // 按钮文字
+ final Color backgroundColor; // 按钮背景色
+ final double borderRadius; // 圆角半径(默认5)
+ final VoidCallback? onPressed; // 点击事件回调
+ final EdgeInsetsGeometry? padding; // 内边距
+ final EdgeInsetsGeometry? margin; // 外边距
+ final double? height; // 按钮高度
+ final TextStyle? textStyle; // 文字样式
+
+ /// 新增:是否可点击(true 可点,false 禁用)
+ /// 注意:如果 onPressed 为 null,也会被视为不可点击
+ final bool enabled;
+
+ /// 新增:禁用时的背景色(可选)
+ final Color? disabledBackgroundColor;
+
+ /// 新增:禁用时的文字颜色(可选)
+ final Color? disabledTextColor;
+
+ /// 新增:文字颜色(可选)
+ final Color? textColor;
+
+ /// 新增:防连点间隔时间(毫秒)
+ final int debounceInterval;
+
+ /// 新增:按钮样式类型
+ final ButtonStyleType buttonStyle;
+
+ /// 新增:边框颜色(仅在 secondary 样式下使用,如不指定则使用默认深灰色)
+ final Color? borderColor;
+
+ /// 新增:边框宽度(仅在 secondary 样式下使用)
+ final double borderWidth;
+
+ const CustomButton({
+ super.key,
+ required this.text,
+ this.backgroundColor = Colors.blue,
+ this.borderRadius = 5.0,
+ this.onPressed,
+ this.padding,
+ this.margin,
+ this.height,
+ this.textStyle,
+ this.textColor,
+ this.enabled = true,
+ this.disabledBackgroundColor,
+ this.disabledTextColor,
+ this.debounceInterval = 1000, // 默认1秒防连点
+ this.buttonStyle = ButtonStyleType.primary, // 默认为主样式
+ this.borderColor,
+ this.borderWidth = 1.0,
+ });
+
+ @override
+ State createState() => _CustomButtonState();
+}
+
+class _CustomButtonState extends State {
+ // 记录最后一次点击时间
+ DateTime _lastClickTime = DateTime(0);
+
+ @override
+ Widget build(BuildContext context) {
+ // 如果 enabled 为 false 或 onPressed 为 null,则视为不可点击
+ final bool isEnabled = widget.enabled && widget.onPressed != null;
+
+ // 根据按钮样式计算背景色、文字颜色和边框
+ final Color bgColor;
+ final Color textColor;
+ final Color? borderColor;
+
+ if (widget.buttonStyle == ButtonStyleType.secondary) {
+ // 次样式:白色背景,深灰文字,深灰边框
+ bgColor = isEnabled
+ ? Colors.white
+ : (widget.disabledBackgroundColor ?? Colors.grey.shade200);
+
+ textColor = isEnabled
+ ? Colors.grey[800]!
+ : (widget.disabledTextColor ?? Colors.grey.shade500);
+
+ borderColor = isEnabled
+ ? (widget.borderColor ?? Colors.grey.shade400)
+ : (widget.disabledTextColor ?? Colors.grey.shade300);
+ } else {
+ // 主样式:原有逻辑
+ bgColor = isEnabled
+ ? widget.backgroundColor
+ : (widget.disabledBackgroundColor ?? Colors.grey.shade400);
+
+ textColor = widget.textColor ?? (isEnabled ? Colors.white : (widget
+ .disabledTextColor ?? Colors.white70));
+ borderColor = null; // 主样式默认无边框
+ }
+
+ // 计算最终文字样式
+ TextStyle finalTextStyle;
+ if (widget.textStyle != null) {
+ finalTextStyle = widget.textStyle!.copyWith(color: textColor);
+ } else {
+ finalTextStyle = TextStyle(
+ color: textColor,
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ );
+ }
+
+ // 处理点击事件(添加防连点逻辑)
+ void handleOnPressed() {
+ final now = DateTime.now();
+ if (now
+ .difference(_lastClickTime)
+ .inMilliseconds < widget.debounceInterval) {
+ // 在防连点间隔内,不执行操作
+ return;
+ }
+
+ _lastClickTime = now;
+
+ if (widget.onPressed != null) {
+ widget.onPressed!();
+ }
+ }
+
+ // 构建边框
+ final BoxBorder? border = borderColor != null
+ ? Border.all(
+ color: borderColor,
+ width: widget.borderWidth,
+ )
+ : null;
+
+ // 点击拦截器 + 视觉反馈(禁用时降低不透明度)
+ return Opacity(
+ opacity: isEnabled ? 1.0 : 0.65,
+ child: AbsorbPointer(
+ absorbing: !isEnabled,
+ child: GestureDetector(
+ onTap: isEnabled ? handleOnPressed : null,
+ child: Container(
+ height: widget.height ?? 45,
+ // 默认高度45
+ padding: widget.padding ?? const EdgeInsets.all(6),
+ // 默认内边距
+ margin: widget.margin ?? const EdgeInsets.symmetric(horizontal: 5),
+ // 默认外边距
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(widget.borderRadius),
+ color: bgColor,
+ border: border,
+ ),
+ child: Center(
+ child: Text(
+ widget.text,
+ style: finalTextStyle,
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/customWidget/danner_repain_item.dart b/lib/customWidget/danner_repain_item.dart
new file mode 100644
index 0000000..84071f0
--- /dev/null
+++ b/lib/customWidget/danner_repain_item.dart
@@ -0,0 +1,168 @@
+import 'package:flutter/material.dart';
+import 'package:qhd_prevention/customWidget/custom_button.dart';
+import '../tools/tools.dart';
+
+/// 通用列表卡片组件:
+/// - 两两为一组,固定左右布局,平均分配宽度
+/// - 左侧文字左对齐,右侧文字右对齐
+/// - 文字过多时各自自动换行
+/// - 如果一行只有一个元素,靠左显示
+class DannerRepainItem extends StatelessWidget {
+ final String title;
+ final List details;
+ final bool showBottomTags;
+ final List bottomTags;
+ final bool showTitleIcon;
+ final VoidCallback? onPressed;
+ final bool showBottomBtn;
+ final String showBottomText;
+
+ const DannerRepainItem({
+ Key? key,
+ required this.title,
+ required this.details,
+ this.showBottomTags = false,
+ this.showTitleIcon = true,
+ this.bottomTags = const [],
+ this.onPressed,
+ this.showBottomBtn = true,
+ this.showBottomText = '查看',
+ }) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.only(left: 15, right: 15, bottom: 15),
+ child: Container(
+ decoration: const BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.all(Radius.circular(5)),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ // — 标题行 —
+ Padding(
+ padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(children: [
+ if (showTitleIcon)
+ const Icon(Icons.star_rate_sharp, color: Colors.blue, size: 18),
+ SizedBox(width: showTitleIcon ? 5 : 0),
+ Text(title, style: const TextStyle(fontSize: 14)),
+ ]),
+ const Icon(Icons.arrow_forward_ios_rounded, color: Colors.grey, size: 15),
+ ],
+ ),
+ ),
+ const Divider(height: 1),
+
+ // — 详情区:固定左右布局 —
+ Padding(
+ padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
+ child: Column(
+ children: _buildDetailRows(),
+ ),
+ ),
+
+ // — 底部标签区 —
+ if (showBottomTags && bottomTags.isNotEmpty)
+ Padding(
+ padding: const EdgeInsets.only(left: 15, right: 15, bottom: 10),
+ child: Wrap(spacing: 5, runSpacing: 5, children: bottomTags),
+ ),
+
+ if (showBottomBtn)
+ CustomButton(text: showBottomText,backgroundColor: Colors.blue,margin: EdgeInsets.symmetric(horizontal: 10),
+ onPressed: onPressed,),
+ SizedBox(height: 5,),
+ ],
+ ),
+ ),
+ );
+ }
+
+ // 构建详情行
+ List _buildDetailRows() {
+ List rows = [];
+ for (int i = 0; i < details.length; i += 2) {
+ final left = details[i];
+ final right = (i + 1 < details.length) ? details[i + 1] : '';
+
+ rows.add(
+ Padding(
+ padding: const EdgeInsets.only(bottom: 8),
+ child: _DetailRow(left: left, right: right),
+ ),
+ );
+ }
+ return rows;
+ }
+}
+
+/// 详情行组件:固定左右布局,平均分配宽度,各自换行
+/// 如果只有左侧文本,则靠左显示
+class _DetailRow extends StatelessWidget {
+ final String left;
+ final String right;
+
+ const _DetailRow({
+ Key? key,
+ required this.left,
+ required this.right,
+ }) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // 如果右侧文本为空,只显示左侧文本,靠左显示
+ if (right.isEmpty) {
+ return Align(
+ alignment: Alignment.centerLeft,
+ child: _DetailText(left, textAlign: TextAlign.left),
+ );
+ }
+
+ return Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ // 左侧文本 - 占50%宽度
+ Expanded(
+ flex: 1,
+ child: _DetailText(left, textAlign: TextAlign.left),
+ ),
+
+ // 中间间距
+ const SizedBox(width: 10),
+
+ // 右侧文本 - 占50%宽度
+ Expanded(
+ flex: 1,
+ child: _DetailText(right, textAlign: TextAlign.right),
+ ),
+ ],
+ );
+ }
+}
+
+/// Detail 文本封装:支持自动换行和指定的对齐方式
+class _DetailText extends StatelessWidget {
+ final String text;
+ final TextAlign textAlign;
+
+ const _DetailText(this.text, {
+ Key? key,
+ required this.textAlign,
+ }) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return Text(
+ text,
+ style: HhTextStyleUtils.secondaryTitleStyle,
+ softWrap: true, // 允许换行
+ textAlign: textAlign, // 使用指定的对齐方式
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/customWidget/date_picker_dialog.dart b/lib/customWidget/date_picker_dialog.dart
new file mode 100644
index 0000000..057d4bb
--- /dev/null
+++ b/lib/customWidget/date_picker_dialog.dart
@@ -0,0 +1,168 @@
+import 'package:flutter/material.dart';
+import 'package:intl/intl.dart';
+import 'package:qhd_prevention/customWidget/custom_button.dart';
+
+class HDatePickerDialog extends StatefulWidget {
+ final DateTime initialDate;
+ final VoidCallback onCancel;
+ final ValueChanged onConfirm;
+
+ const HDatePickerDialog({
+ Key? key,
+ required this.initialDate,
+ required this.onCancel,
+ required this.onConfirm,
+ }) : super(key: key);
+
+ @override
+ _HDatePickerDialogState createState() => _HDatePickerDialogState();
+}
+
+class _HDatePickerDialogState extends State {
+ late DateTime _displayedMonth;
+ late DateTime _selectedDate;
+
+ @override
+ void initState() {
+ super.initState();
+ _selectedDate = widget.initialDate;
+ _displayedMonth = DateTime(widget.initialDate.year, widget.initialDate.month);
+ }
+
+ void _prevMonth() {
+ setState(() {
+ _displayedMonth = DateTime(_displayedMonth.year, _displayedMonth.month - 1);
+ });
+ }
+
+ void _nextMonth() {
+ setState(() {
+ _displayedMonth = DateTime(_displayedMonth.year, _displayedMonth.month + 1);
+ });
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final daysInMonth = DateUtils.getDaysInMonth(_displayedMonth.year, _displayedMonth.month);
+ final firstWeekday = DateTime(_displayedMonth.year, _displayedMonth.month, 1).weekday;
+
+ return GestureDetector(
+ onTap: widget.onCancel,
+ child: Material(
+ color: Colors.black54,
+ child: Center(
+ child: GestureDetector(
+ onTap: () {}, // 拦截点击
+ child: Container(
+ width: 320,
+ padding: const EdgeInsets.all(16),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ // 顶部显示选中日期
+ Text(
+ DateFormat('yyyy-MM-dd').format(_selectedDate),
+ style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
+ ),
+ const SizedBox(height: 16),
+
+ // 月份选择
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ IconButton(
+ icon: const Icon(Icons.chevron_left),
+ onPressed: _prevMonth,
+ ),
+ Text(
+ DateFormat('yyyy 年 MM 月').format(_displayedMonth),
+ style: const TextStyle(fontSize: 16),
+ ),
+ IconButton(
+ icon: const Icon(Icons.chevron_right),
+ onPressed: _nextMonth,
+ ),
+ ],
+ ),
+
+ // 星期标题
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
+ children: ['一', '二', '三', '四', '五', '六', '日']
+ .map((d) => Expanded(
+ child: Center(child: Text(d)),
+ ))
+ .toList(),
+ ),
+ SizedBox(height: 10,),
+ // 日历网格
+ GridView.builder(
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
+ crossAxisCount: 7,
+ childAspectRatio: 1.2,
+ crossAxisSpacing: 4,
+ mainAxisSpacing: 4,
+ ),
+ itemCount: daysInMonth + firstWeekday - 1,
+ itemBuilder: (context, index) {
+ if (index < firstWeekday - 1) {
+ return const SizedBox();
+ }
+ final day = index - firstWeekday + 2;
+ final date = DateTime(_displayedMonth.year, _displayedMonth.month, day);
+ final isSelected = DateUtils.isSameDay(date, _selectedDate);
+
+ return GestureDetector(
+ onTap: () {
+ setState(() {
+ _selectedDate = date;
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ color: isSelected ? Colors.blue : null,
+ shape: BoxShape.circle,
+ ),
+ child: Center(
+ child: Text(
+ '$day',
+ style: TextStyle(
+ color: isSelected ? Colors.white : Colors.black87,
+ ),
+ ),
+ ),
+ ),
+ );
+ },
+ ),
+
+ const SizedBox(height: 16),
+
+ // 按钮
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ Expanded(child: CustomButton(text: '取消',height: 40,backgroundColor: Colors.grey.shade500,
+ onPressed: widget.onCancel),),
+ SizedBox(width: 30,),
+ Expanded(child: CustomButton(text: '确定',height: 40,backgroundColor: Colors.blue,
+ onPressed: () => widget.onConfirm(_selectedDate)),)
+
+
+ ],
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/customWidget/department_person_picker.dart b/lib/customWidget/department_person_picker.dart
new file mode 100644
index 0000000..be66b50
--- /dev/null
+++ b/lib/customWidget/department_person_picker.dart
@@ -0,0 +1,231 @@
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:qhd_prevention/customWidget/search_bar_widget.dart';
+
+/// 用户数据模型
+class Person {
+ final String userId;
+ final String name;
+ final String departmentName;
+ final String phone;
+
+ Person({required this.userId, required this.name, required this.departmentName, required this.phone});
+
+ factory Person.fromJson(Map json) {
+ return Person(
+ userId: json['id'] ?? '' ,
+ name: json['username'] ?? '',
+ departmentName: json['departmentName'] ?? '',
+ phone: json['phone'] ?? '',
+ );
+ }
+}
+
+/// 原回调签名(向后兼容)
+typedef PersonSelectCallback = void Function(String userId, String name);
+
+/// 新回调签名,增加可选 index(int,默认 0)
+typedef PersonSelectCallbackWithIndex = void Function(String userId, String name, int index);
+
+/// 新增:带 data 的回调(不会替换原有 typedef,向后兼容)
+typedef PersonSelectCallbackWithData = void Function(String userId, String name, Map data);
+
+/// 新增:带 index 和 data 的回调
+typedef PersonSelectCallbackWithIndexAndData = void Function(String userId, String name, int index, Map data);
+
+/// 底部弹窗人员选择器(使用预先传入的原始数据列表,不做接口请求)
+class DepartmentPersonPicker {
+ /// 显示人员选择弹窗
+ ///
+ /// [personsData]: 已拉取并缓存的原始 Map 列表(每项最好是 Map)
+ /// [onSelected]: 选中后回调 USER_ID 和 NAME(向后兼容旧代码)
+ /// [onSelectedWithIndex]: 可选的新回调,额外返回 index(index 为在原始 personsData/_all 中的下标,找不到则为 0)
+ /// [onSelectedWithData]: 可选回调,返回 userId/name + 选中项的完整原始 Map(不影响旧回调)
+ /// [onSelectedWithIndexWithData]: 可选回调,返回 userId/name/index + 选中项的完整原始 Map(优先级最高)
+ static Future show(
+ BuildContext context, {
+ required List personsData,
+ PersonSelectCallback? onSelected,
+ PersonSelectCallbackWithIndex? onSelectedWithIndex,
+ PersonSelectCallbackWithData? onSelectedWithData,
+ PersonSelectCallbackWithIndexAndData? onSelectedWithIndexWithData,
+ }) async {
+ // 至少传入一个回调(保持对旧调用的兼容)
+ assert(
+ onSelected != null ||
+ onSelectedWithIndex != null ||
+ onSelectedWithData != null ||
+ onSelectedWithIndexWithData != null,
+ '请至少传入一个回调:onSelected / onSelectedWithIndex / onSelectedWithData / onSelectedWithIndexWithData',
+ );
+
+ // 转换为模型(personsData 可能包含非 Map 的条目)
+ final List