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
|
langCode: MatrixState
|
||||||
.pangeaController.userController.userL2Code!,
|
.pangeaController.userController.userL2Code!,
|
||||||
),
|
),
|
||||||
|
const SizedBox(),
|
||||||
_SpanCardFeedback(
|
_SpanCardFeedback(
|
||||||
_selectedChoice != null,
|
_selectedChoice != null,
|
||||||
_fetchFeedback,
|
_fetchFeedback,
|
||||||
|
|
@ -217,42 +218,37 @@ class _SpanCardFeedback extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ConstrainedBox(
|
return Column(
|
||||||
constraints: const BoxConstraints(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
minHeight: 50.0,
|
children: [
|
||||||
),
|
ValueListenableBuilder(
|
||||||
child: Column(
|
valueListenable: feedbackState,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
builder: (context, state, __) {
|
||||||
children: [
|
return switch (state) {
|
||||||
ValueListenableBuilder(
|
AsyncIdle<String>() => hasSelectedChoice
|
||||||
valueListenable: feedbackState,
|
? IconButton(
|
||||||
builder: (context, state, __) {
|
onPressed: fetchFeedback,
|
||||||
return switch (state) {
|
icon: const Icon(Icons.lightbulb_outline, size: 24),
|
||||||
AsyncIdle<String>() => hasSelectedChoice
|
)
|
||||||
? IconButton(
|
: Text(
|
||||||
onPressed: fetchFeedback,
|
L10n.of(context).correctionDefaultPrompt,
|
||||||
icon: const Icon(Icons.lightbulb_outline, size: 24),
|
style: BotStyle.text(context).copyWith(
|
||||||
)
|
fontStyle: FontStyle.italic,
|
||||||
: Text(
|
|
||||||
L10n.of(context).correctionDefaultPrompt,
|
|
||||||
style: BotStyle.text(context).copyWith(
|
|
||||||
fontStyle: FontStyle.italic,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
AsyncLoading<String>() => const SizedBox(
|
),
|
||||||
width: 24,
|
AsyncLoading<String>() => const SizedBox(
|
||||||
height: 24,
|
width: 24,
|
||||||
child: CircularProgressIndicator(),
|
height: 24,
|
||||||
),
|
child: CircularProgressIndicator(),
|
||||||
AsyncError<String>(:final error) =>
|
),
|
||||||
ErrorIndicator(message: error.toString()),
|
AsyncError<String>(:final error) =>
|
||||||
AsyncLoaded<String>(:final value) =>
|
ErrorIndicator(message: error.toString()),
|
||||||
Text(value, style: BotStyle.text(context)),
|
AsyncLoaded<String>(:final value) =>
|
||||||
};
|
Text(value, style: BotStyle.text(context)),
|
||||||
},
|
};
|
||||||
),
|
},
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue