commit 4d12f8afc2fd52c7a1f7635c55973e822a079c3f Author: zhutao <1812073942@qq.com> Date: Thu Sep 4 10:16:11 2025 +0800 基本完成除了详情 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79c113f --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# 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 + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..652684f --- /dev/null +++ b/.metadata @@ -0,0 +1,33 @@ +# 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: "077b4a4ce10a07b82caa6897f0c626f9c0a3ac90" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90 + base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90 + - platform: android + create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90 + base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90 + - platform: ios + create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90 + base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90 + + # 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/README.md b/README.md new file mode 100644 index 0000000..f731e41 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# plan + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..7869e82 --- /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: + # 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 +formatter: + trailing_commas: preserve \ No newline at end of file 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..f6ea623 --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +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") +} + +android { + namespace = "com.curainhealth.plan" + compileSdk = flutter.compileSdkVersion + ndkVersion = "27.0.12077973" + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.curainhealth.plan" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.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..8fd2ad5 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/curainhealth/plan/MainActivity.kt b/android/app/src/main/kotlin/com/curainhealth/plan/MainActivity.kt new file mode 100644 index 0000000..656e265 --- /dev/null +++ b/android/app/src/main/kotlin/com/curainhealth/plan/MainActivity.kt @@ -0,0 +1,5 @@ +package com.curainhealth.plan + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() 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..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + 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..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + 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..db77bb4 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..17987b7 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..09d4391 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..d5f1c8d 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..4d6372e 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/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + 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..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + 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/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..f018a61 --- /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 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..1ca3856 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.12-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..ab39a10 --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,25 @@ +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() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.3" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false +} + +include(":app") diff --git a/assets/font/NotoSansSC.ttf b/assets/font/NotoSansSC.ttf new file mode 100644 index 0000000..4c4da76 Binary files /dev/null and b/assets/font/NotoSansSC.ttf differ diff --git a/assets/image/apple.png b/assets/image/apple.png new file mode 100644 index 0000000..26bec26 Binary files /dev/null and b/assets/image/apple.png differ diff --git a/assets/image/empty_data.png b/assets/image/empty_data.png new file mode 100644 index 0000000..3d3f30a Binary files /dev/null and b/assets/image/empty_data.png differ diff --git a/assets/image/google.png b/assets/image/google.png new file mode 100644 index 0000000..4f94d6d Binary files /dev/null and b/assets/image/google.png differ diff --git a/assets/image/logo.png b/assets/image/logo.png new file mode 100644 index 0000000..5e230cc Binary files /dev/null and b/assets/image/logo.png differ diff --git a/assets/image/xiaozhi.png b/assets/image/xiaozhi.png new file mode 100644 index 0000000..f169ad7 Binary files /dev/null and b/assets/image/xiaozhi.png differ 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..7c56964 --- /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 + 12.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..0859db9 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,616 @@ +// !$*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 */; }; +/* 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 = ""; }; + 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 = ""; }; + 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 = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + 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 */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 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 = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + 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 = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + 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 */ + 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"; + }; +/* 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 = 12.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; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.curainhealth.plan; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.curainhealth.plan.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; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.curainhealth.plan.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; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.curainhealth.plan.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 = 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; + 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 = 12.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 = 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 = 12.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; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.curainhealth.plan; + PRODUCT_NAME = "$(TARGET_NAME)"; + 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; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.curainhealth.plan; + PRODUCT_NAME = "$(TARGET_NAME)"; + 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..1d526a1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + 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..6266644 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} 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..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/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..dc9ada4 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..7353c41 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..797d452 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..6ed2d93 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..4cd7b00 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..fe73094 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..321773c 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..797d452 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..502f463 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..0ec3034 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-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..0ec3034 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..e9f5fea 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-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..84ac32a 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..8953cba 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..0467bf1 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/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea 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..9da19ea 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..9da19ea 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..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..2b79547 --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Plan + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + plan + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + 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/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/api/dto/base_dto.dart b/lib/api/dto/base_dto.dart new file mode 100644 index 0000000..4fc7555 --- /dev/null +++ b/lib/api/dto/base_dto.dart @@ -0,0 +1,15 @@ +class ApiDto { + final int code; + final String message; + final T data; + + ApiDto({required this.code, required this.message, required this.data}); + + factory ApiDto.fromJson(Map json) { + return ApiDto( + code: json['code'], + message: json['message'], + data: json['data'], + ); + } +} diff --git a/lib/api/dto/login_dto.dart b/lib/api/dto/login_dto.dart new file mode 100644 index 0000000..d149181 --- /dev/null +++ b/lib/api/dto/login_dto.dart @@ -0,0 +1,86 @@ +class UserInfo { + int? id; + String? name; + dynamic avatar; + String? email; + dynamic emailVerifiedAt; + dynamic googleId; + dynamic appleId; + String? lastLoginIp; + String? lastLoginTime; + dynamic lastUsedTime; + int? status; + String? createdAt; + String? updatedAt; + + UserInfo({ + this.id, + this.name, + this.avatar, + this.email, + this.emailVerifiedAt, + this.googleId, + this.appleId, + this.lastLoginIp, + this.lastLoginTime, + this.lastUsedTime, + this.status, + this.createdAt, + this.updatedAt, + }); + + Map toJson() { + final map = {}; + map["id"] = id; + map["name"] = name; + map["avatar"] = avatar; + map["email"] = email; + map["email_verified_at"] = emailVerifiedAt; + map["google_id"] = googleId; + map["apple_id"] = appleId; + map["last_login_ip"] = lastLoginIp; + map["last_login_time"] = lastLoginTime; + map["last_used_time"] = lastUsedTime; + map["status"] = status; + map["created_at"] = createdAt; + map["updated_at"] = updatedAt; + return map; + } + + UserInfo.fromJson(dynamic json) { + id = json["id"] ?? 0; + name = json["name"] ?? ""; + avatar = json["avatar"]; + email = json["email"] ?? ""; + emailVerifiedAt = json["email_verified_at"]; + googleId = json["google_id"]; + appleId = json["apple_id"]; + lastLoginIp = json["last_login_ip"] ?? ""; + lastLoginTime = json["last_login_time"] ?? ""; + lastUsedTime = json["last_used_time"]; + status = json["status"] ?? 0; + createdAt = json["created_at"] ?? ""; + updatedAt = json["updated_at"] ?? ""; + } +} + +class LoginDto { + String? accessToken; + UserInfo? userInfo; + + LoginDto({this.accessToken, this.userInfo}); + + Map toJson() { + final map = {}; + map["accessToken"] = accessToken; + if (userInfo != null) { + map["userInfo"] = userInfo?.toJson(); + } + return map; + } + + LoginDto.fromJson(dynamic json) { + accessToken = json["accessToken"] ?? ""; + userInfo = json["userInfo"] != null ? UserInfo.fromJson(json["userInfo"]) : null; + } +} diff --git a/lib/api/endpoints/user_api.dart b/lib/api/endpoints/user_api.dart new file mode 100644 index 0000000..c02ddcd --- /dev/null +++ b/lib/api/endpoints/user_api.dart @@ -0,0 +1,55 @@ + +import '../../data/models/other_login_type.dart'; +import '../dto/login_dto.dart'; +import '../network/request.dart'; + +///检查是否注册 +Future checkRegisterApi(String email) async { + var res = await Request().post("/auth/email_check", { + "email": email, + }); + if (res["next"] == "login") { + return true; + } + return false; +} + +///邮箱密码登陆 +Future loginApi(String email, String password) async { + var res = await Request().post("/auth/login/account", { + "email": email, + "password": password, + }); + return LoginDto.fromJson(res); +} + +///注册处 +Future registerApi(String email, String password, String code) async { + var res = await Request().post("/auth/register", { + "email": email, + "password": password, + "email_code": code, + }); + return LoginDto.fromJson(res); +} + +///发送邮箱验证码 +Future sendEmailCodeApi(String email) async { + return Request().post("/send_email_code", { + "email": email, + }); +} + +///三方登录 +Future thirdLoginApi(String token, OtherLoginType type) async { + var res = await Request().post("/auth/login/oauth", { + "login_token": token, + "login_type": type.value, + }); + return LoginDto.fromJson(res); +} + +///删除账号 +Future deleteAccountApi() async { + return Request().get("/delete_account"); +} diff --git a/lib/api/network/interceptor.dart b/lib/api/network/interceptor.dart new file mode 100644 index 0000000..60af27e --- /dev/null +++ b/lib/api/network/interceptor.dart @@ -0,0 +1,63 @@ +import 'package:dio/dio.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; + +import '../dto/base_dto.dart'; + +///请求拦截器 +void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, +) async { + // String token = await AppStore.getToken(); + // options.headers['Authorization'] = 'Bearer $token'; + return handler.next(options); +} + +///响应拦截器 +void onResponse( + Response response, + ResponseInterceptorHandler handler, +) { + var apiResponse = ApiDto.fromJson(response.data); + if (apiResponse.code == 1) { + response.data = apiResponse.data; + return handler.next(response); + } else { + showError(apiResponse.message); + handler.reject( + DioException( + requestOptions: response.requestOptions, + response: response, + error: {'code': 0, 'message': apiResponse.message}, + ), + ); + } +} + +///错误响应 +void onError( + DioException e, + ErrorInterceptorHandler handler, +) { + var title = ""; + if (e.type == DioExceptionType.connectionTimeout) { + title = "请求超时"; + } else if (e.type == DioExceptionType.badResponse) { + if (e.response?.statusCode == 404) { + title = "接口404不存在"; + } else { + title = "500"; + } + } else if (e.type == DioExceptionType.connectionError) { + title = "网络连接失败"; + } else { + title = "异常其他错误"; + } + showError(title); + handler.next(e); +} + +///显示错误信息 +void showError(String message) { + EasyLoading.showError(message); +} diff --git a/lib/api/network/request.dart b/lib/api/network/request.dart new file mode 100644 index 0000000..d3a23e0 --- /dev/null +++ b/lib/api/network/request.dart @@ -0,0 +1,46 @@ +import 'package:dio/dio.dart'; + +import '../../config/env.dart'; +import 'interceptor.dart'; + +class Request { + static final Request _instance = Request._internal(); + static Dio _dio = Dio(); + + //返回单例 + factory Request() { + return _instance; + } + + //初始化 + Request._internal() { + //创建基本配置 + final BaseOptions options = BaseOptions( + baseUrl: Config.baseUrl(), + connectTimeout: const Duration(seconds: 30), + receiveTimeout: const Duration(seconds: 30), + ); + + _dio = Dio(options); + + _dio.interceptors.add( + InterceptorsWrapper( + onRequest: onRequest, + onResponse: onResponse, + onError: onError, + ), + ); + } + + ///get请求 + Future get(String path, [Map? params]) async { + var res = await _dio.get(path, queryParameters: params); + return res.data; + } + + ///post请求 + Future post(String path, Object? data) async { + var res = await _dio.post(path, data: data); + return res.data; + } +} diff --git a/lib/api/network/safe.dart b/lib/api/network/safe.dart new file mode 100644 index 0000000..a52f424 --- /dev/null +++ b/lib/api/network/safe.dart @@ -0,0 +1,14 @@ +import 'package:dio/dio.dart'; + +/// 网络请求的错误处理封装 +Future safeRequest( + Future request, { + void Function(DioException error)? onError, +}) async { + try { + return await request; + } on DioException catch (e) { + onError?.call(e); // 额外 hook + rethrow; // 继续往上传 + } +} diff --git a/lib/config/app_context.dart b/lib/config/app_context.dart new file mode 100644 index 0000000..1f72ef7 --- /dev/null +++ b/lib/config/app_context.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; + +class AppContext { + static late BuildContext _context; + + AppContext._(); + + ///私有构造函数,防止外部实例化 + static void setContent(BuildContext context) { + _context = context; + } + + ///获取全局上下文 + static BuildContext get context => _context; + + ///获取主题 + static TextTheme get textTheme => Theme.of(_context).textTheme; + + static ColorScheme get colorScheme => Theme.of(_context).colorScheme; + + ///页面内间距 + static double get pagePadding => 15; +} diff --git a/lib/config/env.dart b/lib/config/env.dart new file mode 100644 index 0000000..d4a38cf --- /dev/null +++ b/lib/config/env.dart @@ -0,0 +1,19 @@ +///环境配置 +class Config { + Config._(); + + ///获取环境 + static String getEnv() { + const env = String.fromEnvironment('ENV', defaultValue: 'dev'); + return env; + } + + ///获取接口地址 + static String baseUrl() { + if (getEnv() == 'dev') { + return 'https://food-api.curain.ai/api'; + } else { + return 'https://food-api.curain.ai/api'; + } + } +} diff --git a/lib/config/theme/custom_colors.dart b/lib/config/theme/custom_colors.dart new file mode 100644 index 0000000..b34b74b --- /dev/null +++ b/lib/config/theme/custom_colors.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; + +///扩展颜色 +extension CustomColors on ColorScheme { + Color get success => const Color(0xff57be80); + + Color get warning => const Color(0xffff9800); + + Color get info => const Color(0xff909399); + + Color get danger => const Color(0xfff44545); + + Color get primaryEnd => const Color(0xff06b6d4); +} diff --git a/lib/config/theme/theme.dart b/lib/config/theme/theme.dart new file mode 100644 index 0000000..deeb287 --- /dev/null +++ b/lib/config/theme/theme.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; + +///颜色 +final scheme = ColorScheme.fromSeed( + primary: Color(0xff3784f1), + seedColor: Color(0xff3885f2), + brightness: Brightness.light, + //卡片色 + surface: Colors.white, + surfaceContainerLow: Color(0xFFF4F8FB), + surfaceContainer: Color(0xFFE9ECF3), + surfaceContainerHigh: Color(0xffbababa), + //颜色 + onSurfaceVariant: Color(0xFFBEBEBE), + + shadow: Color.fromRGBO(0, 0, 0, 0.1), +); + +///字体 +final textTheme = TextTheme( + titleLarge: TextStyle( + fontSize: 24, + fontWeight: FontWeight.w700, + color: scheme.onSurface, + letterSpacing: 0.5, + ), + titleMedium: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w700, + color: scheme.onSurface, + letterSpacing: 0.5, + ), + titleSmall: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + color: scheme.onSurface, + letterSpacing: 0.5, + ), + bodyLarge: TextStyle(fontSize: 18, letterSpacing: 0.5), + bodyMedium: TextStyle( + fontSize: 16, + letterSpacing: 0.5, + color: scheme.onSurface, + ), + bodySmall: TextStyle(fontSize: 14, letterSpacing: 0.5), + labelLarge: TextStyle(fontSize: 16, color: scheme.onSurfaceVariant, letterSpacing: 0.5), + labelMedium: TextStyle(fontSize: 14, color: scheme.onSurfaceVariant, letterSpacing: 0.5), + labelSmall: TextStyle(fontSize: 12, color: scheme.onSurfaceVariant, letterSpacing: 0.5), +); diff --git a/lib/data/local/storage.dart b/lib/data/local/storage.dart new file mode 100644 index 0000000..5e3916f --- /dev/null +++ b/lib/data/local/storage.dart @@ -0,0 +1,48 @@ +import 'dart:convert'; + +import 'package:shared_preferences/shared_preferences.dart'; + +class Storage { + //存储数据 + static Future set(String key, dynamic value) async { + SharedPreferences sp = await SharedPreferences.getInstance(); + if (value is String) { + sp.setString(key, value); + } else if (value is int) { + sp.setInt(key, value); + } else if (value is bool) { + sp.setBool(key, value); + } else if (value is double) { + sp.setDouble(key, value); + } else if (value is Map) { + String jsonStr = jsonEncode(value); + sp.setString(key, jsonStr); + } + } + + //获取数据 + static Future get(String key) async { + SharedPreferences sp = await SharedPreferences.getInstance(); + var value = sp.get(key); + if (value is String) { + try { + return jsonDecode(value); + } catch (e) { + return value; + } + } + return value; + } + + //删除数据 + static Future remove(key) async { + SharedPreferences sp = await SharedPreferences.getInstance(); + sp.remove(key); + } + + //判断键是否存在 + static Future hasKey(String key) async { + SharedPreferences sp = await SharedPreferences.getInstance(); + return sp.containsKey(key); + } +} diff --git a/lib/data/models/other_login_type.dart b/lib/data/models/other_login_type.dart new file mode 100644 index 0000000..299d316 --- /dev/null +++ b/lib/data/models/other_login_type.dart @@ -0,0 +1,8 @@ +enum OtherLoginType { + google('google'), + apple('apple'); + + const OtherLoginType(this.value); + + final String value; +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..5ae872e --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,62 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:plan/providers/app_store.dart'; +import 'package:plan/router/routes.dart'; +import 'package:provider/provider.dart'; + +import 'config/theme/theme.dart'; + +void main() { + runApp( + MultiProvider( + providers: [ + ChangeNotifierProvider(create: (context) => AppStore()), + ], + child: MyApp(), + ), + ); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return ScreenUtilInit( + designSize: const Size(375, 694), + useInheritedMediaQuery: true, + child: MaterialApp.router( + debugShowCheckedModeBanner: false, + routerConfig: goRouter, + localizationsDelegates: [], + themeMode: ThemeMode.light, + theme: ThemeData( + useMaterial3: true, + fontFamily: "NotoSansSC", + colorScheme: scheme, + elevatedButtonTheme: ElevatedButtonThemeData( + style: ElevatedButton.styleFrom( + backgroundColor: scheme.primary, + foregroundColor: scheme.onPrimary, + ), + ), + textTheme: textTheme, + scaffoldBackgroundColor: Color(0xffFAFAFE), + appBarTheme: AppBarTheme( + backgroundColor: scheme.surface, + scrolledUnderElevation: 0, + titleTextStyle: textTheme.titleSmall, + ), + cupertinoOverrideTheme: CupertinoThemeData( + textTheme: CupertinoTextThemeData( + primaryColor: Colors.black, + ), + ), + ), + builder: EasyLoading.init(), + ), + ); + } +} diff --git a/lib/page/home/home_page.dart b/lib/page/home/home_page.dart new file mode 100644 index 0000000..aa9c9ee --- /dev/null +++ b/lib/page/home/home_page.dart @@ -0,0 +1,60 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:remixicon/remixicon.dart'; + +import '../../router/config/route_paths.dart'; +import '../my/my_page.dart'; +import 'widget/plan_form_card.dart'; +import 'widget/quote_card.dart'; + +class HomePage extends StatefulWidget { + const HomePage({super.key}); + + @override + State createState() => _HomePageState(); +} + +class _HomePageState extends State { + final GlobalKey _scaffoldKey = GlobalKey(); + + @override + Widget build(BuildContext context) { + return Scaffold( + key: _scaffoldKey, + backgroundColor: Colors.white, + appBar: AppBar( + leading: IconButton( + onPressed: () { + _scaffoldKey.currentState?.openDrawer(); + }, + icon: Icon(RemixIcons.user_fill), + ), + actions: [ + IconButton( + color: Colors.black, + onPressed: () { + context.push(RoutePaths.planHistory); + }, + icon: Icon(RemixIcons.time_fill), + ), + ], + ), + body: ListView( + padding: EdgeInsets.symmetric(horizontal: 15), + children: [ + QuoteCard(), + PlanFormCard(), + ], + ), + drawer: Drawer( + backgroundColor: Colors.white, + width: double.infinity, + elevation: 0, + shape: RoundedRectangleBorder(), + child: MyPage( + scaffoldKey: _scaffoldKey, + ), + ), + ); + } +} diff --git a/lib/page/home/widget/plan_form_card.dart b/lib/page/home/widget/plan_form_card.dart new file mode 100644 index 0000000..57e4cfb --- /dev/null +++ b/lib/page/home/widget/plan_form_card.dart @@ -0,0 +1,93 @@ +import 'package:flutter/material.dart'; + +class PlanFormCard extends StatefulWidget { + const PlanFormCard({super.key}); + + @override + State createState() => _PlanFormCardState(); +} + +class _PlanFormCardState extends State { + final TextEditingController _inputController = TextEditingController(); + + @override + Widget build(BuildContext context) { + return Stack( + alignment: Alignment.topCenter, + children: [ + Positioned( + top: 56, + child: SizedBox( + height: 100, + child: Image.asset("assets/image/xiaozhi.png"), + ), + ), + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 40), + margin: EdgeInsets.only(top: 120), + decoration: BoxDecoration( + border: Border.all(color: Colors.black, width: 2), + borderRadius: BorderRadius.circular(5), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0xffb5b5b5), + blurRadius: 2, + offset: Offset(6, 6), + spreadRadius: 0, + blurStyle: BlurStyle.normal, + ), + ], + ), + child: Column( + children: [ + Container( + margin: EdgeInsets.only(bottom: 20), + child: Text("有什么事情你一直在拖延?"), + ), + TextField( + controller: _inputController, + style: Theme.of(context).textTheme.bodyMedium, + decoration: InputDecoration( + hintText: "我躺在床上听歌", + fillColor: Theme.of(context).colorScheme.surfaceContainerLow, + filled: true, + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + width: 1, + color: Theme.of(context).colorScheme.surfaceContainerHigh, + ), + borderRadius: BorderRadius.circular(5), + ), + border: OutlineInputBorder( + borderSide: BorderSide( + width: 1, + ), + borderRadius: BorderRadius.circular(5), + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 20), + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + border: Border.all(color: Colors.black, width: 1.5), + ), + child: Text( + "创建计划", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w700, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ), + ], + ), + ), + ], + ); + } +} diff --git a/lib/page/home/widget/quote_card.dart b/lib/page/home/widget/quote_card.dart new file mode 100644 index 0000000..096f371 --- /dev/null +++ b/lib/page/home/widget/quote_card.dart @@ -0,0 +1,60 @@ +import 'package:flutter/material.dart'; +import 'package:remixicon/remixicon.dart'; + +class QuoteCard extends StatefulWidget { + const QuoteCard({super.key}); + + @override + State createState() => _QuoteCardState(); +} + +class _QuoteCardState extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(top: 20), + padding: const EdgeInsets.all(3), + decoration: BoxDecoration( + border: Border.all(color: Colors.black, width: 2), + borderRadius: BorderRadius.circular(5), + ), + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + border: Border.all( + width: 2, + color: Theme.of(context).colorScheme.surfaceContainerHigh, + ), + borderRadius: BorderRadius.circular(5), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "每个教练都有什么特长?", + style: Theme.of(context).textTheme.titleSmall, + ), + Container( + margin: EdgeInsets.only(top: 10), + child: Text( + "在主页点击教练可以查看介绍", + style: Theme.of(context).textTheme.labelMedium, + ), + ), + Container( + margin: EdgeInsets.only(top: 10), + child: Row( + spacing: 5, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(RemixIcons.arrow_right_circle_line, size: 18), + Text("下一条", style: Theme.of(context).textTheme.bodySmall), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/page/my/my_page.dart b/lib/page/my/my_page.dart new file mode 100644 index 0000000..b5ba0f6 --- /dev/null +++ b/lib/page/my/my_page.dart @@ -0,0 +1,42 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:remixicon/remixicon.dart'; + +import 'widget/avatar_name.dart'; +import 'widget/profile_section.dart'; + +class MyPage extends StatefulWidget { + final GlobalKey scaffoldKey; + + const MyPage({super.key, required this.scaffoldKey}); + + @override + State createState() => _MyPageState(); +} + +class _MyPageState extends State { + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + backgroundColor: Colors.white, + navigationBar: CupertinoNavigationBar( + middle: Text("个人资料"), + leading: IconButton( + onPressed: () { + widget.scaffoldKey.currentState?.closeDrawer(); + }, + icon: Icon(RemixIcons.close_circle_line, size: 25), + ), + ), + child: SafeArea( + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 30, vertical: 20), + children: [ + AvatarName(), + ProfileSection(), + ], + ), + ), + ); + } +} diff --git a/lib/page/my/widget/avatar_name.dart b/lib/page/my/widget/avatar_name.dart new file mode 100644 index 0000000..e9d9ce2 --- /dev/null +++ b/lib/page/my/widget/avatar_name.dart @@ -0,0 +1,112 @@ +import 'package:flutter/material.dart'; +import 'package:remixicon/remixicon.dart'; + +class AvatarName extends StatefulWidget { + const AvatarName({super.key}); + + @override + State createState() => _AvatarNameState(); +} + +class _AvatarNameState extends State { + //输入口 + final TextEditingController _inputController = TextEditingController(); + final FocusNode _focusNode = FocusNode(); + bool _isEdit = false; + + ///开始编辑 + void _handleEdit() { + setState(() { + _isEdit = true; + }); + WidgetsBinding.instance.addPostFrameCallback((_) { + _focusNode.requestFocus(); + }); + } + + ///确定编辑内容 + void _confirmEdit(String value) { + setState(() { + _isEdit = false; + }); + } + + @override + Widget build(BuildContext context) { + return Row( + spacing: 15, + children: [ + Container( + width: 80, + height: 80, + decoration: BoxDecoration( + color: Color(0xffcae2fd), + border: Border.all( + color: Color(0xff797e80), + width: 2, + ), + borderRadius: BorderRadius.circular(5), + ), + alignment: Alignment.center, + child: Container( + width: 50, + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Color(0xff8e8d93), + borderRadius: BorderRadius.circular(5), + ), + child: Icon( + RemixIcons.user_fill, + color: Color(0xffcae2fd), + ), + ), + ), + Expanded( + child: Visibility( + visible: _isEdit, + replacement: InkWell( + onTap: _handleEdit, + child: Row( + spacing: 10, + children: [ + Text( + "教练如何称呼你?", + style: Theme.of(context).textTheme.labelMedium, + ), + Icon( + RemixIcons.pencil_fill, + size: 18, + color: Theme.of(context).textTheme.labelMedium?.color, + ), + ], + ), + ), + child: TextField( + focusNode: _focusNode, + controller: _inputController, + style: TextStyle(fontSize: 14), + decoration: InputDecoration( + hintText: "输入你的姓名", + isCollapsed: true, + contentPadding: EdgeInsets.symmetric(vertical: 8, horizontal: 10), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + width: 1, + color: Theme.of(context).colorScheme.surfaceContainerHigh, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + width: 1, + color: Theme.of(context).colorScheme.surfaceContainerHigh, + ), + ), + ), + onSubmitted: _confirmEdit, + ), + ), + ), + ], + ); + } +} diff --git a/lib/page/my/widget/profile_section.dart b/lib/page/my/widget/profile_section.dart new file mode 100644 index 0000000..4926916 --- /dev/null +++ b/lib/page/my/widget/profile_section.dart @@ -0,0 +1,87 @@ +import 'package:flutter/material.dart'; +import 'package:remixicon/remixicon.dart'; + +class ProfileSection extends StatefulWidget { + const ProfileSection({super.key}); + + @override + State createState() => _ProfileSectionState(); +} + +class _ProfileSectionState extends State { + //输入框 + final TextEditingController _inputController = TextEditingController(); + + final List _tips = ["教练每次为你制定计划时,都会首先参考这里的信息", "你分享的背景信息越详细,教练就越能为你量身定制,符合你独特情况的行动步骤", "你可以在这里为教练提需求,比如“我不吃香菜”"]; + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(top: 30), + padding: EdgeInsets.only(top: 30), + decoration: BoxDecoration( + border: Border( + top: BorderSide( + width: 1, + color: Theme.of(context).colorScheme.surfaceContainer, + ), + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(bottom: 20), + child: Text("你的画像"), + ), + Container( + margin: EdgeInsets.only(bottom: 20), + child: TextField( + maxLines: 5, + maxLength: 200, + controller: _inputController, + style: TextStyle(fontSize: 14, letterSpacing: 1), + decoration: InputDecoration( + hintText: "我是19岁女生,刷碗时用洗碗机,请不要按手洗拆解步骤..", + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey), // 普通状态 + borderRadius: BorderRadius.circular(8), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey), // 获取焦点状态 + borderRadius: BorderRadius.circular(8), + ), + ), + ), + ), + ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (_, index) { + return Row( + spacing: 10, + children: [ + Icon( + RemixIcons.lightbulb_flash_fill, + color: Color(0xfff2a529), + size: 18, + ), + Expanded( + child: Text( + _tips[index], + style: Theme.of(context).textTheme.labelMedium, + ), + ), + ], + ); + }, + separatorBuilder: (_, __) { + return SizedBox(height: 10); + }, + itemCount: _tips.length, + ), + ], + ), + ); + } +} diff --git a/lib/page/plan/detail/plan_detail_page.dart b/lib/page/plan/detail/plan_detail_page.dart new file mode 100644 index 0000000..285fd49 --- /dev/null +++ b/lib/page/plan/detail/plan_detail_page.dart @@ -0,0 +1,29 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:remixicon/remixicon.dart'; + +class PlanDetailPage extends StatefulWidget { + const PlanDetailPage({super.key}); + + @override + State createState() => _PlanDetailPageState(); +} + +class _PlanDetailPageState extends State { + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + backgroundColor: Colors.white, + navigationBar: CupertinoNavigationBar( + middle: Text('计划详情'), + trailing: Row( + mainAxisSize: MainAxisSize.min, // 关键:Row 只占实际内容宽度 + children: [ + Icon(RemixIcons.more_fill), + ], + ), + ), + child: Column(), + ); + } +} diff --git a/lib/page/plan/history/plan_history_page.dart b/lib/page/plan/history/plan_history_page.dart new file mode 100644 index 0000000..be79d41 --- /dev/null +++ b/lib/page/plan/history/plan_history_page.dart @@ -0,0 +1,112 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'widgets/history_item.dart'; +import 'widgets/popup_action.dart'; + +class PlanHistoryPage extends StatefulWidget { + const PlanHistoryPage({super.key}); + + @override + State createState() => _PlanHistoryPageState(); +} + +class _PlanHistoryPageState extends State { + ///是否显示删除 + bool _isDelete = false; + + ///刷新 + Future _onRefresh() async { + //模拟网络请求 + await Future.delayed(Duration(milliseconds: 1000)); + //结束刷新 + return Future.value(true); + } + + ///popup事件 + void _onPopupActionSelected(String value) { + switch (value) { + case 'edit': + setState(() { + _isDelete = !_isDelete; + }); + break; + } + } + + ///确认删除 + void _confirmDelete(int id) {} + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + backgroundColor: Theme.of(context).colorScheme.surfaceContainer, + navigationBar: CupertinoNavigationBar( + middle: Text("计划历史"), + trailing: CupertinoNavigationBar( + transitionBetweenRoutes: false, + middle: const Text("计划历史"), + trailing: PopupAction( + onSelected: _onPopupActionSelected, + items: [ + PopupMenuItem( + value: 'edit', + child: Text( + _isDelete ? "完成" : "编辑", + style: TextStyle(color: Colors.black), + ), + ), + ], + ), + ), + ), + child: SafeArea( + child: CustomScrollView( + physics: AlwaysScrollableScrollPhysics( + parent: BouncingScrollPhysics(), + ), + slivers: [ + //下拉刷新组件 + CupertinoSliverRefreshControl( + onRefresh: _onRefresh, + ), + //列表 + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.all(15), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + ), + child: CustomScrollView( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + slivers: [ + SliverList.separated( + itemBuilder: (BuildContext context, int index) { + return HistoryItem( + showDelete: _isDelete, + onDelete: _confirmDelete, + ); + }, + separatorBuilder: (BuildContext context, int index) { + return Divider( + height: 1, + color: Theme.of(context).colorScheme.surfaceContainer, + ); + }, + itemCount: 5, + ), + ], + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/page/plan/history/widgets/history_item.dart b/lib/page/plan/history/widgets/history_item.dart new file mode 100644 index 0000000..fd43ecd --- /dev/null +++ b/lib/page/plan/history/widgets/history_item.dart @@ -0,0 +1,161 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:plan/router/config/route_paths.dart'; +import 'package:remixicon/remixicon.dart'; + +class HistoryItem extends StatefulWidget { + final bool showDelete; + final Function(int) onDelete; + + const HistoryItem({ + super.key, + this.showDelete = false, + required this.onDelete, + }); + + @override + State createState() => _HistoryItemState(); +} + +class _HistoryItemState extends State with TickerProviderStateMixin { + late AnimationController _controller; + late Animation _animation; + + @override + void initState() { + super.initState(); + _controller = AnimationController( + vsync: this, + duration: Duration(milliseconds: 300), + ); + _animation = CurvedAnimation( + parent: _controller, + curve: Curves.easeInOut, + ); + + if (widget.showDelete) { + _controller.forward(); + } + } + + @override + void didUpdateWidget(covariant HistoryItem oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.showDelete != widget.showDelete) { + if (widget.showDelete) { + _controller.forward(); + } else { + _controller.reverse(); + } + } + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + ///点击删除 + void _handleDelete() { + showCupertinoDialog( + context: context, + builder: (_) { + return CupertinoAlertDialog( + title: Text("删除计划"), + actions: [ + CupertinoDialogAction( + child: Text("取消"), + onPressed: () { + context.pop(); + }, + ), + CupertinoDialogAction( + isDestructiveAction: true, + onPressed: () { + context.pop(); + widget.onDelete(0); + }, + child: Text("确定"), + ), + ], + ); + }, + ); + } + + ///跳转详情 + void _goDetail() { + context.push(RoutePaths.planDetail); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: _goDetail, + child: Container( + width: double.infinity, + padding: EdgeInsets.symmetric(vertical: 15), + color: Colors.white, + child: Row( + children: [ + SizeTransition( + axis: Axis.horizontal, + sizeFactor: _animation, + axisAlignment: -1, // 从左向右展开 + child: InkWell( + onTap: _handleDelete, + child: Container( + margin: EdgeInsets.only(right: 10), + child: Icon( + RemixIcons.indeterminate_circle_fill, + color: Colors.red, + ), + ), + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(bottom: 5), + child: Text("开始学习软件开发"), + ), + Container( + margin: EdgeInsets.only(bottom: 5), + child: Text( + "创建于 2025/9/3 9:40:51 教练:W教练", + style: Theme.of(context).textTheme.labelSmall, + ), + ), + Row( + spacing: 10, + children: [ + Expanded( + child: LinearProgressIndicator( + value: 0.5, + borderRadius: BorderRadius.circular(5), + ), + ), + Text( + "0/7", + style: Theme.of(context).textTheme.labelSmall, + ), + ], + ), + ], + ), + ), + Icon( + RemixIcons.arrow_right_s_line, + size: 30, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ], + ), + ), + ); + } +} diff --git a/lib/page/plan/history/widgets/popup_action.dart b/lib/page/plan/history/widgets/popup_action.dart new file mode 100644 index 0000000..dfd6665 --- /dev/null +++ b/lib/page/plan/history/widgets/popup_action.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; +import 'package:remixicon/remixicon.dart'; + +class PopupAction extends StatelessWidget { + final List> items; + final Function(String) onSelected; + + const PopupAction({ + super.key, + required this.items, + required this.onSelected, + }); + + @override + Widget build(BuildContext context) { + return PopupMenuButton( + color: Colors.white, + offset: Offset(0, 30), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), // 圆角 + ), + constraints: BoxConstraints( + minWidth: 200, + ), + elevation: 6, + shadowColor: Colors.black87, + onSelected:onSelected, + itemBuilder: (context) => items, + child: const Icon(RemixIcons.more_fill), + ); + } +} diff --git a/lib/page/system/agree/agree_page.dart b/lib/page/system/agree/agree_page.dart new file mode 100644 index 0000000..eff5819 --- /dev/null +++ b/lib/page/system/agree/agree_page.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:webview_flutter/webview_flutter.dart'; + +class AgreePage extends StatelessWidget { + final String title; + final String url; + + const AgreePage({super.key, required this.title, required this.url}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(title), + ), + body: WebViewWidget( + controller: WebViewController() + ..setJavaScriptMode(JavaScriptMode.unrestricted) + ..loadRequest(Uri.parse(url)), + ), + ); + } +} diff --git a/lib/page/system/login/login_code_page.dart b/lib/page/system/login/login_code_page.dart new file mode 100644 index 0000000..96d416c --- /dev/null +++ b/lib/page/system/login/login_code_page.dart @@ -0,0 +1,115 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:go_router/go_router.dart'; +import 'package:provider/provider.dart'; + +import '../../../api/endpoints/user_api.dart'; +import '../../../api/network/safe.dart'; +import '../../../providers/app_store.dart'; +import '../../../router/config/route_paths.dart'; +import '../../../widgets/ui_kit/button/custom_button.dart'; +import 'widget/widget.dart'; + +class LoginCodePage extends StatefulWidget { + final String email; + final String password; + + const LoginCodePage({super.key, required this.email, required this.password}); + + @override + State createState() => _LoginCodePageState(); +} + +class _LoginCodePageState extends State { + final _codeController = TextEditingController(); + var _subLoading = false; + + @override + void initState() { + super.initState(); + _handSendCode(); + } + + ///发送验证码 + void _handSendCode() { + sendEmailCodeApi(widget.email); + EasyLoading.showSuccess("Send success"); + } + + ///提交 + void _handSubmit() async { + if (_codeController.text.isNotEmpty) { + setState(() { + _subLoading = true; + }); + var res = await safeRequest( + registerApi( + widget.email, + widget.password, + _codeController.text, + ), + onError: (error) { + setState(() { + _subLoading = false; + }); + }, + ); + var appStore = context.read(); + await appStore.setInfo(res); + context.go(RoutePaths.layout); + setState(() { + _subLoading = false; + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SafeArea( + child: Container( + width: double.infinity, + padding: EdgeInsets.only(left: 20, right: 20, top: 40), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "Check your inbox", + style: Theme.of(context).textTheme.titleLarge, + ), + Container( + margin: EdgeInsets.only(top: 20, bottom: 40), + child: Text( + "Enter the verification code we just sent to ${widget.email}.", + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.labelMedium, + ), + ), + InputBox(hintText: "Code", controller: _codeController), + Container( + margin: EdgeInsets.only(top: 20), + child: CustomButton( + loading: _subLoading, + onPressed: _handSubmit, + child: Text("Continue"), + ), + ), + Container( + margin: EdgeInsets.only(top: 20), + child: TextButton( + onPressed: () { + _handSendCode(); + }, + child: Text( + "Resend code", + style: Theme.of(context).textTheme.labelSmall, + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/page/system/login/login_page.dart b/lib/page/system/login/login_page.dart new file mode 100644 index 0000000..f70941d --- /dev/null +++ b/lib/page/system/login/login_page.dart @@ -0,0 +1,257 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:go_router/go_router.dart'; +import 'package:google_sign_in/google_sign_in.dart'; +import 'package:plan/data/models/other_login_type.dart'; +import 'package:provider/provider.dart'; +import 'package:remixicon/remixicon.dart'; +import 'package:sign_in_with_apple/sign_in_with_apple.dart'; +import '../../../api/endpoints/user_api.dart'; +import '../../../providers/app_store.dart'; +import '../../../router/config/route_paths.dart'; +import '../../../utils/common.dart'; +import '../../../widgets/ui_kit/button/custom_button.dart'; +import 'widget/agreement_box.dart'; +import 'widget/widget.dart'; + +class LoginPage extends StatefulWidget { + const LoginPage({super.key}); + + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + var _subLoading = false; + + ///协议 + bool _agree = false; + + ///谷歌登陆 + final GoogleSignIn _googleSignIn = GoogleSignIn.instance; + + ///邮箱输入框 + final TextEditingController _emailController = TextEditingController(text: ""); + final TextEditingController _passwordController = TextEditingController(text: ""); + + //显示密码 + var _hidePassword = true; + + @override + void initState() { + super.initState(); + _ensureNetworkPermission(); + _initGoogleSign(); + } + + /// 预触发 iOS 网络权限弹窗 + Future _ensureNetworkPermission() async { + try { + await Dio().get( + 'https://captive.apple.com/hotspot-detect.html', + options: Options(sendTimeout: const Duration(seconds: 3), receiveTimeout: const Duration(seconds: 3), headers: {'Cache-Control': 'no-cache'}), + ); + return true; + } catch (_) { + return false; + } + } + + void _initGoogleSign() { + if (isAndroid()) { + _googleSignIn.initialize(clientId: null, serverClientId: "512878764950-0bsl98c4q4p695mlmfn35qhmr2ld5n0o.apps.googleusercontent.com"); + } else { + _googleSignIn.initialize( + clientId: "512878764950-1ke7slf0c6dlmchnuk0fqh3fe954gcf2.apps.googleusercontent.com", + serverClientId: "512878764950-0bsl98c4q4p695mlmfn35qhmr2ld5n0o.apps.googleusercontent.com", + ); + } + + _googleSignIn.authenticationEvents + .listen((_) { + print("登陆成功"); + }) + .onError((error) { + print('登录错误: $error'); + }); + } + + ///谷歌登录 + void _handleGoogleSignIn() async { + if (!_agree) { + EasyLoading.showToast('Please read and agree to the terms first.'); + return; + } + + try { + // 如果用户未登录,则启动标准的 Google 登录 + if (_googleSignIn.supportsAuthenticate()) { + // 使用 authenticate() 进行认证 + GoogleSignInAccount? user = await _googleSignIn.authenticate(); + var auth = user.authentication; + + // var res = await Dio().get("https://oauth2.googleapis.com/tokeninfo?id_token=${auth.idToken}"); + //登陆 + EasyLoading.show(status: "Logging in..."); + var res = await thirdLoginApi(auth.idToken!, OtherLoginType.google); + EasyLoading.dismiss(); + _onLogin(res); + } + // } catch (e) { + // if (e is GoogleSignInException) { + // if (e.code == GoogleSignInExceptionCode.canceled) { + // // 用户取消登录 + // print("User canceled login."); + // } else { + // // 其他错误 + // print("Google Sign-In error: $e"); + // } + // } else { + // print("Unknown error: $e"); + // } + // } + } catch (e) { + EasyLoading.showError("Login failed"); + print("登录错误: $e"); + } + } + + ///apple登录 + void _handAppleSignIn() async { + if (!_agree) { + EasyLoading.showToast('Please read and agree to the terms first.'); + return; + } + + try { + final credential = await SignInWithApple.getAppleIDCredential(scopes: [AppleIDAuthorizationScopes.email, AppleIDAuthorizationScopes.fullName]); + EasyLoading.show(status: "Logging in..."); + var res = await thirdLoginApi(credential.identityToken!, OtherLoginType.apple); + EasyLoading.dismiss(); + _onLogin(res); + print('Apple Credential: ${credential.identityToken}'); + print('Apple Email: ${credential.email}'); + } catch (e) { + print('Error during Apple sign-in: $e'); + } + } + + void _handSubmit() async { + if (!_agree) { + EasyLoading.showToast('Please read and agree to the terms first.'); + return; + } + if (_emailController.text.isEmpty) { + //请输入邮箱 + EasyLoading.showError("Please enter your email"); + return; + } else if (_passwordController.text.isEmpty) { + EasyLoading.showError("Please enter your Password"); + return; + } + + try { + setState(() { + _subLoading = true; + }); + var isRegister = await checkRegisterApi(_emailController.text); + if (!isRegister) { + context.push(RoutePaths.loginCode, extra: {"email": _emailController.text, "password": _passwordController.text}); + } else { + var res = await loginApi(_emailController.text, _passwordController.text); + _onLogin(res); + } + setState(() { + _subLoading = false; + }); + } catch (e) { + setState(() { + _subLoading = false; + }); + } + } + + ///登陆的操作 + void _onLogin(dynamic res) { + var appStore = context.read(); + appStore.setInfo(res); + context.go(RoutePaths.layout); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusScope.of(context).unfocus(), + child: Scaffold( + resizeToAvoidBottomInset: false, + body: SafeArea( + child: Container( + width: double.infinity, + padding: EdgeInsets.only(top: 0.07.sh, left: 20, right: 20), + child: ListView( + children: [ + LogoBox(), + PageHeader(), + InputBox(hintText: "Email", controller: _emailController), + SizedBox(height: 15), + InputBox( + obscureText: _hidePassword, + hintText: "Password", + controller: _passwordController, + suffix: InkWell( + onTap: () { + setState(() { + _hidePassword = !_hidePassword; + }); + }, + child: Icon( + _hidePassword ? RemixIcons.eye_off_fill : RemixIcons.eye_fill, + size: 20, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 20), + height: 45, + child: CustomButton(loading: _subLoading, round: false, onPressed: _handSubmit, child: Text("Continue")), + ), + LoginDivider(), + OtherButton( + title: "Continue with Google", + icon: "assets/image/google.png", + onTap: () { + _handleGoogleSignIn(); + }, + ), + SizedBox(height: 15), + OtherButton( + title: "Continue with Apple", + icon: "assets/image/apple.png", + onTap: () { + _handAppleSignIn(); + }, + ), + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 40), + alignment: Alignment.center, + child: AgreementBox( + checked: _agree, + onChanged: (value) { + setState(() { + _agree = value; + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/page/system/login/widget/agreement_box.dart b/lib/page/system/login/widget/agreement_box.dart new file mode 100644 index 0000000..29d7a7d --- /dev/null +++ b/lib/page/system/login/widget/agreement_box.dart @@ -0,0 +1,73 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; + +import '../../../../router/config/route_paths.dart'; + +///勾中协议 +class AgreementBox extends StatelessWidget { + final bool checked; + final Function(bool) onChanged; + + const AgreementBox({ + super.key, + this.checked = false, + required this.onChanged, + }); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 25, + child: Transform.scale( + scale: 0.8, + child: Checkbox( + value: checked, + shape: CircleBorder(), + onChanged: (value) { + onChanged(value!); + }, + ), + ), + ), + GestureDetector( + onTap: () { + onChanged(!checked); + }, + child: RichText( + text: TextSpan( + style: Theme.of(context).textTheme.labelSmall, + children: [ + TextSpan( + text: "I agree to the ", + ), + TextSpan( + text: "Terms", + style: TextStyle(color: Theme.of(context).primaryColor), + recognizer: TapGestureRecognizer() + ..onTap = () => context.push( + RoutePaths.agreement, + extra: {"title": "Terms of Service", "url": "https://support.curain.ai/privacy/foodcura/terms_service.html"}, + ), + ), + TextSpan(text: " & "), + TextSpan( + text: "Privacy Policy", + style: TextStyle(color: Theme.of(context).primaryColor), + recognizer: TapGestureRecognizer() + ..onTap = () => context.push( + RoutePaths.agreement, + extra: {"title": "Privacy", "url": "https://support.curain.ai/privacy/foodcura/privacy_policy.html"}, + ), + ), + ], + ), + ), + ), + ], + ); + } +} diff --git a/lib/page/system/login/widget/widget.dart b/lib/page/system/login/widget/widget.dart new file mode 100644 index 0000000..cf8f757 --- /dev/null +++ b/lib/page/system/login/widget/widget.dart @@ -0,0 +1,166 @@ +import 'package:flutter/material.dart'; + +///登陆Box +class LogoBox extends StatelessWidget { + const LogoBox({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(bottom: 40), + child: Column( + children: [ + Image.asset( + "assets/image/logo.png", + width: 43, + ), + Text( + "FoodCura", + style: Theme.of(context).textTheme.titleSmall, + ), + ], + ), + ); + } +} + +///头部文案 +class PageHeader extends StatelessWidget { + const PageHeader({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(bottom: 30), + child: Column( + children: [ + Text( + "Create an account", + style: TextStyle(fontWeight: FontWeight.w700), + ), + Text( + "Use your email to get started", + style: Theme.of(context).textTheme.bodySmall, + ), + ], + ), + ); + } +} + +///输入框 +class InputBox extends StatelessWidget { + final bool obscureText; + final String hintText; + final TextEditingController controller; + final Widget? suffix; + + const InputBox({ + super.key, + this.obscureText = false, + required this.hintText, + required this.controller, + this.suffix, + }); + + @override + Widget build(BuildContext context) { + //边框 + var inputBorder = OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide( + color: Theme.of(context).colorScheme.surfaceContainer, + ), + ); + return TextField( + controller: controller, + maxLength: 100, + obscureText: obscureText, + style: Theme.of(context).textTheme.bodyMedium, + decoration: InputDecoration( + hintText: hintText, + hintStyle: Theme.of(context).textTheme.labelMedium, + counterText: '', + border: inputBorder, + enabledBorder: inputBorder, + suffix: suffix, + suffixIconConstraints: BoxConstraints( + minWidth: 0, + minHeight: 0, + ), + ), + ); + } +} + +///分割线 +class LoginDivider extends StatelessWidget { + const LoginDivider({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(top: 20, bottom: 20), + child: Row( + spacing: 8, + children: [ + Expanded( + child: Container( + height: 1, + color: Theme.of(context).colorScheme.surfaceContainer, + ), + ), + Text( + "or", + style: Theme.of(context).textTheme.labelMedium, + ), + Expanded( + child: Container( + height: 1, + color: Theme.of(context).colorScheme.surfaceContainer, + ), + ), + ], + ), + ); + } +} + +///其他登陆按钮 +class OtherButton extends StatelessWidget { + final Function() onTap; + final String title; + final String icon; + + const OtherButton({ + super.key, + required this.onTap, + required this.title, + required this.icon, + }); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Container( + padding: EdgeInsets.all(15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Theme.of(context).colorScheme.surfaceContainer, + ), + child: Row( + spacing: 10, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset(icon, width: 20), + Text( + title, + style: Theme.of(context).textTheme.bodySmall, + ), + ], + ), + ), + ); + } +} diff --git a/lib/page/system/splash/splash_page.dart b/lib/page/system/splash/splash_page.dart new file mode 100644 index 0000000..d3ee0d6 --- /dev/null +++ b/lib/page/system/splash/splash_page.dart @@ -0,0 +1,65 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:go_router/go_router.dart'; +import 'package:provider/provider.dart'; + +import '../../../config/app_context.dart'; +import '../../../providers/app_store.dart'; +import '../../../router/config/route_paths.dart'; +import '../../../router/routes.dart'; + +class SplashPage extends StatefulWidget { + const SplashPage({super.key}); + + @override + State createState() => _SplashPageState(); +} + +class _SplashPageState extends State { + @override + void initState() { + super.initState(); + init(); + } + + void init() { + WidgetsBinding.instance.addPostFrameCallback((_) async { + AppContext.setContent(navigatorKey.currentState!.context); + //效验 + AppStore appStore = context.read(); + await appStore.init(); + if (!mounted) return; + if (appStore.token.isEmpty) { + context.go(RoutePaths.login); + } else { + context.go(RoutePaths.layout); + } + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SizedBox( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/logo.png", + width: 68.w, + ), + Container( + margin: EdgeInsets.only(top: 16), + child: Text( + "Demacare", + style: Theme.of(context).textTheme.titleMedium, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/providers/app_store.dart b/lib/providers/app_store.dart new file mode 100644 index 0000000..bb8a043 --- /dev/null +++ b/lib/providers/app_store.dart @@ -0,0 +1,46 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import '../api/dto/login_dto.dart'; +import '../data/local/storage.dart'; + +class AppStore with ChangeNotifier { + ///用户信息 + UserInfo? userInfo; + + ///token + String token = ''; + + //初始化 + Future init() async { + token = await getToken(); + var userInfoStorage = await Storage.get('userInfo'); + if (userInfoStorage != null) { + userInfo = UserInfo.fromJson(await Storage.get('userInfo')); + } + + notifyListeners(); + } + + ///设置用户数据 + Future setInfo(LoginDto data) async { + token = data.accessToken!; + userInfo = data.userInfo; + + await Storage.set('userInfo', userInfo?.toJson()); + await Storage.set('token', token); + } + + ///获取token + static Future getToken() async { + return await Storage.get("token") ?? ''; + } + + ///退出登录 + Future logout() async { + await Storage.remove('token'); + await Storage.remove('userInfo'); + token = ''; + userInfo = null; + notifyListeners(); + } +} diff --git a/lib/router/config/route_paths.dart b/lib/router/config/route_paths.dart new file mode 100644 index 0000000..0cdcf2b --- /dev/null +++ b/lib/router/config/route_paths.dart @@ -0,0 +1,24 @@ +class RoutePaths { + RoutePaths._(); + + ///闪烁页 + static const splash = "/"; + + ///协议页 + static const agreement = "/agreement"; + + ///登录 + static const login = "/login"; + + ///登陆验证码 + static const loginCode = "/loginCode"; + + ///首页 + static const layout = "/layout"; + + ///计划历史页 + static const planHistory = "/planHistory"; + + ///计划详情页 + static const planDetail = "/planDetail"; +} diff --git a/lib/router/config/route_type.dart b/lib/router/config/route_type.dart new file mode 100644 index 0000000..77f8617 --- /dev/null +++ b/lib/router/config/route_type.dart @@ -0,0 +1,16 @@ +import 'dart:async'; + +import 'package:flutter/cupertino.dart'; +import 'package:go_router/go_router.dart'; + +class RouteType { + String path; + FutureOr Function(BuildContext, GoRouterState)? redirect; + Widget Function(GoRouterState) child; + + RouteType({ + required this.path, + required this.child, + this.redirect, + }); +} diff --git a/lib/router/modules/base.dart b/lib/router/modules/base.dart new file mode 100644 index 0000000..97d2f5c --- /dev/null +++ b/lib/router/modules/base.dart @@ -0,0 +1,43 @@ +import 'package:plan/page/home/home_page.dart'; + +import '../../page/system/agree/agree_page.dart'; +import '../../page/system/login/login_code_page.dart'; +import '../../page/system/login/login_page.dart'; +import '../../page/system/splash/splash_page.dart'; +import '../config/route_paths.dart'; +import '../config/route_type.dart'; + +List baseRoutes = [ + RouteType( + path: RoutePaths.splash, + child: (state) { + return SplashPage(); + }, + ), + RouteType( + path: RoutePaths.agreement, + child: (state) { + final extra = state.extra as Map; + return AgreePage(title: extra['title'] ?? "", url: extra['url'] ?? ""); + }, + ), + RouteType( + path: RoutePaths.login, + child: (state) { + return LoginPage(); + }, + ), + RouteType( + path: RoutePaths.loginCode, + child: (state) { + final args = state.extra as Map; + return LoginCodePage(email: args['email'], password: args['password']); + }, + ), + RouteType( + path: RoutePaths.layout, + child: (state) { + return HomePage(); + }, + ), +]; diff --git a/lib/router/modules/plan.dart b/lib/router/modules/plan.dart new file mode 100644 index 0000000..b043260 --- /dev/null +++ b/lib/router/modules/plan.dart @@ -0,0 +1,19 @@ +import 'package:plan/page/plan/detail/plan_detail_page.dart'; +import 'package:plan/page/plan/history/plan_history_page.dart'; +import 'package:plan/router/config/route_paths.dart'; +import 'package:plan/router/config/route_type.dart'; + +List planRoutes = [ + RouteType( + path: RoutePaths.planHistory, + child: (state) { + return PlanHistoryPage(); + }, + ), + RouteType( + path: RoutePaths.planDetail, + child: (state) { + return PlanDetailPage(); + }, + ), +]; diff --git a/lib/router/routes.dart b/lib/router/routes.dart new file mode 100644 index 0000000..332e8e1 --- /dev/null +++ b/lib/router/routes.dart @@ -0,0 +1,28 @@ +import 'package:flutter/cupertino.dart'; +import 'package:go_router/go_router.dart'; + +import 'modules/base.dart'; +import 'config/route_paths.dart'; +import 'config/route_type.dart'; +import 'modules/plan.dart'; + +GlobalKey navigatorKey = GlobalKey(); + +List routeConfigs = [...baseRoutes,...planRoutes]; + +//for循环遍历 +List routes = routeConfigs.map((item) { + return GoRoute( + path: item.path, + builder: (context, state) { + return item.child(state); + }, + ); +}).toList(); + +//变量命名 +GoRouter goRouter = GoRouter( + initialLocation: RoutePaths.layout, + routes: routes, + navigatorKey: navigatorKey, +); diff --git a/lib/utils/common.dart b/lib/utils/common.dart new file mode 100644 index 0000000..22f9b8d --- /dev/null +++ b/lib/utils/common.dart @@ -0,0 +1,14 @@ +import 'dart:io'; + +///判断是否是安卓 +bool isAndroid() { + return Platform.isAndroid; +} + +/// 获取非空的值 +String? getNotEmpty(String? value) { + if (value != null && value.isNotEmpty) { + return value; + } + return null; +} diff --git a/lib/utils/format.dart b/lib/utils/format.dart new file mode 100644 index 0000000..9f1080e --- /dev/null +++ b/lib/utils/format.dart @@ -0,0 +1,35 @@ +/// 格式化日期时间 +String formatDateUS(dynamic date, [String format = 'MM/DD/YYYY hh:mm:ss a']) { + DateTime dateTime; + + if (date is String) { + dateTime = DateTime.tryParse(date) ?? DateTime.now(); + } else if (date is DateTime) { + dateTime = date; + } else { + dateTime = DateTime.now(); + } + + final yyyy = dateTime.year.toString(); + final MM = dateTime.month.toString().padLeft(2, '0'); + final dd = dateTime.day.toString().padLeft(2, '0'); + + // 12小时制 + final hour12 = (dateTime.hour % 12 == 0 ? 12 : dateTime.hour % 12).toString().padLeft(2, '0'); + final HH = dateTime.hour.toString().padLeft(2, '0'); // 24小时制备用 + final mm = dateTime.minute.toString().padLeft(2, '0'); + final ss = dateTime.second.toString().padLeft(2, '0'); + final ampm = dateTime.hour >= 12 ? 'PM' : 'AM'; + + String result = format + .replaceFirst(RegExp('YYYY'), yyyy) + .replaceFirst(RegExp('MM'), MM) + .replaceFirst(RegExp('DD'), dd) + .replaceFirst(RegExp('hh'), hour12) + .replaceFirst(RegExp('HH'), HH) + .replaceFirst(RegExp('mm'), mm) + .replaceFirst(RegExp('ss'), ss) + .replaceFirst(RegExp('a'), ampm); + + return result; +} diff --git a/lib/widgets/ui_kit/button/custom_button.dart b/lib/widgets/ui_kit/button/custom_button.dart new file mode 100644 index 0000000..0e3c76c --- /dev/null +++ b/lib/widgets/ui_kit/button/custom_button.dart @@ -0,0 +1,84 @@ +import 'package:flutter/material.dart'; + +///自定义按钮 +///包括loading功能 +class CustomButton extends StatelessWidget { + final Widget child; + final VoidCallback? onPressed; + final bool loading; + final bool round; + final bool disabled; + + const CustomButton({ + super.key, + required this.child, + this.onPressed, + this.loading = false, + this.round = true, + this.disabled = false, + }); + + @override + Widget build(BuildContext context) { + ///自定义颜色 + // switch (size) { + // case ButtonSize.small: + // height = 28; + // loadingSize = 16; + // fontSize = 12; + // padding = const EdgeInsets.symmetric(horizontal: 12); + // break; + // case ButtonSize.large: + // height = 48; + // loadingSize = 24; + // fontSize = 18; + // padding = const EdgeInsets.symmetric(horizontal: 20); + // break; + // case ButtonSize.medium: + // height = 45; + // loadingSize = 15; + // fontSize = 16; + // padding = const EdgeInsets.symmetric(horizontal: 16); + // break; + // } + + void handClick() { + if (!loading && !disabled) { + onPressed?.call(); + } + } + + return Opacity( + opacity: disabled ? 0.5 : 1, + child: ElevatedButton( + onPressed: handClick, + style: ElevatedButton.styleFrom( + shape: round + ? const StadiumBorder() + : RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Visibility( + visible: loading, + child: Container( + margin: EdgeInsets.only(right: 8), + child: SizedBox.square( + dimension: 15, + child: CircularProgressIndicator( + color: Colors.white, + strokeWidth: 2, + ), + ), + ), + ), + child, + ], + ), + ), + ); + } +} diff --git a/lib/widgets/ui_kit/empty/index.dart b/lib/widgets/ui_kit/empty/index.dart new file mode 100644 index 0000000..36d64e4 --- /dev/null +++ b/lib/widgets/ui_kit/empty/index.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; + +import '../../../config/app_context.dart'; + +class Empty extends StatelessWidget { + final String? title; + final Widget? child; + + const Empty({super.key, this.title, this.child}); + + @override + Widget build(BuildContext context) { + return SizedBox.expand( + child: Align( + alignment: const FractionalOffset(0.5, 0.2), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FractionallySizedBox( + widthFactor: 0.5, + child: Image.asset("assets/image/empty_data.png"), + ), + if (title != null) + Text( + title!, + style: AppContext.textTheme.labelMedium, + ), + if (child != null) child!, + ], + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..7254ed6 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,850 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.13.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.19.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.3.4+2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.8" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.11" + dio: + dependency: "direct main" + description: + name: dio + sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9 + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.9.0" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.1" + file_picker: + dependency: "direct main" + description: + name: file_picker + sha256: e7e16c9d15c36330b94ca0e2ad8cb61f93cd5282d0158c09805aed13b5452f22 + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.3.2" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.9.3+2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "19124ff4a3d8864fdc62072b6a2ef6c222d55a3404fe14893a3c02744907b60c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.9.4+4" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "320fcfb6f33caa90f0b58380489fc5ac05d99ee94b61aa96ec2bff0ba81d3c2b" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.9.3+4" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_easyloading: + dependency: "direct main" + description: + name: flutter_easyloading + sha256: ba21a3c883544e582f9cc455a4a0907556714e1e9cf0eababfcb600da191d17c + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.5" + flutter_highlight: + dependency: transitive + description: + name: flutter_highlight + sha256: "7b96333867aa07e122e245c033b8ad622e4e3a42a1a2372cbb098a2541d8782c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: b0694b7fb1689b0e6cc193b3f1fcac6423c4f93c74fb20b806c6b6f196db0c31 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.30" + flutter_screenutil: + dependency: "direct main" + description: + name: flutter_screenutil + sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.9.3" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: "77850df57c00dc218bfe96071d576a8babec24cf58b2ed121c83cca4a2fdce7f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.2.2" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + go_router: + dependency: "direct main" + description: + name: go_router + sha256: eb059dfe59f08546e9787f895bd01652076f996bcbf485a8609ef990419ad227 + url: "https://pub.flutter-io.cn" + source: hosted + version: "16.2.1" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.3.3+1" + google_sign_in: + dependency: "direct main" + description: + name: google_sign_in + sha256: "939a8b58f84c4053811b8c1bc9adbcb59449a15b37958264bbf60020698cca0e" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.1.1" + google_sign_in_android: + dependency: transitive + description: + name: google_sign_in_android + sha256: "666c3a133f5ec4256f08884359dc34788778d96a378d804203bc57a73ffbd9c0" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.5" + google_sign_in_ios: + dependency: transitive + description: + name: google_sign_in_ios + sha256: c7ee744ebbcd98353966dbdee735d4fca085226f6bf725c6bea8a5c8fe0055bc + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.1.0" + google_sign_in_platform_interface: + dependency: transitive + description: + name: google_sign_in_platform_interface + sha256: "8736443134d2cccadd4f228d600177cb3947e36683466a6ab96877ce6932885a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" + google_sign_in_web: + dependency: transitive + description: + name: google_sign_in_web + sha256: "09ac306b2787b48f19c857b9f93375b654f774643c75bd6a1a078c85f4f7b468" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.0" + highlight: + dependency: transitive + description: + name: highlight + sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.0" + http: + dependency: transitive + description: + name: http + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.5.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.1.2" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "736eb56a911cf24d1859315ad09ddec0b66104bc41a7f8c5b96b4e2620cf5041" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.0" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "28f3987ca0ec702d346eae1d90eda59603a2101b52f1e234ded62cff1d5cfa6e" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.8.13+1" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "40c2a6a0da15556dc0f8e38a3246064a971a9f512386c3339b89f76db87269b6" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.0" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: eb06fe30bab4c4497bad449b66448f50edcc695f1c59408e78aa3a8059eb8f0e + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.8.13" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "1f81c5f2046b9ab724f85523e4af65be1d47b038160a8c8deed909762c308ed4" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.2" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: d58cd9d67793d52beefd6585b12050af0a7663c0c2a6ece0fb110a35d6955e04 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.2" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "9f143b0dba3e459553209e20cc425c9801af48e6dfa4f01a0fcf927be3f41665" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.11.0" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: d248c86554a72b5495a31c56f060cf73a41c7ff541689327b1a7dbccc33adfae + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.2" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.0.9" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.9" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.1.1" + logger: + dependency: "direct main" + description: + name: logger + sha256: "55d6c23a6c15db14920e037fe7e0dc32e7cdaf3b64b4b25df2d541b5b6b81c0c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.6.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.0" + markdown: + dependency: transitive + description: + name: markdown + sha256: "935e23e1ff3bc02d390bad4d4be001208ee92cc217cb5b5a6c19bc14aaa318c1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.3.0" + markdown_widget: + dependency: "direct main" + description: + name: markdown_widget + sha256: b52c13d3ee4d0e60c812e15b0593f142a3b8a2003cde1babb271d001a1dbdc1c + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.2+8" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.0" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.9.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.1" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.8" + provider: + dependency: "direct main" + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.1.5+1" + remixicon: + dependency: "direct main" + description: + name: remixicon + sha256: "9a0e6a67d622a1d6ddc5e5cff4898f9711ec8880fc2ebeb720f6e0bc268ea905" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.1" + scroll_to_index: + dependency: transitive + description: + name: scroll_to_index + sha256: b707546e7500d9f070d63e5acf74fd437ec7eeeb68d3412ef7b0afada0b4f176 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.1" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.3" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: a2608114b1ffdcbc9c120eb71a0e207c71da56202852d4aab8a5e30a82269e74 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.12" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + sign_in_with_apple: + dependency: "direct main" + description: + name: sign_in_with_apple + sha256: "8bd875c8e8748272749eb6d25b896f768e7e9d60988446d543fe85a37a2392b8" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.1" + sign_in_with_apple_platform_interface: + dependency: transitive + description: + name: sign_in_with_apple_platform_interface + sha256: "981bca52cf3bb9c3ad7ef44aace2d543e5c468bb713fd8dda4275ff76dfa6659" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.0" + sign_in_with_apple_web: + dependency: transitive + description: + name: sign_in_with_apple_web + sha256: f316400827f52cafcf50d00e1a2e8a0abc534ca1264e856a81c5f06bd5b10fed + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" + skeletonizer: + dependency: "direct main" + description: + name: skeletonizer + sha256: eebc03dc86b298e2d7f61e0ebce5713e9dbbc3e786f825909b4591756f196eb6 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.0+1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.4" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.0" + url_launcher: + dependency: transitive + description: + name: url_launcher + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.3.2" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "69ee86740f2847b9a4ba6cffa74ed12ce500bbe2b07f3dc1e643439da60637b7" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.3.18" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: d80b3f567a617cb923546034cc94bfe44eb15f989fe670b37f26abdb9d939cb7 + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.3.4" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: c043a77d6600ac9c38300567f33ef12b0ef4f4783a2c1f00231d2b1941fea13f + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.3" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.4" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.4" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.4.0+2" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 + url: "https://pub.flutter-io.cn" + source: hosted + version: "15.0.0" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.1" + webview_flutter: + dependency: "direct main" + description: + name: webview_flutter + sha256: c3e4fe614b1c814950ad07186007eff2f2e5dd2935eba7b9a9a1af8e5885f1ba + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.13.0" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + sha256: "9a25f6b4313978ba1c2cda03a242eea17848174912cfb4d2d8ee84a556f248e3" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.10.1" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + sha256: "63d26ee3aca7256a83ccb576a50272edd7cfc80573a4305caa98985feb493ee0" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.14.0" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + sha256: fb46db8216131a3e55bcf44040ca808423539bc6732e7ed34fb6d8044e3d512f + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.23.0" + win32: + dependency: transitive + description: + name: win32 + sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.14.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.6.1" +sdks: + dart: ">=3.8.1 <4.0.0" + flutter: ">=3.31.0-0.0.pre" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..440e6e7 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,44 @@ +name: plan +description: "A new Flutter project." +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +version: 1.0.0 + +environment: + sdk: ^3.8.1 + +dependencies: + flutter: + sdk: flutter + + cupertino_icons: ^1.0.8 + shared_preferences: ^2.5.3 + dio: ^5.8.0+1 + go_router: ^16.0.0 + remixicon: ^1.4.1 + flutter_screenutil: ^5.9.3 + skeletonizer: ^2.1.0+1 + webview_flutter: ^4.13.0 + logger: ^2.6.1 + provider: ^6.1.5 + flutter_easyloading: ^3.0.5 + google_sign_in: ^7.1.1 + file_picker: ^10.3.2 + image_picker: ^1.2.0 + markdown_widget: ^2.3.2+8 + sign_in_with_apple: ^7.0.1 + +dev_dependencies: + flutter_test: + sdk: flutter + + flutter_lints: ^5.0.0 + +flutter: + uses-material-design: true + assets: + - assets/image/ + fonts: + - family: NotoSansSC + fonts: + - asset: assets/font/NotoSansSC.ttf diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..fdcb6cc --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:plan/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}