Browse Source

添加新手指引

weicu
tanlongsheng 1 year ago
parent
commit
eaaf6f2bbf
  1. 6
      lib/main.dart
  2. 126
      lib/modules/home/views/home_view.dart
  3. 1
      pubspec.yaml

6
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!,
),
);
},
),

126
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<HomeController> {
// 左侧大卡片 - 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<HomeController> {
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<HomeController> {
// 特性卡片构建方法
Widget _buildFeatureCard({
GlobalKey? key,
required String title,
required String description,
required IconData icon,
@ -713,6 +738,7 @@ class HomeView extends GetView<HomeController> {
Color iconColor = Colors.white,
}) {
return GestureDetector(
key: key,
onTap: onTap,
child: Container(
height: height ?? 175.h,

1
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

Loading…
Cancel
Save