From b4b872bd2a1fa5f5efdf3ba3e97dd7aa25d50aee Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Wed, 30 Jul 2025 19:03:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E6=89=8B=E6=8C=87?= =?UTF-8?q?=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 6 +- lib/modules/home/views/home_view.dart | 126 ++++++++++++++++---------- pubspec.yaml | 1 + 3 files changed, 82 insertions(+), 51 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 7c5818e36..b35b8380c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_intro/flutter_intro.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:get/get.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; @@ -92,7 +93,10 @@ class MainApp extends StatelessWidget { data: MediaQuery.of(context).copyWith( textScaler: TextScaler.noScaling, ), - child: widget!, + child: Intro( + padding: EdgeInsets.zero, + child: widget!, + ), ); }, ), diff --git a/lib/modules/home/views/home_view.dart b/lib/modules/home/views/home_view.dart index 8bcbac345..18b24b210 100644 --- a/lib/modules/home/views/home_view.dart +++ b/lib/modules/home/views/home_view.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:flutter_intro/flutter_intro.dart'; import 'package:get/get.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../controllers/home_controller.dart'; -import '../../../routes/app_pages.dart'; import '../../../routes/app_routes.dart'; import '../../../core/widgets/common_bottom_nav.dart'; @@ -623,23 +623,32 @@ class HomeView extends GetView { // 左侧大卡片 - AI助理 Expanded( flex: 1, - child: _buildFeatureCard( - title: 'aiAssistant'.tr, // AI全能助手 - description: 'aiAssistantInfo'.tr, // 24小时专属顾问,解答问题、提供建议 - icon: Icons.assistant, - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color(0xFF0066CC).withOpacity(0.3), - Color(0xFF5E5CE6).withOpacity(0.3), - ], + child: IntroStepBuilder( + order: 3, + text: 'AI全能助手', + onHighlightWidgetTap: () { + Intro.of(Get.context!).dispose(); + controller.exploreAIFeatures(); + }, + builder: (BuildContext context, GlobalKey key) => _buildFeatureCard( + key: key, + title: 'aiAssistant'.tr, // AI全能助手 + description: 'aiAssistantInfo'.tr, // 24小时专属顾问,解答问题、提供建议 + icon: Icons.assistant, + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xFF0066CC).withOpacity(0.3), + Color(0xFF5E5CE6).withOpacity(0.3), + ], + ), + onTap: controller.exploreAIFeatures, + iconOnTop: true, + height: 175.h, // 增加高度 + isDarkMode: isDarkMode, + iconColor: const Color(0xFF0066CC), ), - onTap: controller.exploreAIFeatures, - iconOnTop: true, - height: 175.h, // 增加高度 - isDarkMode: isDarkMode, - iconColor: const Color(0xFF0066CC), ), ), @@ -651,47 +660,62 @@ class HomeView extends GetView { child: Column( children: [ // 右上卡片 - 同声翻译 - _buildFeatureCard( - title: 'simultaneousInterpretation'.tr, // 同声传译 - description: - 'simultaneousInterpretationInfo'.tr, // 80+语言实时翻译,出国无忧 - icon: Icons.translate, - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - const Color(0xFF4CAF50).withOpacity(0.3), - const Color(0xFF009688).withOpacity(0.3), - ], + IntroStepBuilder( + order: 1, + text: '同声传译', + // onWidgetLoad: () { + // Intro.of(Get.context!).start(); + // }, + builder: (BuildContext context, GlobalKey key) => + _buildFeatureCard( + key: key, + title: 'simultaneousInterpretation'.tr, // 同声传译 + description: + 'simultaneousInterpretationInfo'.tr, // 80+语言实时翻译,出国无忧 + icon: Icons.translate, + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFF4CAF50).withOpacity(0.3), + const Color(0xFF009688).withOpacity(0.3), + ], + ), + onTap: controller.openTranslation, + height: 83.h, // 增加高度 + isDarkMode: isDarkMode, + iconColor: const Color(0xFF4CAF50), ), - onTap: controller.openTranslation, - height: 83.h, // 增加高度 - isDarkMode: isDarkMode, - iconColor: const Color(0xFF4CAF50), ), SizedBox(height: 5.h), // 减少间距 // 右下卡片 - // 右下卡片 - 会议助手 - _buildFeatureCard( - title: 'conferenceAssistant'.tr, // 商务会议助手 - description: 'conferenceAssistantInfo'.tr, // 实时记录会议纪要,多语言翻译 - icon: Icons.people, - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color(0xFFab47bc).withOpacity(0.3), // 薰衣草紫 - Color(0xFFec407a).withOpacity(0.3), // 品红 - ], + IntroStepBuilder( + order: 2, + text: '商务会议助手', + builder: (BuildContext context, GlobalKey key) => + _buildFeatureCard( + key: key, + title: 'conferenceAssistant'.tr, // 商务会议助手 + description: 'conferenceAssistantInfo'.tr, // 实时记录会议纪要,多语言翻译 + icon: Icons.people, + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xFFab47bc).withOpacity(0.3), // 薰衣草紫 + Color(0xFFec407a).withOpacity(0.3), // 品红 + ], + ), + onTap: () { + Get.toNamed(Routes.meeting); + }, + height: 85.h, // 增加高度 + isDarkMode: isDarkMode, + iconColor: const Color(0xFFd81b60), // 品红 ), - onTap: () { - Get.toNamed(Routes.meeting); - }, - height: 85.h, // 增加高度 - isDarkMode: isDarkMode, - iconColor: const Color(0xFFd81b60), // 品红 ), ], ), @@ -702,6 +726,7 @@ class HomeView extends GetView { // 特性卡片构建方法 Widget _buildFeatureCard({ + GlobalKey? key, required String title, required String description, required IconData icon, @@ -713,6 +738,7 @@ class HomeView extends GetView { Color iconColor = Colors.white, }) { return GestureDetector( + key: key, onTap: onTap, child: Container( height: height ?? 175.h, diff --git a/pubspec.yaml b/pubspec.yaml index 64a6f01ac..fb92cb9b7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,6 +27,7 @@ dependencies: parchment: ^1.24.0 htmltopdfwidgets: ^1.1.0 wifi_iot: ^0.3.19+2 + flutter_intro: ^3.4.0 permission_handler: ^10.4.5 web_socket_channel: ^2.4.0 flutter_dotenv: ^5.1.0