From a830ad764a4e09a8e90617628fb3bc6ded54b105 Mon Sep 17 00:00:00 2001 From: leon <916117771@qq.com> Date: Wed, 15 Apr 2026 10:29:27 +0800 Subject: [PATCH] init --- .gitignore | 45 + .metadata | 30 + .omc/state/hud-stdin-cache.json | 1 + .omc/state/idle-notif-cooldown.json | 3 + .omc/state/last-tool-error.json | 7 + .../hud-state.json | 6 + README.md | 16 + analysis_options.yaml | 28 + android/.gitignore | 14 + android/app/build.gradle.kts | 44 + android/app/src/debug/AndroidManifest.xml | 7 + android/app/src/main/AndroidManifest.xml | 45 + .../com/xiarui/kuaishai/MainActivity.kt | 5 + .../res/drawable-v21/launch_background.xml | 12 + .../main/res/drawable/launch_background.xml | 12 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values-night/styles.xml | 18 + android/app/src/main/res/values/styles.xml | 18 + android/app/src/profile/AndroidManifest.xml | 7 + android/build.gradle.kts | 24 + android/gradle.properties | 3 + .../gradle/wrapper/gradle-wrapper.properties | 5 + android/settings.gradle.kts | 26 + lib/main.dart | 896 ++++++++++++++++++ pubspec.lock | 213 +++++ pubspec.yaml | 89 ++ test/widget_test.dart | 30 + 31 files changed, 1604 insertions(+) create mode 100644 .gitignore create mode 100644 .metadata create mode 100644 .omc/state/hud-stdin-cache.json create mode 100644 .omc/state/idle-notif-cooldown.json create mode 100644 .omc/state/last-tool-error.json create mode 100644 .omc/state/sessions/d02a3d50-8270-42a7-8193-289c66564f2b/hud-state.json create mode 100644 README.md create mode 100644 analysis_options.yaml create mode 100644 android/.gitignore create mode 100644 android/app/build.gradle.kts create mode 100644 android/app/src/debug/AndroidManifest.xml create mode 100644 android/app/src/main/AndroidManifest.xml create mode 100644 android/app/src/main/kotlin/com/xiarui/kuaishai/MainActivity.kt create mode 100644 android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 android/app/src/main/res/drawable/launch_background.xml create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/values-night/styles.xml create mode 100644 android/app/src/main/res/values/styles.xml create mode 100644 android/app/src/profile/AndroidManifest.xml create mode 100644 android/build.gradle.kts create mode 100644 android/gradle.properties create mode 100644 android/gradle/wrapper/gradle-wrapper.properties create mode 100644 android/settings.gradle.kts create mode 100644 lib/main.dart create mode 100644 pubspec.lock create mode 100644 pubspec.yaml create mode 100644 test/widget_test.dart diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3820a95 --- /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-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# 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..18e8efb --- /dev/null +++ b/.metadata @@ -0,0 +1,30 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "20f82749394e68bcfbbeee96bad384abaae09c13" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 20f82749394e68bcfbbeee96bad384abaae09c13 + base_revision: 20f82749394e68bcfbbeee96bad384abaae09c13 + - platform: android + create_revision: 20f82749394e68bcfbbeee96bad384abaae09c13 + base_revision: 20f82749394e68bcfbbeee96bad384abaae09c13 + + # 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/.omc/state/hud-stdin-cache.json b/.omc/state/hud-stdin-cache.json new file mode 100644 index 0000000..71651c4 --- /dev/null +++ b/.omc/state/hud-stdin-cache.json @@ -0,0 +1 @@ +{"session_id":"d02a3d50-8270-42a7-8193-289c66564f2b","transcript_path":"C:\\Users\\黄昇\\.claude\\projects\\D--code-new-git-code-kuaishai\\d02a3d50-8270-42a7-8193-289c66564f2b.jsonl","cwd":"D:\\code\\new_git_code\\kuaishai","model":{"id":"qwen3.6-plus","display_name":"qwen3.6-plus"},"workspace":{"current_dir":"D:\\code\\new_git_code\\kuaishai","project_dir":"D:\\code\\new_git_code\\kuaishai","added_dirs":[]},"version":"2.1.108","output_style":{"name":"default"},"cost":{"total_cost_usd":3.8017255,"total_duration_ms":1418883,"total_api_duration_ms":606350,"total_lines_added":1051,"total_lines_removed":277},"context_window":{"total_input_tokens":552,"total_output_tokens":23871,"context_window_size":200000,"current_usage":{"input_tokens":6,"output_tokens":312,"cache_creation_input_tokens":50,"cache_read_input_tokens":110394},"used_percentage":55,"remaining_percentage":45},"exceeds_200k_tokens":false} \ No newline at end of file diff --git a/.omc/state/idle-notif-cooldown.json b/.omc/state/idle-notif-cooldown.json new file mode 100644 index 0000000..6fe68c7 --- /dev/null +++ b/.omc/state/idle-notif-cooldown.json @@ -0,0 +1,3 @@ +{ + "lastSentAt": "2026-04-15T02:17:25.031Z" +} \ No newline at end of file diff --git a/.omc/state/last-tool-error.json b/.omc/state/last-tool-error.json new file mode 100644 index 0000000..8295996 --- /dev/null +++ b/.omc/state/last-tool-error.json @@ -0,0 +1,7 @@ +{ + "tool_name": "mcp__dart__analyze_files", + "tool_input_preview": "{}", + "error": "No roots set. At least one root must be set in order to use this tool.", + "timestamp": "2026-04-15T01:57:54.092Z", + "retry_count": 1 +} \ No newline at end of file diff --git a/.omc/state/sessions/d02a3d50-8270-42a7-8193-289c66564f2b/hud-state.json b/.omc/state/sessions/d02a3d50-8270-42a7-8193-289c66564f2b/hud-state.json new file mode 100644 index 0000000..26d35c4 --- /dev/null +++ b/.omc/state/sessions/d02a3d50-8270-42a7-8193-289c66564f2b/hud-state.json @@ -0,0 +1,6 @@ +{ + "timestamp": "2026-04-15T01:54:21.724Z", + "backgroundTasks": [], + "sessionStartTimestamp": "2026-04-15T01:53:48.302Z", + "sessionId": "d02a3d50-8270-42a7-8193-289c66564f2b" +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e1d45d4 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# kuaishai + +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..0d29021 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,28 @@ +# 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 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..c7b9948 --- /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.xiarui.kuaishai" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + 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.xiarui.kuaishai" + // 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..5c53af7 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/xiarui/kuaishai/MainActivity.kt b/android/app/src/main/kotlin/com/xiarui/kuaishai/MainActivity.kt new file mode 100644 index 0000000..bd57a88 --- /dev/null +++ b/android/app/src/main/kotlin/com/xiarui/kuaishai/MainActivity.kt @@ -0,0 +1,5 @@ +package com.xiarui.kuaishai + +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 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 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..dbee657 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,24 @@ +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..ac3b479 --- /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\://services.gradle.org/distributions/gradle-8.12-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..fb605bc --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,26 @@ +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.9.1" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false +} + +include(":app") diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..a80ed6c --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,896 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; + +void main() { + // 关闭调试绘制(黄色框线) + debugPaintSizeEnabled = false; + debugPaintPointersEnabled = false; + + WidgetsFlutterBinding.ensureInitialized(); + // 隐藏顶部状态栏和底部操作栏,全屏显示 + SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); + + runApp(const MyApp()); +} + +/// HMI 配色常量(与 Pencil 设计变量一致) +class HmiColors { + HmiColors._(); + + /// 主背景 + static const bg = Color(0xFFCFD4E1); + /// 状态栏/横幅背景 + static const banner = Color(0xFF3D5880); + static const bannerDark = Color(0xFF2C4060); + static const bannerLight = Color(0xFF4E6A92); + /// 卡片背景 + static const white = Color(0xFFF0F0F5); + /// 边框 + static const border = Color(0xFFB8BED0); + /// 分隔线 + static const divider = Color(0xFFD5DAE5); + /// 文字 + static const textPrimary = Color(0xFF1A2332); + static const textSecondary = Color(0xFF5A6A7A); + static const textWhite = Color(0xFFFFFFFF); + /// 功能色 + static const success = Color(0xFF27AE60); + static const warning = Color(0xFFF5A623); + static const danger = Color(0xFFE74C3C); + static const accent = Color(0xFF4A90D9); +} + +/// 应用根组件 +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: '快采 HMI', + debugShowCheckedModeBanner: false, + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: HmiColors.accent), + useMaterial3: true, + fontFamily: 'Inter', + ), + home: const HomePage(), + ); + } +} + +/// HMI 首页控制面板 +class HomePage extends StatefulWidget { + const HomePage({super.key}); + + @override + State createState() => _HomePageState(); +} + +class _HomePageState extends State { + final String _currentTime = '2026-03-12 14:35:28'; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: HmiColors.bg, + body: FittedBox( + fit: BoxFit.contain, + alignment: Alignment.center, + child: SizedBox( + width: 1280, + height: 800, + child: Column( + children: [ + _buildStatusBar(), + Expanded(child: _buildMainBody()), + ], + ), + ), + ), + ); + } + + /// 顶部状态栏 (48px 高度) + Widget _buildStatusBar() { + return Container( + height: 48, + padding: const EdgeInsets.symmetric(horizontal: 20), + decoration: const BoxDecoration( + color: HmiColors.banner, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // 左侧:设备图标 + 设备名称 + Row( + children: [ + const Icon( + Icons.science_outlined, + color: HmiColors.textWhite, + size: 18, + ), + const SizedBox(width: 10), + const Text( + '污水毒品前处理一体机', + style: TextStyle( + color: HmiColors.textWhite, + fontSize: 18, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + // 中间:导航项 + Row( + children: [ + _buildNavItem('首页', isActive: true), + const SizedBox(width: 8), + _buildNavItem('程序管理'), + const SizedBox(width: 8), + _buildNavItem('系统设置'), + ], + ), + // 右侧:时钟 + 状态 + 照明按钮 + Row( + children: [ + Text( + _currentTime, + style: const TextStyle( + color: Color(0xFFFFFFCC), + fontSize: 15, + fontWeight: FontWeight.normal, + ), + ), + const SizedBox(width: 12), + Container( + width: 8, + height: 8, + decoration: const BoxDecoration( + color: HmiColors.success, + shape: BoxShape.circle, + ), + ), + const SizedBox(width: 4), + const Text( + '运行中', + style: TextStyle( + color: HmiColors.success, + fontSize: 15, + fontWeight: FontWeight.w500, + ), + ), + const SizedBox(width: 12), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 8, + ), + decoration: BoxDecoration( + color: HmiColors.bannerLight, + borderRadius: BorderRadius.circular(4), + ), + child: const Row( + children: [ + Icon( + Icons.light_mode, + color: HmiColors.warning, + size: 14, + ), + SizedBox(width: 8), + Text( + '照明', + style: TextStyle( + color: Color(0xFFFFFFCC), + fontSize: 14, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ], + ), + ], + ), + ); + } + + /// 导航项 + Widget _buildNavItem(String title, {bool isActive = false}) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + color: isActive ? HmiColors.bannerDark : Colors.transparent, + borderRadius: BorderRadius.circular(4), + ), + child: Text( + title, + style: TextStyle( + color: isActive ? HmiColors.textWhite : const Color(0xFFFFFFAA), + fontSize: 16, + fontWeight: isActive ? FontWeight.w600 : FontWeight.normal, + ), + ), + ); + } + + /// 主内容区域 + Widget _buildMainBody() { + return Padding( + padding: const EdgeInsets.all(16), + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // 左侧面板 (flex) + Expanded( + flex: 1, + child: _buildLeftPanel(), + ), + const SizedBox(width: 16), + // 右侧面板 (固定 480px) + SizedBox( + width: 480, + child: _buildRightPanel(), + ), + ], + ), + ); + } + + /// 左侧面板:设备预览 + 程序列表 + Widget _buildLeftPanel() { + return Column( + children: [ + _buildDevicePreview(), + const SizedBox(height: 12), + Expanded(child: _buildProgramListSection()), + ], + ); + } + + /// 设备预览卡片 (320px 高度) + Widget _buildDevicePreview() { + return Container( + height: 320, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + gradient: const LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFF1A2332), + Color(0xFF2C4060), + Color(0xFF3D5880), + ], + ), + border: Border.all( + color: HmiColors.border, + width: 1, + ), + ), + clipBehavior: Clip.antiAlias, + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + children: [ + // 顶部行:设备信息 + 状态徽章 + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + '设备信息', + style: TextStyle( + color: HmiColors.textWhite, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 6, + ), + decoration: BoxDecoration( + color: HmiColors.success.withValues(alpha: 0.2), + borderRadius: BorderRadius.circular(12), + ), + child: const Row( + children: [ + Icon(Icons.check_circle, + color: HmiColors.success, size: 14), + SizedBox(width: 6), + Text( + '在线', + style: TextStyle( + color: HmiColors.success, + fontSize: 14, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ], + ), + const Spacer(), + // 底部状态信息栏 + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 10), + decoration: BoxDecoration( + color: const Color(0x11FFFFFF), + borderRadius: BorderRadius.circular(6), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _buildInfoItem('步骤', '3/8'), + _buildInfoDivider(), + _buildInfoItem('剩余时间', '12:35'), + _buildInfoDivider(), + _buildInfoItem('程序', '标准净化'), + ], + ), + ), + ], + ), + ), + ); + } + + /// 信息项 + Widget _buildInfoItem(String label, String value) { + return Row( + children: [ + Text( + label, + style: const TextStyle( + color: Color(0xFFFFFFAA), + fontSize: 13, + ), + ), + const SizedBox(width: 5), + Text( + value, + style: const TextStyle( + color: HmiColors.textWhite, + fontSize: 13, + fontWeight: FontWeight.w600, + ), + ), + ], + ); + } + + /// 信息分隔线 + Widget _buildInfoDivider() { + return Container( + width: 1, + height: 14, + margin: const EdgeInsets.symmetric(horizontal: 16), + color: const Color(0x33FFFFFF), + ); + } + + /// 程序列表区域 + Widget _buildProgramListSection() { + return Container( + decoration: BoxDecoration( + color: HmiColors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: HmiColors.border, + width: 1, + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // 头部 + Padding( + padding: const EdgeInsets.all(16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + '程序列表', + style: TextStyle( + color: HmiColors.textPrimary, + fontSize: 20, + fontWeight: FontWeight.w600, + ), + ), + const Text( + '共 5 个可用程序', + style: TextStyle( + color: HmiColors.textSecondary, + fontSize: 15, + ), + ), + ], + ), + ), + // 程序卡片列表 + Expanded( + child: ListView( + padding: const EdgeInsets.symmetric(horizontal: 16), + children: [ + _buildProgramCard('标准净化程序', '水样预处理流程', isSelected: true), + const SizedBox(height: 8), + _buildProgramCard('快速检测程序', '快速筛查模式', isSelected: false), + const SizedBox(height: 8), + _buildProgramCard('固相萃取程序', 'SPE 固相萃取', isSelected: false), + const SizedBox(height: 8), + _buildProgramCard('液液萃取程序', 'LLE 液液萃取', isSelected: false), + const SizedBox(height: 8), + _buildProgramCard('浓缩定容程序', '样品浓缩处理', isSelected: false), + ], + ), + ), + // 底部链接 + Padding( + padding: const EdgeInsets.all(16), + child: InkWell( + onTap: () {}, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + '查看详情', + style: TextStyle( + color: HmiColors.accent, + fontSize: 16, + fontWeight: FontWeight.w500, + ), + ), + const SizedBox(width: 10), + const Icon( + Icons.chevron_right, + color: HmiColors.accent, + size: 16, + ), + ], + ), + ), + ), + ], + ), + ); + } + + /// 程序卡片 + Widget _buildProgramCard(String title, String desc, {bool isSelected = false}) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + decoration: BoxDecoration( + color: HmiColors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: isSelected ? HmiColors.accent : HmiColors.border, + width: isSelected ? 2 : 1, + ), + ), + child: Row( + children: [ + Container( + width: 4, + height: 32, + decoration: BoxDecoration( + color: isSelected ? HmiColors.accent : Colors.transparent, + borderRadius: BorderRadius.circular(2), + ), + ), + const SizedBox(width: 14), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle( + color: isSelected ? HmiColors.textPrimary : HmiColors.textSecondary, + fontSize: 16, + fontWeight: isSelected ? FontWeight.w600 : FontWeight.w500, + ), + ), + const SizedBox(height: 4), + Text( + desc, + style: const TextStyle( + color: HmiColors.textSecondary, + fontSize: 13, + ), + ), + ], + ), + ), + Icon( + Icons.chevron_right, + color: isSelected ? HmiColors.accent : HmiColors.border, + size: 20, + ), + ], + ), + ); + } + + /// 右侧面板:运行控制 + Widget _buildRightPanel() { + return Column( + children: [ + // 当前选择提示 + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: BoxDecoration( + color: HmiColors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: HmiColors.border, + width: 1, + ), + ), + child: Row( + children: [ + Icon( + Icons.file_present_outlined, + color: HmiColors.textSecondary, + size: 16, + ), + const SizedBox(width: 10), + const Text( + '当前选择: ', + style: TextStyle( + color: HmiColors.textSecondary, + fontSize: 16, + ), + ), + const Text( + '标准净化程序', + style: TextStyle( + color: HmiColors.textPrimary, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + const SizedBox(height: 12), + // 运行控制按钮区域 + Expanded( + child: _buildRunStatusCard(), + ), + ], + ); + } + + /// 运行状态卡片 + Widget _buildRunStatusCard() { + return Container( + decoration: BoxDecoration( + color: HmiColors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: HmiColors.border, + width: 1, + ), + ), + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // 运行控制按钮 + _buildRunButtons(), + const SizedBox(height: 16), + Divider(color: HmiColors.divider, height: 1), + const SizedBox(height: 16), + // 运行状态信息 + _buildRunStatusInfo(), + const SizedBox(height: 16), + Divider(color: HmiColors.divider, height: 1), + const SizedBox(height: 16), + // 进度条 + _buildProgressSection(), + const SizedBox(height: 16), + Divider(color: HmiColors.divider, height: 1), + const SizedBox(height: 16), + // 槽位可视化 + _buildSlotVisualization(), + ], + ), + ), + ); + } + + /// 运行/暂停/停止按钮 + Widget _buildRunButtons() { + return Row( + children: [ + Expanded( + child: SizedBox( + height: 52, + child: ElevatedButton.icon( + onPressed: () {}, + icon: const Icon(Icons.play_arrow, size: 20), + label: const Text( + '运 行', + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.w700, + ), + ), + style: ElevatedButton.styleFrom( + backgroundColor: HmiColors.success, + foregroundColor: HmiColors.textWhite, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + ), + ), + ), + const SizedBox(width: 8), + SizedBox( + width: 100, + height: 52, + child: ElevatedButton.icon( + onPressed: () {}, + icon: const Icon(Icons.pause, size: 16), + label: const Text( + '暂停', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + style: ElevatedButton.styleFrom( + backgroundColor: HmiColors.warning, + foregroundColor: HmiColors.textWhite, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + ), + ), + const SizedBox(width: 8), + SizedBox( + width: 100, + height: 52, + child: ElevatedButton.icon( + onPressed: () {}, + icon: const Icon(Icons.stop, size: 16), + label: const Text( + '停止', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + style: ElevatedButton.styleFrom( + backgroundColor: HmiColors.danger, + foregroundColor: HmiColors.textWhite, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + ), + ), + ], + ); + } + + /// 运行状态信息 + Widget _buildRunStatusInfo() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + '运行状态', + style: TextStyle( + color: HmiColors.textPrimary, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 14, + vertical: 8, + ), + decoration: BoxDecoration( + color: HmiColors.success, + borderRadius: BorderRadius.circular(10), + ), + child: const Row( + children: [ + Icon(Icons.autorenew, color: HmiColors.textWhite, size: 14), + SizedBox(width: 8), + Text( + '运行中 - 步骤 3/8', + style: TextStyle( + color: HmiColors.textWhite, + fontSize: 14, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: 12), + // 信息网格 + Row( + children: [ + Expanded( + child: _buildInfoGridItem('运行时间', '02:15:30'), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInfoGridItem('当前温度', '25.3°C'), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInfoGridItem('流速', '1.2 mL/min'), + ), + ], + ), + const SizedBox(height: 8), + Row( + children: [ + Expanded( + child: _buildInfoGridItem('压力', '0.8 MPa'), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInfoGridItem('pH 值', '7.2'), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInfoGridItem('电导率', '125 μS/cm'), + ), + ], + ), + ], + ); + } + + /// 信息网格项 + Widget _buildInfoGridItem(String label, String value) { + return Container( + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: HmiColors.bg, + borderRadius: BorderRadius.circular(6), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: const TextStyle( + color: HmiColors.textSecondary, + fontSize: 12, + ), + ), + const SizedBox(height: 4), + Text( + value, + style: const TextStyle( + color: HmiColors.textPrimary, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ); + } + + /// 进度条区域 + Widget _buildProgressSection() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + '程序进度', + style: TextStyle( + color: HmiColors.textPrimary, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + const Text( + '37.5%', + style: TextStyle( + color: HmiColors.accent, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + const SizedBox(height: 10), + ClipRRect( + borderRadius: BorderRadius.circular(6), + child: LinearProgressIndicator( + value: 0.375, + backgroundColor: HmiColors.border.withValues(alpha: 0.3), + valueColor: const AlwaysStoppedAnimation(HmiColors.accent), + minHeight: 12, + ), + ), + ], + ); + } + + /// 槽位可视化 + Widget _buildSlotVisualization() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + '样品槽位', + style: TextStyle( + color: HmiColors.textPrimary, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + Text( + '8/12 已装载', + style: const TextStyle( + color: HmiColors.textSecondary, + fontSize: 14, + ), + ), + ], + ), + const SizedBox(height: 10), + Wrap( + spacing: 8, + runSpacing: 8, + children: List.generate(12, (index) { + final isActive = index < 8; + return Container( + width: 48, + height: 32, + decoration: BoxDecoration( + color: isActive + ? HmiColors.success.withValues(alpha: 0.2) + : HmiColors.bg, + borderRadius: BorderRadius.circular(4), + border: Border.all( + color: isActive ? HmiColors.success : HmiColors.border, + width: 1, + ), + ), + alignment: Alignment.center, + child: Text( + '${index + 1}', + style: TextStyle( + color: isActive ? HmiColors.success : HmiColors.textSecondary, + fontSize: 14, + fontWeight: FontWeight.w500, + ), + ), + ); + }), + ), + ], + ); + } +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..2deec3a --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,213 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.13.1" + 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" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.9" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.3" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.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_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.flutter-io.cn" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.1.1" + 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" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.9.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.10.2" + 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: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.6" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "046d3928e16fa4dc46e8350415661755ab759d9fc97fc21b5ab295f71e4f0499" + url: "https://pub.flutter-io.cn" + source: hosted + version: "15.1.0" +sdks: + dart: ">=3.9.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..b761a05 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,89 @@ +name: kuaishai +description: "A new Flutter project." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: ^3.9.0 + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/to/font-from-package diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..954d6c1 --- /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:kuaishai/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); + }); +}