fix: 修复assets在example app中不能使用的问题 & 加入maven local的链接,修复flutter无法打包 aar的问题
This commit is contained in:
@@ -18,6 +18,7 @@ class AssistantAvatar extends StatelessWidget {
|
||||
child: Image.asset(
|
||||
'assets/images/avatar.png',
|
||||
fit: BoxFit.contain,
|
||||
package: 'ai_chat_assistant',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
break;
|
||||
case MessageStatus.completed:
|
||||
case MessageStatus.success:
|
||||
icon = Image.asset('assets/images/checked.png', width: 20, height: 20);
|
||||
icon = Image.asset('assets/images/checked.png', width: 20, height: 20, package: 'ai_chat_assistant',);
|
||||
color = Colors.white;
|
||||
break;
|
||||
case MessageStatus.failure:
|
||||
@@ -301,7 +301,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: Image.asset('assets/images/copy.png',
|
||||
child: Image.asset('assets/images/copy.png',package: 'ai_chat_assistant',
|
||||
width: 22, height: 22),
|
||||
),
|
||||
),
|
||||
@@ -315,9 +315,9 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: _liked
|
||||
? Image.asset('assets/images/liked2.png',
|
||||
? Image.asset('assets/images/liked2.png',package: 'ai_chat_assistant',
|
||||
width: 22, height: 22)
|
||||
: Image.asset('assets/images/liked1.png',
|
||||
: Image.asset('assets/images/liked1.png',package: 'ai_chat_assistant',
|
||||
width: 22, height: 22),
|
||||
),
|
||||
),
|
||||
@@ -331,9 +331,9 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: _disliked
|
||||
? Image.asset('assets/images/disliked2.png',
|
||||
? Image.asset('assets/images/disliked2.png',package: 'ai_chat_assistant',
|
||||
width: 22, height: 22)
|
||||
: Image.asset('assets/images/disliked1.png',
|
||||
: Image.asset('assets/images/disliked1.png',package: 'ai_chat_assistant',
|
||||
width: 22, height: 22)),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -49,7 +49,7 @@ class _ChatFooterState extends State<ChatFooter>
|
||||
child: GestureDetector(
|
||||
onTap: widget.onClear,
|
||||
child: Image.asset(
|
||||
'assets/images/delete.png',
|
||||
'assets/images/delete.png',package: 'ai_chat_assistant',
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
@@ -137,7 +137,7 @@ class _ChatFooterState extends State<ChatFooter>
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
child: Image.asset(
|
||||
'assets/images/keyboard_mini.png',
|
||||
'assets/images/keyboard_mini.png',package: 'ai_chat_assistant',
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
|
||||
@@ -140,7 +140,7 @@ class _FloatingIconState extends State<FloatingIcon>
|
||||
Intl.getCurrentLocale().startsWith('zh')
|
||||
? _iconImages[_imageIndex]:_iconImagesEn[_imageIndex],
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
height: iconSize,package: 'ai_chat_assistant',
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:ai_chat_assistant/utils/assets_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'mini_audio_wave.dart';
|
||||
|
||||
@@ -36,6 +37,7 @@ class FloatingIconWithWave extends StatelessWidget {
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
fit: BoxFit.contain,
|
||||
package: AssetsUtil.packageName
|
||||
),
|
||||
// 声波动画,距离底部13px的位置
|
||||
Positioned(
|
||||
|
||||
@@ -5,11 +5,14 @@ class RotatingImage extends StatefulWidget {
|
||||
final double size;
|
||||
final Duration duration;
|
||||
|
||||
final String? package; // 添加这个参数
|
||||
|
||||
const RotatingImage({
|
||||
Key? key,
|
||||
required this.imagePath,
|
||||
this.size = 20,
|
||||
this.duration = const Duration(seconds: 3)
|
||||
this.duration = const Duration(seconds: 3),
|
||||
this.package = 'ai_chat_assistant', // 默认值
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -42,7 +45,8 @@ class _RotatingImageState extends State<RotatingImage>
|
||||
child: Image.asset(
|
||||
widget.imagePath,
|
||||
width: widget.size,
|
||||
height: widget.size
|
||||
height: widget.size,
|
||||
package: widget.package, // 使用传入的package参数
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user