You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
170 lines
4.3 KiB
170 lines
4.3 KiB
import 'package:get/get.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class AIFeature {
|
|
final String title;
|
|
final String description;
|
|
final IconData icon;
|
|
final Color startColor;
|
|
final Color endColor;
|
|
final Color iconBgColor;
|
|
final Color iconColor;
|
|
|
|
AIFeature({
|
|
required this.title,
|
|
required this.description,
|
|
required this.icon,
|
|
required this.startColor,
|
|
required this.endColor,
|
|
required this.iconBgColor,
|
|
required this.iconColor,
|
|
});
|
|
}
|
|
|
|
class FunctionScene {
|
|
final String title;
|
|
final String description;
|
|
final IconData icon;
|
|
final Color startColor;
|
|
final Color endColor;
|
|
final Color iconColor;
|
|
|
|
FunctionScene({
|
|
required this.title,
|
|
required this.description,
|
|
required this.icon,
|
|
required this.startColor,
|
|
required this.endColor,
|
|
required this.iconColor,
|
|
});
|
|
}
|
|
|
|
class ExploreController extends GetxController {
|
|
// 搜索关键词
|
|
final searchController = TextEditingController();
|
|
|
|
// AI功能列表
|
|
final List<AIFeature> aiFeatures = [
|
|
AIFeature(
|
|
title: '同声翻译',
|
|
description: '实时翻译40+种语言',
|
|
icon: Icons.translate,
|
|
startColor: Colors.blue.shade100,
|
|
endColor: Colors.blue.shade200,
|
|
iconBgColor: Colors.blue.withOpacity(0.2),
|
|
iconColor: Colors.blue.shade600,
|
|
),
|
|
AIFeature(
|
|
title: 'AI女友',
|
|
description: '智能陪伴,随时聊天',
|
|
icon: Icons.favorite,
|
|
startColor: Colors.pink.shade100,
|
|
endColor: Colors.pink.shade200,
|
|
iconBgColor: Colors.pink.withOpacity(0.2),
|
|
iconColor: Colors.pink.shade600,
|
|
),
|
|
AIFeature(
|
|
title: '音乐创作',
|
|
description: '用AI创作专属音乐',
|
|
icon: Icons.music_note,
|
|
startColor: Colors.green.shade100,
|
|
endColor: Colors.green.shade200,
|
|
iconBgColor: Colors.green.withOpacity(0.2),
|
|
iconColor: Colors.green.shade600,
|
|
),
|
|
AIFeature(
|
|
title: '声音克隆',
|
|
description: '创建你的数字声音',
|
|
icon: Icons.mic,
|
|
startColor: Colors.amber.shade100,
|
|
endColor: Colors.amber.shade200,
|
|
iconBgColor: Colors.amber.withOpacity(0.2),
|
|
iconColor: Colors.amber.shade600,
|
|
),
|
|
];
|
|
|
|
// 热门功能场景列表
|
|
final List<FunctionScene> functionScenes = [
|
|
FunctionScene(
|
|
title: '商务会议助手',
|
|
description: '实时记录会议纪要,多语言翻译',
|
|
icon: Icons.people,
|
|
startColor: Colors.blue.shade200,
|
|
endColor: Colors.blue.shade300,
|
|
iconColor: Colors.blue.shade600,
|
|
),
|
|
FunctionScene(
|
|
title: '语言学习助手',
|
|
description: '发音纠正,实时练习口语',
|
|
icon: Icons.school,
|
|
startColor: Colors.green.shade200,
|
|
endColor: Colors.green.shade300,
|
|
iconColor: Colors.green.shade600,
|
|
),
|
|
FunctionScene(
|
|
title: '旅行翻译助手',
|
|
description: '实时语音翻译,旅游景点介绍',
|
|
icon: Icons.language,
|
|
startColor: Colors.amber.shade200,
|
|
endColor: Colors.amber.shade300,
|
|
iconColor: Colors.amber.shade600,
|
|
),
|
|
];
|
|
|
|
// 搜索功能
|
|
void search() {
|
|
if (searchController.text.isEmpty) return;
|
|
|
|
Get.snackbar(
|
|
'搜索',
|
|
'正在搜索: ${searchController.text}',
|
|
snackPosition: SnackPosition.TOP,
|
|
);
|
|
|
|
// 实际应用中,这里应该实现真正的搜索逻辑
|
|
searchController.clear();
|
|
}
|
|
|
|
// 点击AI功能
|
|
void onAIFeatureTap(int index) {
|
|
if (index < 0 || index >= aiFeatures.length) return;
|
|
|
|
Get.snackbar(
|
|
'功能',
|
|
'您选择了: ${aiFeatures[index].title}',
|
|
snackPosition: SnackPosition.TOP,
|
|
);
|
|
|
|
// 实际应用中,这里应该跳转到对应的功能页面
|
|
}
|
|
|
|
// 点击功能场景
|
|
void onFunctionSceneTap(int index) {
|
|
if (index < 0 || index >= functionScenes.length) return;
|
|
|
|
Get.snackbar(
|
|
'场景',
|
|
'您选择了: ${functionScenes[index].title}',
|
|
snackPosition: SnackPosition.TOP,
|
|
);
|
|
|
|
// 实际应用中,这里应该跳转到对应的场景页面
|
|
}
|
|
|
|
// 尝试新功能
|
|
void tryNewFeature() {
|
|
Get.snackbar(
|
|
'新功能',
|
|
'您选择了尝试AI歌手模式',
|
|
snackPosition: SnackPosition.TOP,
|
|
);
|
|
|
|
// 实际应用中,这里应该跳转到新功能页面
|
|
}
|
|
|
|
@override
|
|
void onClose() {
|
|
searchController.dispose();
|
|
super.onClose();
|
|
}
|
|
}
|