Browse Source

修改图片

newdev_shunjiawei
tanlongsheng 2 years ago
parent
commit
fdb63fdefe
  1. BIN
      assets/images/explore1.png
  2. BIN
      assets/images/explore2.jpg
  3. BIN
      assets/images/glasses_light.jpg
  4. BIN
      assets/images/robot_dark.png
  5. BIN
      assets/images/robot_light.png
  6. 2
      lib/core/translations/language/en_us.dart
  7. 2
      lib/core/translations/language/zh_cn.dart
  8. 4
      lib/data/services/speech_impl/voice_clone_tts_service.dart
  9. 170
      lib/modules/explore/views/explore_view.dart
  10. 51
      lib/modules/home/views/home_view.dart
  11. 5
      pubspec.yaml

BIN
assets/images/explore1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 KiB

BIN
assets/images/explore2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 KiB

BIN
assets/images/glasses_light.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
assets/images/robot_dark.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 KiB

BIN
assets/images/robot_light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 KiB

2
lib/core/translations/language/en_us.dart

@ -84,6 +84,8 @@ const Map<String, String> enUS = {
// 发现页 // 发现页
"searchAi": "Search AI features...", "searchAi": "Search AI features...",
"exploreSlogan": "Smart Earbuds, Infinite Possibilities", "exploreSlogan": "Smart Earbuds, Infinite Possibilities",
"exploreSlogan1": "Intelligent companion, Infinite Possibilities",
"exploreSlogan2": "Smart glasses, Infinite Possibilities",
"exploreAi": "Explore AI features provided by DeepSound", "exploreAi": "Explore AI features provided by DeepSound",
"aiFunction": "AI Features", "aiFunction": "AI Features",
"allRoundAssistant": "All-round Assistant", "allRoundAssistant": "All-round Assistant",

2
lib/core/translations/language/zh_cn.dart

@ -83,6 +83,8 @@ const Map<String, String> zhCN = {
// 发现页 // 发现页
"searchAi": "搜索AI功能...", "searchAi": "搜索AI功能...",
"exploreSlogan": "智能耳机,无限可能", "exploreSlogan": "智能耳机,无限可能",
"exploreSlogan1": "智能陪伴,无限可能",
"exploreSlogan2": "智能眼镜,无限可能",
"exploreAi": "探索DeepSound提供的AI功能", "exploreAi": "探索DeepSound提供的AI功能",
"aiFunction": "AI功能", "aiFunction": "AI功能",
"allRoundAssistant": "全能助理", "allRoundAssistant": "全能助理",

4
lib/data/services/speech_impl/voice_clone_tts_service.dart

@ -360,7 +360,7 @@ class VoiceCloneTtsService extends GetxService implements TtsService {
Future<bool> stop() async { Future<bool> stop() async {
try { try {
_textQueue.clear(); _textQueue.clear();
_player.stop(); await _player.stop();
_playlist.clear(); _playlist.clear();
_audioBytes = BytesBuilder(); _audioBytes = BytesBuilder();
if (_isSpeaking.value) { if (_isSpeaking.value) {
@ -382,10 +382,10 @@ class VoiceCloneTtsService extends GetxService implements TtsService {
if (!_isInitialized) return; if (!_isInitialized) return;
try { try {
await stop(); await stop();
_player.dispose();
// 关闭事件流控制器 // 关闭事件流控制器
await _eventController.close(); await _eventController.close();
_isInitialized = false; _isInitialized = false;
_player.dispose();
} catch (e) { } catch (e) {
Logger.error('释放资源失败: $e'); Logger.error('释放资源失败: $e');
} }

170
lib/modules/explore/views/explore_view.dart

@ -30,7 +30,38 @@ class ExploreView extends GetView<ExploreController> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// 特色功能 // 特色功能
_buildFeaturedCard(), Container(
height: 180.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24.r),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2),
blurRadius: 10,
offset: const Offset(0, 4),
),
],
),
child: PageView(
children: [
_buildFeaturedCard(
'assets/images/explore.png',
'exploreSlogan'.tr, // 智能耳机,无限可能
'exploreAi'.tr, // 探索DeepSound提供的AI功能
),
_buildFeaturedCard(
'assets/images/explore1.png',
'exploreSlogan1'.tr, // 智能陪伴,无限可能
'exploreAi'.tr, // 探索DeepSound提供的AI功能
),
_buildFeaturedCard(
'assets/images/explore2.jpg',
'exploreSlogan2'.tr, // 智能眼镜,无限可能
'exploreAi'.tr, // 探索DeepSound提供的AI功能
),
],
),
),
// AI功能列表 // AI功能列表
SizedBox(height: 24.h), SizedBox(height: 24.h),
@ -132,90 +163,77 @@ class ExploreView extends GetView<ExploreController> {
} }
// 特色功能卡片 // 特色功能卡片
Widget _buildFeaturedCard() { Widget _buildFeaturedCard(String image, String title, String description) {
return Container( return Stack(
height: 180.h, children: [
decoration: BoxDecoration( // 背景图片
borderRadius: BorderRadius.circular(24.r), ClipRRect(
boxShadow: [ borderRadius: BorderRadius.circular(24.r),
BoxShadow( child: Container(
color: Colors.black.withOpacity(0.2), color: Colors.blue.shade900, // 预设颜色,图片加载失败时显示
blurRadius: 10, child: Image.asset(
offset: const Offset(0, 4), image,
), width: double.infinity,
], height: 180.h,
), fit: BoxFit.cover,
child: Stack( errorBuilder: (context, error, stackTrace) {
children: [ return Container(
// 背景图片 color: Colors.blue.shade900,
ClipRRect( width: double.infinity,
borderRadius: BorderRadius.circular(24.r), height: 180.h,
child: Container( child: Icon(
color: Colors.blue.shade900, // 预设颜色,图片加载失败时显示 Icons.image_not_supported,
child: Image.asset( color: Colors.white,
'assets/images/explore.png', size: 40.sp,
width: double.infinity, ),
height: 180.h, );
fit: BoxFit.cover, },
errorBuilder: (context, error, stackTrace) {
return Container(
color: Colors.blue.shade900,
width: double.infinity,
height: 180.h,
child: Icon(
Icons.image_not_supported,
color: Colors.white,
size: 40.sp,
),
);
},
),
), ),
), ),
),
// 渐变遮罩 // 渐变遮罩
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24.r), borderRadius: BorderRadius.circular(24.r),
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
colors: [ colors: [
Colors.black.withOpacity(0.1), Colors.black.withOpacity(0.1),
Colors.black.withOpacity(0.6), Colors.black.withOpacity(0.6),
], ],
),
), ),
), ),
),
// 文本内容 // 文本内容
Padding( Padding(
padding: EdgeInsets.all(24.w), padding: EdgeInsets.all(24.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'exploreSlogan'.tr, // 智能耳机,无限可能 title,
style: TextStyle( style: TextStyle(
fontSize: 22.sp, fontSize: 22.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
),
), ),
SizedBox(height: 4.h), ),
Text( SizedBox(height: 4.h),
'exploreAi'.tr, // 探索DeepSound提供的AI功能 Text(
style: TextStyle( description,
fontSize: 14.sp, style: TextStyle(
color: Colors.white.withOpacity(0.8), fontSize: 14.sp,
), color: Colors.white.withOpacity(0.8),
), ),
], ),
), ],
), ),
], ),
), ],
); );
} }

