This commit is contained in:
2026-04-15 10:29:27 +08:00
commit a830ad764a
31 changed files with 1604 additions and 0 deletions

45
.gitignore vendored Normal file
View File

@@ -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

30
.metadata Normal file
View File

@@ -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'

View File

@@ -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}

View File

@@ -0,0 +1,3 @@
{
"lastSentAt": "2026-04-15T02:17:25.031Z"
}

View File

@@ -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
}

View File

@@ -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"
}

16
README.md Normal file
View File

@@ -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.

28
analysis_options.yaml Normal file
View File

@@ -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

14
android/.gitignore vendored Normal file
View File

@@ -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

View File

@@ -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 = "../.."
}

View File

@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@@ -0,0 +1,45 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="kuaishai"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>

View File

@@ -0,0 +1,5 @@
package com.xiarui.kuaishai
import io.flutter.embedding.android.FlutterActivity
class MainActivity : FlutterActivity()

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>

View File

@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

24
android/build.gradle.kts Normal file
View File

@@ -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<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}

View File

@@ -0,0 +1,3 @@
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true

View File

@@ -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

View File

@@ -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")

896
lib/main.dart Normal file
View File

@@ -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<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
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<Color>(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,
),
),
);
}),
),
],
);
}
}

213
pubspec.lock Normal file
View File

@@ -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"

89
pubspec.yaml Normal file
View File

@@ -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

30
test/widget_test.dart Normal file
View File

@@ -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);
});
}