├── .fvm
├── flutter_sdk
└── fvm_config.json
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── project
│ │ │ │ └── flutter_project
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable-xhdpi
│ │ │ ├── app_icon.png
│ │ │ ├── splash_bottom.png
│ │ │ └── splash_top_icon.png
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── settings.gradle
└── yixiaolunhui.jks
├── assets
├── images
│ ├── guide_one.png
│ ├── guide_three.png
│ ├── guide_two.png
│ ├── image1.webp
│ ├── image2.webp
│ ├── image3.jpg
│ ├── image4.webp
│ ├── image5.webp
│ ├── image6.webp
│ ├── image7.webp
│ ├── login_wx.png
│ ├── splash_bg.jpg
│ ├── tabbar
│ │ ├── wode-b-dark.png
│ │ ├── wode-b-dark.webp
│ │ ├── wode-b.png
│ │ ├── wode-b.webp
│ │ ├── wode-c-dark.png
│ │ ├── wode-c-dark.webp
│ │ ├── wode-c.png
│ │ ├── wode-c.webp
│ │ ├── xiaoxi-b-dark.png
│ │ ├── xiaoxi-b-dark.webp
│ │ ├── xiaoxi-b.png
│ │ ├── xiaoxi-b.webp
│ │ ├── xiaoxi-c-dark.png
│ │ ├── xiaoxi-c-dark.webp
│ │ ├── xiaoxi-c.png
│ │ ├── xiaoxi-c.webp
│ │ ├── youle-dark.png
│ │ ├── youle-dark.webp
│ │ ├── youle.png
│ │ ├── youle.webp
│ │ ├── zhiwei-dark.png
│ │ ├── zhiwei-dark.webp
│ │ ├── zhiwei.png
│ │ └── zhiwei.webp
│ └── work_top_bg.jpg
└── lottie
│ └── tab
│ ├── niuren-dark.json
│ ├── niuren.json
│ ├── sousuo-dark.json
│ ├── sousuo.json
│ ├── wode-b-dark.json
│ ├── wode-b.json
│ ├── wode-c-dark.json
│ ├── wode-c.json
│ ├── xiaoxi-b-dark.json
│ ├── xiaoxi-b.json
│ ├── xiaoxi-c-dark.json
│ ├── xiaoxi-c.json
│ ├── youle-dark.json
│ ├── youle.json
│ ├── zhibo-dark.json
│ ├── zhibo.json
│ ├── zhiwei-dark.json
│ └── zhiwei.json
├── imgs
├── guide.gif
└── welcome.gif
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── core
│ ├── app
│ │ ├── app.dart
│ │ ├── app_life_cycle.dart
│ │ └── injection.dart
│ ├── base
│ │ ├── arguments.dart
│ │ ├── navigation_history_observer.dart
│ │ └── page_state.dart
│ ├── error
│ │ └── flutter_error.dart
│ └── http
│ │ ├── http_api.dart
│ │ ├── http_exception.dart
│ │ ├── http_request.dart
│ │ └── http_url.dart
├── main_beta.dart
├── main_mp.dart
├── main_qa.dart
├── model
│ ├── language.dart
│ └── work_model.dart
├── page
│ ├── code
│ │ ├── binding.dart
│ │ ├── logic.dart
│ │ ├── state.dart
│ │ └── view.dart
│ ├── guide
│ │ ├── logic.dart
│ │ ├── state.dart
│ │ └── view.dart
│ ├── home
│ │ ├── binding.dart
│ │ ├── child
│ │ │ ├── message
│ │ │ │ ├── logic.dart
│ │ │ │ ├── state.dart
│ │ │ │ └── view.dart
│ │ │ ├── mine
│ │ │ │ ├── logic.dart
│ │ │ │ ├── state.dart
│ │ │ │ └── view.dart
│ │ │ ├── work
│ │ │ │ ├── logic.dart
│ │ │ │ ├── state.dart
│ │ │ │ ├── view.dart
│ │ │ │ ├── widget
│ │ │ │ │ └── work_list_widget.dart
│ │ │ │ └── work_test_data_helper.dart
│ │ │ └── youle
│ │ │ │ ├── logic.dart
│ │ │ │ ├── state.dart
│ │ │ │ └── view.dart
│ │ ├── logic.dart
│ │ ├── state.dart
│ │ └── view.dart
│ ├── login
│ │ ├── binding.dart
│ │ ├── logic.dart
│ │ ├── state.dart
│ │ └── view.dart
│ ├── page_ext.dart
│ ├── splash
│ │ ├── binding.dart
│ │ ├── logic.dart
│ │ ├── state.dart
│ │ └── view.dart
│ └── welcome
│ │ ├── logic.dart
│ │ ├── state.dart
│ │ └── view.dart
├── res
│ ├── colors
│ │ └── color_res.dart
│ ├── images
│ │ └── r.dart
│ └── intl
│ │ ├── string_res.dart
│ │ ├── string_res_key.dart
│ │ └── strings
│ │ ├── en_uk_res.dart
│ │ ├── en_us_res.dart
│ │ ├── ja_jp_res.dart
│ │ └── zh_cn_res.dart
├── router
│ └── routers.dart
├── util
│ ├── date_util.dart
│ ├── device_util.dart
│ ├── directory_util.dart
│ ├── encrypt_util.dart
│ ├── image_util.dart
│ ├── json_util.dart
│ ├── keyboard_util.dart
│ ├── locale_util.dart
│ ├── log_util.dart
│ ├── logger_util.dart
│ ├── num_util.dart
│ ├── regex_util.dart
│ ├── screen_util.dart
│ ├── sp_key.dart
│ ├── sp_util.dart
│ ├── text_util.dart
│ ├── timeline_util.dart
│ ├── timer_util.dart
│ ├── toast_util.dart
│ ├── user_util.dart
│ └── widget_util.dart
└── widgets
│ ├── bottom_bar_item.dart
│ ├── lottie_bottom_bar_item.dart
│ ├── my_app_bar.dart
│ └── scale_tabbar.dart
├── linux
├── .gitignore
├── CMakeLists.txt
├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
├── main.cc
├── my_application.cc
└── my_application.h
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── app_icon_1024.png
│ │ ├── app_icon_128.png
│ │ ├── app_icon_16.png
│ │ ├── app_icon_256.png
│ │ ├── app_icon_32.png
│ │ ├── app_icon_512.png
│ │ └── app_icon_64.png
│ ├── Base.lproj
│ └── MainMenu.xib
│ ├── Configs
│ ├── AppInfo.xcconfig
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
├── pubspec.lock
├── pubspec.yaml
├── res_build.sh
├── test
└── widget_test.dart
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.fvm/flutter_sdk:
--------------------------------------------------------------------------------
1 | /Users/zhouweilong/fvm/versions/3.19.3
--------------------------------------------------------------------------------
/.fvm/fvm_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "flutterSdkVersion": "3.19.3",
3 | "flavors": {}
4 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
46 | # FVM Version Cache
47 | .fvm/
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
8 | channel: stable
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
17 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
18 | - platform: android
19 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
20 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
21 | - platform: ios
22 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
23 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
24 | - platform: linux
25 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
26 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
27 | - platform: macos
28 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
29 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
30 | - platform: web
31 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
32 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
33 | - platform: windows
34 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
35 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
36 |
37 | # User provided section
38 |
39 | # List of Local paths (relative to this file) that should be
40 | # ignored by the migrate tool.
41 | #
42 | # Files that are not part of the templates will be ignored by default.
43 | unmanaged_files:
44 | - 'lib/main.dart'
45 | - 'ios/Runner.xcodeproj/project.pbxproj'
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## 仿Boss项目
2 |
3 | 此项目是使用Flutter语言仿Boss的项目,用于学习Flutter的记录。
4 |
5 | ## 效果界面
6 |
7 | | 界面名称 | 效果 |
8 | |:------|:------------------------------------------------------------------------------------------------------------------:|
9 | | 欢迎页 |
|
10 | | 引导页 |
|
11 | | 登录页 |
|
12 | | 验证码 |
|
13 | | Tab切换 |
|
14 | | 首页列表 |
|
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader)
5 | }
6 | }
7 |
8 | def flutterRoot = localProperties.getProperty('flutter.sdk')
9 | if (flutterRoot == null) {
10 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
11 | }
12 |
13 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
14 | if (flutterVersionCode == null) {
15 | flutterVersionCode = '1'
16 | }
17 |
18 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
19 | if (flutterVersionName == null) {
20 | flutterVersionName = '1.0'
21 | }
22 |
23 | apply plugin: 'com.android.application'
24 | apply plugin: 'kotlin-android'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion flutter.compileSdkVersion
29 | ndkVersion flutter.ndkVersion
30 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | signingConfigs {
37 | debug {
38 | storeFile file('../yixiaolunhui.jks')
39 | storePassword 'yixiaolunhui'
40 | keyPassword 'yixiaolunhui'
41 | keyAlias 'yixiaolunhui'
42 | }
43 |
44 | release {
45 | storeFile file('../yixiaolunhui.jks')
46 | storePassword 'yixiaolunhui'
47 | keyPassword 'yixiaolunhui'
48 | keyAlias 'yixiaolunhui'
49 | }
50 | }
51 |
52 | kotlinOptions {
53 | jvmTarget = '1.8'
54 | }
55 |
56 | sourceSets {
57 | main.java.srcDirs += 'src/main/kotlin'
58 | }
59 |
60 | defaultConfig {
61 | applicationId "com.project.flutter_project"
62 | minSdkVersion 21
63 | targetSdkVersion flutter.targetSdkVersion
64 | versionCode flutterVersionCode.toInteger()
65 | versionName flutterVersionName
66 | }
67 |
68 | lintOptions {
69 | checkReleaseBuilds false
70 | }
71 |
72 | flavorDimensions "FlutterDemo"
73 | productFlavors {
74 | qa {
75 | dimension "FlutterDemo"
76 | }
77 |
78 | beta {
79 | dimension "FlutterDemo"
80 | }
81 |
82 | mp {
83 | dimension "FlutterDemo"
84 | }
85 | }
86 |
87 | buildTypes {
88 |
89 | debug {
90 | signingConfig signingConfigs.debug
91 | }
92 |
93 | release {
94 | signingConfig signingConfigs.release
95 | minifyEnabled true
96 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
97 | }
98 | }
99 |
100 | applicationVariants.all { variant ->
101 | variant.outputs.all {
102 | def version = variant.versionName // 版本号
103 | def buildType = variant.buildType.name // 包类型,debug 还是 release
104 | def flavors = variant.productFlavors.name
105 | def createTime = new Date().format('yyyyMMddHHmm') // 打包时间 202109251645
106 | def fileName = "App_${version}_${buildType}_qa_${createTime}.apk"
107 | if (flavors.contains("mp")) {
108 | fileName = "App_${version}_${buildType}_mp_${createTime}.apk"
109 | } else if (flavors.contains("beta")) {
110 | fileName = "App_${version}_${buildType}_beta_${createTime}.apk"
111 | } else if (flavors.contains("qa")) {
112 | fileName = "App_${version}_${buildType}_qa_${createTime}.apk"
113 | } else {
114 | fileName = "App_${version}_${buildType}_qa_${createTime}.apk"
115 | }
116 | outputFileName = fileName
117 | }
118 | }
119 | }
120 |
121 | flutter {
122 | source '../..'
123 | }
124 |
125 | dependencies {
126 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
127 | }
128 |
--------------------------------------------------------------------------------
/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | -keep class io.flutter.app.** { *; }
2 | -keep class io.flutter.plugin.** { *; }
3 | -keep class io.flutter.util.** { *; }
4 | -keep class io.flutter.view.** { *; }
5 | -keep class io.flutter.** { *; }
6 | -keep class io.flutter.plugins.** { *; }
7 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
10 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/project/flutter_project/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.project.flutter_project
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
13 |
14 | -
17 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xhdpi/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/android/app/src/main/res/drawable-xhdpi/app_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xhdpi/splash_bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/android/app/src/main/res/drawable-xhdpi/splash_bottom.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xhdpi/splash_top_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/android/app/src/main/res/drawable-xhdpi/splash_top_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
13 |
14 | -
17 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
16 |
20 |
21 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.2.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | tasks.register("clean", Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/android/yixiaolunhui.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/android/yixiaolunhui.jks
--------------------------------------------------------------------------------
/assets/images/guide_one.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/guide_one.png
--------------------------------------------------------------------------------
/assets/images/guide_three.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/guide_three.png
--------------------------------------------------------------------------------
/assets/images/guide_two.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/guide_two.png
--------------------------------------------------------------------------------
/assets/images/image1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/image1.webp
--------------------------------------------------------------------------------
/assets/images/image2.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/image2.webp
--------------------------------------------------------------------------------
/assets/images/image3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/image3.jpg
--------------------------------------------------------------------------------
/assets/images/image4.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/image4.webp
--------------------------------------------------------------------------------
/assets/images/image5.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/image5.webp
--------------------------------------------------------------------------------
/assets/images/image6.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/image6.webp
--------------------------------------------------------------------------------
/assets/images/image7.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/image7.webp
--------------------------------------------------------------------------------
/assets/images/login_wx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/login_wx.png
--------------------------------------------------------------------------------
/assets/images/splash_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/splash_bg.jpg
--------------------------------------------------------------------------------
/assets/images/tabbar/wode-b-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/wode-b-dark.png
--------------------------------------------------------------------------------
/assets/images/tabbar/wode-b-dark.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/wode-b-dark.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/wode-b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/wode-b.png
--------------------------------------------------------------------------------
/assets/images/tabbar/wode-b.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/wode-b.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/wode-c-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/wode-c-dark.png
--------------------------------------------------------------------------------
/assets/images/tabbar/wode-c-dark.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/wode-c-dark.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/wode-c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/wode-c.png
--------------------------------------------------------------------------------
/assets/images/tabbar/wode-c.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/wode-c.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/xiaoxi-b-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/xiaoxi-b-dark.png
--------------------------------------------------------------------------------
/assets/images/tabbar/xiaoxi-b-dark.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/xiaoxi-b-dark.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/xiaoxi-b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/xiaoxi-b.png
--------------------------------------------------------------------------------
/assets/images/tabbar/xiaoxi-b.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/xiaoxi-b.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/xiaoxi-c-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/xiaoxi-c-dark.png
--------------------------------------------------------------------------------
/assets/images/tabbar/xiaoxi-c-dark.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/xiaoxi-c-dark.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/xiaoxi-c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/xiaoxi-c.png
--------------------------------------------------------------------------------
/assets/images/tabbar/xiaoxi-c.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/xiaoxi-c.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/youle-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/youle-dark.png
--------------------------------------------------------------------------------
/assets/images/tabbar/youle-dark.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/youle-dark.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/youle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/youle.png
--------------------------------------------------------------------------------
/assets/images/tabbar/youle.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/youle.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/zhiwei-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/zhiwei-dark.png
--------------------------------------------------------------------------------
/assets/images/tabbar/zhiwei-dark.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/zhiwei-dark.webp
--------------------------------------------------------------------------------
/assets/images/tabbar/zhiwei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/zhiwei.png
--------------------------------------------------------------------------------
/assets/images/tabbar/zhiwei.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/tabbar/zhiwei.webp
--------------------------------------------------------------------------------
/assets/images/work_top_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/assets/images/work_top_bg.jpg
--------------------------------------------------------------------------------
/imgs/guide.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/imgs/guide.gif
--------------------------------------------------------------------------------
/imgs/welcome.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/imgs/welcome.gif
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '12.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | target 'RunnerTests' do
36 | inherit! :search_paths
37 | end
38 | end
39 |
40 | post_install do |installer|
41 | installer.pods_project.targets.each do |target|
42 | flutter_additional_ios_build_settings(target)
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yixiaolunhui/flutter_project/788a64a93395b3fb32aad400b87785f252a8c71b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | 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.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Flutter Project
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | flutter_project
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 | CADisableMinimumFrameDurationOnPhone
47 |
48 | UIApplicationSupportsIndirectInputEvents
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/core/app/app.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_project/core/app/injection.dart';
3 | import 'package:flutter_project/core/base/arguments.dart';
4 | import 'package:flutter_project/core/base/navigation_history_observer.dart';
5 | import 'package:flutter_project/page/splash/binding.dart';
6 | import 'package:flutter_project/page/splash/view.dart';
7 | import 'package:flutter_project/res/intl/string_res.dart';
8 | import 'package:flutter_project/router/routers.dart';
9 | import 'package:flutter_project/util/keyboard_util.dart';
10 | import 'package:flutter_project/util/locale_util.dart';
11 | import 'package:get/get.dart';
12 |
13 | /// 环境类型
14 | enum Env { qa, beta, mp }
15 |
16 | /// 当前环境类型
17 | Env appEnv = Env.qa;
18 |
19 | /// 是否需要调试工具
20 | bool get isNeedUme {
21 | return appEnv == Env.qa || appEnv == Env.beta;
22 | }
23 |
24 | /// 初始化
25 | Future initApp(Env env) async {
26 | appEnv = env;
27 | await Injection.init();
28 | runApp(_myApp());
29 | }
30 |
31 | Widget _myApp() {
32 | return GetMaterialApp(
33 | getPages: Routers.routePages,
34 | initialRoute: '/',
35 | debugShowCheckedModeBanner: false,
36 | builder: (context, child) => MediaQuery(
37 | data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
38 | child: Scaffold(
39 | body: GestureDetector(
40 | onTap: () {
41 | //全局控制-点击空白区域关闭键盘
42 | KeyboardUtils.hideKeyboard(context);
43 | },
44 | child: child,
45 | ),
46 | )),
47 | navigatorObservers: [NavigationHistoryObserver()],
48 | onGenerateRoute: (settings) {
49 | var uri = Uri.parse(settings.name ?? "");
50 | var route = uri.path;
51 | var params = uri.queryParameters;
52 | final routePage = Routers.routePages.firstWhereOrNull(
53 | (routePage) => routePage.name == route,
54 | );
55 | if (routePage == null) {
56 | return null;
57 | }
58 | return MaterialPageRoute(
59 | builder: (context) {
60 | var widget = routePage.page.call();
61 | if (widget is RouteQueryMixin) {
62 | (widget as RouteQueryMixin).routeParams.addAll(params);
63 | }
64 | if (widget is ArgumentsMixin) {
65 | (widget as ArgumentsMixin).arguments = settings.arguments;
66 | }
67 | return widget;
68 | },
69 | settings: settings,
70 | );
71 | },
72 |
73 | //主题颜色
74 | themeMode: ThemeMode.system,
75 | // theme: ThemeUtil.lightTheme,
76 | // darkTheme: ThemeUtil.darkTheme,
77 |
78 | //国际化支持-来源配置
79 | translations: StringRes(),
80 |
81 | //国际化支持-默认语言
82 | locale: LocaleOptions.getDefault(),
83 |
84 | //国际化支持-备用语言
85 | fallbackLocale: const Locale('en', 'US'),
86 |
87 | //默认路由跳转动画
88 | defaultTransition: Transition.native,
89 |
90 | //初始化启动页的page和binding
91 | initialBinding: SplashBinding(),
92 |
93 | home: const SplashPage(),
94 | );
95 | }
96 |
--------------------------------------------------------------------------------
/lib/core/app/app_life_cycle.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/widgets.dart';
3 | import 'package:flutter_project/util/logger_util.dart';
4 | import 'package:get/get.dart';
5 |
6 | /// 用于监听系统暗黑模式改变
7 | class AppLifeCycleDelegate with WidgetsBindingObserver {
8 | static final AppLifeCycleDelegate _appLifeCycleDelegate =
9 | AppLifeCycleDelegate._init();
10 |
11 | AppLifeCycleDelegate._init() {
12 | WidgetsBinding.instance.addObserver(this);
13 | }
14 |
15 | factory AppLifeCycleDelegate() {
16 | return _appLifeCycleDelegate;
17 | }
18 |
19 | @override
20 | void didChangePlatformBrightness() {
21 | super.didChangePlatformBrightness();
22 | Log().d("手机系统暗黑模式改变");
23 | Get.forceAppUpdate();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/lib/core/app/injection.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_project/core/app/app_life_cycle.dart';
2 | import 'package:flutter_project/core/base/page_state.dart';
3 | import 'package:flutter_project/core/error/flutter_error.dart';
4 | import 'package:flutter_project/util/logger_util.dart';
5 | import 'package:flutter_project/util/screen_util.dart';
6 | import 'package:get/get.dart';
7 | import 'package:shared_preferences/shared_preferences.dart';
8 |
9 | /// 初始化时进行依赖注入-全局
10 | class Injection {
11 | ///初始化
12 | static Future init() async {
13 | await Get.putAsync(() => SharedPreferences.getInstance());
14 | //异常处理
15 | ErrorHelper.init();
16 | //路由记录监听器
17 | RouteHistoryObserver.init();
18 | //强制竖屏
19 | ScreenUtils.setPreferredOrientation();
20 | //暗黑变化监听, (主题变化监听,强制页面UI更新)
21 | AppLifeCycleDelegate();
22 | //透明状态栏
23 | ScreenUtils.setSystemTransparent();
24 | //整理日志文件
25 | ConsoleOutput().clearUpLogFile();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/core/base/arguments.dart:
--------------------------------------------------------------------------------
1 | import 'dart:collection';
2 |
3 | /// Arguments参数数据
4 | mixin ArgumentsMixin {
5 | late final Object? arguments;
6 | }
7 |
8 | /// 路由拼接的参数数据
9 | mixin RouteQueryMixin {
10 | final Map routeParams = HashMap();
11 | }
12 |
--------------------------------------------------------------------------------
/lib/core/base/navigation_history_observer.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:built_collection/built_collection.dart';
4 | import 'package:flutter/widgets.dart';
5 |
6 | class NavigationHistoryObserver extends NavigatorObserver {
7 | final List?> _history = ?>[];
8 |
9 | BuiltList> get history =>
10 | BuiltList>.from(_history);
11 |
12 | Route? get top => _history.last;
13 |
14 | final List?> _poppedRoutes = ?>[];
15 |
16 | BuiltList> get poppedRoutes =>
17 | BuiltList>.from(_poppedRoutes);
18 |
19 | Route? get next => _poppedRoutes.last;
20 |
21 | final StreamController _historyChangeStreamController =
22 | StreamController.broadcast();
23 |
24 | Stream get historyChangeStream =>
25 | _historyChangeStreamController.stream;
26 |
27 | static final NavigationHistoryObserver _singleton =
28 | NavigationHistoryObserver._internal();
29 |
30 | NavigationHistoryObserver._internal();
31 |
32 | factory NavigationHistoryObserver() {
33 | return _singleton;
34 | }
35 |
36 | @override
37 | void didPop(Route route, Route? previousRoute) {
38 | _poppedRoutes.add(_history.last);
39 | _history.removeLast();
40 | _historyChangeStreamController.add(HistoryChange(
41 | action: NavigationStackAction.pop,
42 | newRoute: route,
43 | oldRoute: previousRoute,
44 | ));
45 | }
46 |
47 | @override
48 | void didPush(Route route, Route? previousRoute) {
49 | _history.add(route);
50 | _poppedRoutes.remove(route);
51 | _historyChangeStreamController.add(HistoryChange(
52 | action: NavigationStackAction.push,
53 | newRoute: route,
54 | oldRoute: previousRoute,
55 | ));
56 | }
57 |
58 | @override
59 | void didRemove(Route route, Route? previousRoute) {
60 | _history.remove(route);
61 | _historyChangeStreamController.add(HistoryChange(
62 | action: NavigationStackAction.remove,
63 | newRoute: route,
64 | oldRoute: previousRoute,
65 | ));
66 | }
67 |
68 | @override
69 | void didReplace({Route? newRoute, Route? oldRoute}) {
70 | int oldRouteIndex = _history.indexOf(oldRoute);
71 | _history.replaceRange(oldRouteIndex, oldRouteIndex + 1, [newRoute]);
72 | _historyChangeStreamController.add(HistoryChange(
73 | action: NavigationStackAction.replace,
74 | newRoute: newRoute,
75 | oldRoute: oldRoute,
76 | ));
77 | }
78 | }
79 |
80 | class HistoryChange {
81 | HistoryChange({this.action, this.newRoute, this.oldRoute});
82 |
83 | final NavigationStackAction? action;
84 | final Route? newRoute;
85 | final Route? oldRoute;
86 | }
87 |
88 | enum NavigationStackAction { push, pop, remove, replace }
89 |
--------------------------------------------------------------------------------
/lib/core/error/flutter_error.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/foundation.dart';
3 | import 'package:flutter_project/util/logger_util.dart';
4 |
5 | class ErrorHelper {
6 | /// 异常捕获处理
7 | static void init() {
8 | //捕获异常
9 | FlutterError.onError = (errorDetails) {
10 | Log().d('FlutterError onError!');
11 | _logError(errorDetails.exception, errorDetails.stack);
12 | };
13 | //捕获异步异常
14 | PlatformDispatcher.instance.onError = (error, stack) {
15 | Log().d('PlatformDispatcher onError!');
16 | _logError(error, stack);
17 | return true;
18 | };
19 | // 自定义报错页面
20 | ErrorWidget.builder = (FlutterErrorDetails flutterErrorDetails) {
21 | Log().d(flutterErrorDetails.toString());
22 | return const Center(child: Text("App Error"));
23 | };
24 | }
25 |
26 | /// 打印日志,存到日志文件中
27 | static Future _logError(dynamic error, dynamic stackTrace) async {
28 | String logMessage = '''
29 | ---------------- APP Exception ----------------
30 | $error$stackTrace
31 | ---------------- APP Exception ----------------
32 | ''';
33 | Log().d(logMessage);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lib/core/http/http_api.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:flutter_project/core/http/http_request.dart';
3 |
4 | mixin HttpApi {
5 | ///API 请求
6 | Future request({
7 | required Method method,
8 | required String path,
9 | dynamic params,
10 | Success? success,
11 | Fail? fail,
12 | Complete? complete,
13 | Map? header,
14 | CancelToken? cancelToken,
15 | ProgressCallback? onSendProgress,
16 | }) {
17 | return HttpRequest.request(
18 | method,
19 | path,
20 | params,
21 | header,
22 | success: success,
23 | fail: fail,
24 | complete: complete,
25 | cancelToken: cancelToken,
26 | onSendProgress: onSendProgress,
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/core/http/http_exception.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:dio/dio.dart';
4 |
5 | /// 错误信息处理
6 | class HttpException {
7 | static const int unknownError = 0;
8 | static const int socketError = 10000;
9 | static const int httpError = 10001;
10 | static const int parseError = 10002;
11 | static const int timeoutError = 10003;
12 | static const int cancelError = 10004;
13 | static const int netError = 10005;
14 |
15 | static const String netWorkError =
16 | "Network error. Please check your connection and try again.";
17 | static const String errorOccur = "Error Occurred";
18 | static const String requestTimeout = "Request Timeout";
19 |
20 | /// 错误信息处理
21 | /// [error] 错误信息类型
22 | static NetError handleException(DioError error) {
23 | switch (error.type) {
24 | case DioErrorType.response:
25 | dynamic e = error.error;
26 | if (e is SocketException) {
27 | return NetError(socketError, netWorkError);
28 | } else if (e is HttpException) {
29 | return NetError(httpError, errorOccur);
30 | } else if (e is FormatException) {
31 | return NetError(parseError, errorOccur);
32 | } else {
33 | return NetError(netError, netWorkError);
34 | }
35 | case DioErrorType.connectTimeout:
36 | case DioErrorType.receiveTimeout:
37 | return NetError(timeoutError, requestTimeout);
38 | case DioErrorType.cancel:
39 | return NetError(cancelError, errorOccur);
40 | default:
41 | return NetError(unknownError, errorOccur);
42 | }
43 | }
44 | }
45 |
46 | class NetError {
47 | int code;
48 | String msg;
49 |
50 | NetError(this.code, this.msg);
51 | }
52 |
--------------------------------------------------------------------------------
/lib/core/http/http_request.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:io';
3 |
4 | import 'package:connectivity/connectivity.dart';
5 | import 'package:dio/dio.dart';
6 | import 'package:flutter/cupertino.dart';
7 | import 'package:flutter_project/core/http/http_exception.dart';
8 | import 'package:flutter_project/core/http/http_url.dart';
9 | import 'package:flutter_project/util/device_util.dart';
10 | import 'package:flutter_project/util/logger_util.dart';
11 | import 'package:flutter_project/util/sp_util.dart';
12 |
13 | /// 连接超时时间
14 | const int _connectTimeout = 15000;
15 |
16 | /// 发送超时时间
17 | const int _sendTimeout = 15000;
18 |
19 | /// 成功回调
20 | typedef Success = Function(T data);
21 |
22 | /// 失败回调
23 | typedef Fail = Function(int code, String msg);
24 |
25 | /// 完成回调
26 | typedef Complete = VoidCallback;
27 |
28 | /// 请求工具
29 | class HttpRequest {
30 | static Dio? _dio;
31 |
32 | static Dio get dio => createInstance();
33 |
34 | /// 创建 dio 实例对象
35 | static Dio createInstance({int receiveTimeout = 10000}) {
36 | if (_dio == null) {
37 | var options = BaseOptions(
38 | contentType: Headers.jsonContentType,
39 | validateStatus: (status) => true,
40 | sendTimeout: _sendTimeout,
41 | connectTimeout: _connectTimeout,
42 | receiveTimeout: receiveTimeout,
43 | baseUrl: HttpUrl.baseUrl,
44 | );
45 | _dio = Dio(options);
46 | }
47 | return _dio!;
48 | }
49 |
50 | static resetDio() {
51 | _dio = null;
52 | createInstance();
53 | }
54 |
55 | /// 请求,返回参数为 T
56 | static Future request(
57 | Method method,
58 | String path,
59 | dynamic params,
60 | Map? header, {
61 | Success? success,
62 | Fail? fail,
63 | Complete? complete,
64 | CancelToken? cancelToken,
65 | ProgressCallback? onSendProgress,
66 | }) async {
67 | try {
68 | var connectivityResult = await (Connectivity().checkConnectivity());
69 | if (connectivityResult == ConnectivityResult.none) {
70 | fail?.call(HttpException.netError, HttpException.netWorkError);
71 | return Future.value(null);
72 | }
73 | Dio dio = createInstance();
74 | Log().d("request url -> $path request param:$params");
75 | Response response = await dio.request(
76 | path,
77 | data: params,
78 | cancelToken: cancelToken,
79 | onSendProgress: onSendProgress,
80 | options: Options(
81 | method: _methodValues[method],
82 | headers: await _headerToken(header, url: path),
83 | ),
84 | );
85 | success?.call(response.data as T);
86 | return Future.value(response.data as T);
87 | } on DioError catch (e) {
88 | final NetError netError = HttpException.handleException(e);
89 | fail?.call(netError.code, netError.msg);
90 | Log().d(
91 | "error =====> message: ${e.message},\ntype:${e.type},\nresponse:${e.response}, \nerror:${e.error}");
92 | return Future.value(null);
93 | } finally {
94 | complete?.call();
95 | }
96 | }
97 | }
98 |
99 | Future