@ -77,9 +77,20 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
final String fullText = transcript . text ;
final String fullText = transcript . text ;
int lastEnd = 0 ;
int lastEnd = 0 ;
if ( transcript . sttTokens . isEmpty ) {
return TextSpan (
text: fullText ,
style: BotStyle . text (
context ,
existingStyle: TextStyle (
color: Theme . of ( context ) . colorScheme . onSurface ,
) ,
setColor: false ,
) ,
) ;
}
for ( final token in transcript . sttTokens ) {
for ( final token in transcript . sttTokens ) {
/ / debugPrint ( ' Token confidence: ${ token . confidence } ' ) ;
/ / debugPrint ( ' color: ${ token . color ( context ) } ' ) ;
if ( token . offset > lastEnd ) {
if ( token . offset > lastEnd ) {
/ / Add any plain text before the token
/ / Add any plain text before the token
spans . add (
spans . add (
@ -187,11 +198,16 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
) ,
) ,
] ,
] ,
) ,
) ,
const InlineTooltip (
const Row (
mainAxisSize: MainAxisSize . min ,
children: [
InlineTooltip (
instructionsEnum: InstructionsEnum . speechToText ,
instructionsEnum: InstructionsEnum . speechToText ,
) ,
) ,
] ,
] ,
) ,
) ,
] ,
) ,
) ;
) ;
}
}
}
}