51
lib/modules/home/views/home_view.dart

@ -89,9 +89,7 @@ class HomeView extends GetView<HomeController> {
_buildAppBar(isDarkMode), _buildAppBar(isDarkMode),
// 顶部图片 // 顶部图片
Center( _buildEarbudsImage(),
child: _buildEarbudsImage(),
),
SizedBox(height: 20.h), SizedBox(height: 20.h),
// 设备状态卡片 // 设备状态卡片
@ -102,8 +100,6 @@ class HomeView extends GetView<HomeController> {
_buildSectionTitle(isDarkMode), _buildSectionTitle(isDarkMode),
SizedBox(height: 16.h), SizedBox(height: 16.h),
_buildPremiumAILayout(), _buildPremiumAILayout(),
], ],
), ),
), ),
@ -156,15 +152,38 @@ class HomeView extends GetView<HomeController> {
// 耳机图片 // 耳机图片
Widget _buildEarbudsImage() { Widget _buildEarbudsImage() {
final bool isDarkMode = Get.isDarkMode; final bool isDarkMode = Get.isDarkMode;
return Container( return SizedBox(
height: 220.h, height: 220.h,
alignment: Alignment.center, child: PageView(
child: Image.asset( children: [
isDarkMode Center(
? 'assets/images/headphone_dark.png' child: Image.asset(
: 'assets/images/headphone_light.png', isDarkMode
height: 180.h, ? 'assets/images/headphone_dark.png'
fit: BoxFit.contain, : 'assets/images/headphone_light.png',
height: 180.h,
fit: BoxFit.contain,
),
),
Center(
child: Image.asset(
isDarkMode
? 'assets/images/robot_dark.png'
: 'assets/images/robot_light.png',
height: 180.h,
fit: BoxFit.contain,
),
),
Center(
child: Image.asset(
isDarkMode
? 'assets/images/glasses_light.jpg'
: 'assets/images/glasses_light.jpg',
height: 180.h,
fit: BoxFit.contain,
),
),
],
), ),
); );
} }
@ -673,7 +692,8 @@ class HomeView extends GetView<HomeController> {
child: Text( child: Text(
description, description,
style: TextStyle( style: TextStyle(
color: isDarkMode ? Colors.grey[400] : Colors.grey[600], color:
isDarkMode ? Colors.grey[400] : Colors.grey[600],
fontSize: 12.sp, fontSize: 12.sp,
), ),
maxLines: 2, maxLines: 2,
@ -706,7 +726,8 @@ class HomeView extends GetView<HomeController> {
child: Text( child: Text(
description, description,
style: TextStyle( style: TextStyle(
color: isDarkMode ? Colors.grey[400] : Colors.grey[600], color:
isDarkMode ? Colors.grey[400] : Colors.grey[600],
fontSize: 10.sp, fontSize: 10.sp,
), ),
maxLines: 2, maxLines: 2,

5
pubspec.yaml

@ -72,7 +72,12 @@ flutter:
assets: assets:
- assets/images/headphone_light.png - assets/images/headphone_light.png
- assets/images/headphone_dark.png - assets/images/headphone_dark.png
- assets/images/robot_light.png
- assets/images/robot_dark.png
- assets/images/glasses_light.jpg
- assets/images/agents/ - assets/images/agents/
- assets/images/explore.png - assets/images/explore.png
- assets/images/explore1.png
- assets/images/explore2.jpg
- assets/lottie/ - assets/lottie/
- .env - .env

Loading…
Cancel
Save