chore: reduce span card spacing to reduce unneeded scroll (#5160)
* chore: reduce span card spacing to reduce unneeded scroll * remove debugging code
This commit is contained in:
parent
2aa0c42994
commit
0f80e9349f
1 changed files with 31 additions and 35 deletions
|
|
@ -182,6 +182,7 @@ class SpanCardState extends State<SpanCard> {
|
|||
langCode: MatrixState
|
||||
.pangeaController.userController.userL2Code!,
|
||||
),
|
||||
const SizedBox(),
|
||||
_SpanCardFeedback(
|
||||
_selectedChoice != null,
|
||||
_fetchFeedback,
|
||||
|
|
@ -217,42 +218,37 @@ class _SpanCardFeedback extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
minHeight: 50.0,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ValueListenableBuilder(
|
||||
valueListenable: feedbackState,
|
||||
builder: (context, state, __) {
|
||||
return switch (state) {
|
||||
AsyncIdle<String>() => hasSelectedChoice
|
||||
? IconButton(
|
||||
onPressed: fetchFeedback,
|
||||
icon: const Icon(Icons.lightbulb_outline, size: 24),
|
||||
)
|
||||
: Text(
|
||||
L10n.of(context).correctionDefaultPrompt,
|
||||
style: BotStyle.text(context).copyWith(
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ValueListenableBuilder(
|
||||
valueListenable: feedbackState,
|
||||
builder: (context, state, __) {
|
||||
return switch (state) {
|
||||
AsyncIdle<String>() => hasSelectedChoice
|
||||
? IconButton(
|
||||
onPressed: fetchFeedback,
|
||||
icon: const Icon(Icons.lightbulb_outline, size: 24),
|
||||
)
|
||||
: Text(
|
||||
L10n.of(context).correctionDefaultPrompt,
|
||||
style: BotStyle.text(context).copyWith(
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
AsyncLoading<String>() => const SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
AsyncError<String>(:final error) =>
|
||||
ErrorIndicator(message: error.toString()),
|
||||
AsyncLoaded<String>(:final value) =>
|
||||
Text(value, style: BotStyle.text(context)),
|
||||
};
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
AsyncLoading<String>() => const SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
AsyncError<String>(:final error) =>
|
||||
ErrorIndicator(message: error.toString()),
|
||||
AsyncLoaded<String>(:final value) =>
|
||||
Text(value, style: BotStyle.text(context)),
|
||||
};
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue