Skip to content

Commit 531633f

Browse files
committed
chore: make speech to text card scrollable
1 parent 1bae4c8 commit 531633f

File tree

1 file changed

+35
-41
lines changed

1 file changed

+35
-41
lines changed

lib/pangea/toolbar/widgets/message_speech_to_text_card.dart

+35-41
Original file line numberDiff line numberDiff line change
@@ -176,52 +176,46 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
176176
}
177177

178178
//TODO: find better icons
179-
return Padding(
180-
padding: const EdgeInsets.all(16),
181-
child: Column(
182-
mainAxisSize: MainAxisSize.min,
183-
children: [
184-
const SizedBox(height: 8),
185-
RichText(
186-
text: transcriptText!,
187-
),
188-
if (widget.messageEvent.senderId == Matrix.of(context).client.userID)
189-
Column(
190-
children: [
191-
const SizedBox(height: 6),
192-
Row(
193-
mainAxisSize: MainAxisSize.min,
179+
return ConstrainedBox(
180+
constraints: const BoxConstraints(
181+
maxWidth: AppConfig.toolbarMinWidth,
182+
maxHeight: AppConfig.toolbarMaxHeight,
183+
),
184+
child: SingleChildScrollView(
185+
child: Padding(
186+
padding: const EdgeInsets.all(16),
187+
child: Column(
188+
mainAxisSize: MainAxisSize.min,
189+
children: [
190+
const SizedBox(height: 8),
191+
RichText(
192+
text: transcriptText!,
193+
),
194+
if (widget.messageEvent.senderId ==
195+
Matrix.of(context).client.userID)
196+
Column(
194197
children: [
195-
// IconNumberWidget(
196-
// icon: Symbols.target,
197-
// number:
198-
// "${selectedToken?.confidence ?? speechToTextResponse!.transcript.confidence}%",
199-
// toolTip: L10n.of(context).accuracy,
200-
// ),
201-
// const SizedBox(width: 16),
202-
IconNumberWidget(
203-
icon: Icons.speed,
204-
number: wordsPerMinuteString != null
205-
? "$wordsPerMinuteString"
206-
: "??",
207-
toolTip: L10n.of(context).wordsPerMinute,
198+
const SizedBox(height: 16),
199+
Row(
200+
mainAxisSize: MainAxisSize.min,
201+
children: [
202+
IconNumberWidget(
203+
icon: Icons.speed,
204+
number: wordsPerMinuteString != null
205+
? "$wordsPerMinuteString"
206+
: "??",
207+
toolTip: L10n.of(context).wordsPerMinute,
208+
),
209+
],
208210
),
209-
],
210-
),
211-
const Row(
212-
mainAxisSize: MainAxisSize.min,
213-
children: [
214-
Expanded(
215-
flex: 1,
216-
child: InstructionsInlineTooltip(
217-
instructionsEnum: InstructionsEnum.speechToText,
218-
),
211+
const InstructionsInlineTooltip(
212+
instructionsEnum: InstructionsEnum.speechToText,
219213
),
220214
],
221215
),
222-
],
223-
),
224-
],
216+
],
217+
),
218+
),
225219
),
226220
);
227221
}

0 commit comments

Comments
 (0)