fix part screen voice input and adaption

This commit is contained in:
Chen Li
2025-08-16 14:28:15 +08:00
parent 9715a18c65
commit 8b0f5a92d4
5 changed files with 12 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -24,7 +24,7 @@ class _PartScreenState extends State<PartScreen> {
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
final messageService = Provider.of<MessageService>(context, listen: false); final messageService = Provider.of<MessageService>(context, listen: false);
messageService.initializeEmpty(); messageService.removeNonListeningMessages();
setState(() { setState(() {
_isInitialized = true; _isInitialized = true;
}); });

View File

@@ -381,4 +381,9 @@ class MessageService extends ChangeNotifier {
_messages.clear(); _messages.clear();
notifyListeners(); notifyListeners();
} }
void removeNonListeningMessages() {
_messages.removeWhere((message) => message.status != MessageStatus.listening);
notifyListeners();
}
} }

View File

@@ -329,8 +329,8 @@ class _ChatBubbleState extends State<ChatBubble> {
padding: const EdgeInsets.only(left: 12), padding: const EdgeInsets.only(left: 12),
child: Image.asset( child: Image.asset(
'assets/images/copy.png', 'assets/images/copy.png',
width: 24, width: 22,
height: 24 height: 22
), ),
), ),
), ),
@@ -345,9 +345,9 @@ class _ChatBubbleState extends State<ChatBubble> {
padding: const EdgeInsets.only(left: 12), padding: const EdgeInsets.only(left: 12),
child: _liked child: _liked
? Image.asset('assets/images/liked2.png', ? Image.asset('assets/images/liked2.png',
width: 24, height: 24) width: 22, height: 22)
: Image.asset('assets/images/liked1.png', : Image.asset('assets/images/liked1.png',
width: 24, height: 24), width: 22, height: 22),
), ),
), ),
InkWell( InkWell(
@@ -361,9 +361,9 @@ class _ChatBubbleState extends State<ChatBubble> {
padding: const EdgeInsets.only(left: 12), padding: const EdgeInsets.only(left: 12),
child: _disliked child: _disliked
? Image.asset('assets/images/disliked2.png', ? Image.asset('assets/images/disliked2.png',
width: 24, height: 24) width: 22, height: 22)
: Image.asset('assets/images/disliked1.png', : Image.asset('assets/images/disliked1.png',
width: 24, height: 24)), width: 22, height: 22)),
), ),
], ],
), ),