Skip to content

Commit 8574bca

Browse files
committed
Allow the error widget to scroll for longer error messages
1 parent d56c3b2 commit 8574bca

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

lib/helpers/errors.dart

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,19 @@ class FormHttpErrorsWidget extends StatelessWidget {
363363

364364
@override
365365
Widget build(BuildContext context) {
366-
return Column(
367-
children: [
368-
Icon(Icons.error_outline, color: Theme.of(context).colorScheme.error),
369-
...formatApiErrors(
370-
extractErrors(exception.errors),
371-
color: Theme.of(context).colorScheme.error,
366+
return Container(
367+
constraints: const BoxConstraints(maxHeight: 250),
368+
child: SingleChildScrollView(
369+
child: Column(
370+
children: [
371+
Icon(Icons.error_outline, color: Theme.of(context).colorScheme.error),
372+
...formatApiErrors(
373+
extractErrors(exception.errors),
374+
color: Theme.of(context).colorScheme.error,
375+
),
376+
],
372377
),
373-
],
378+
),
374379
);
375380
}
376381
}
@@ -383,15 +388,20 @@ class GeneralErrorsWidget extends StatelessWidget {
383388

384389
@override
385390
Widget build(BuildContext context) {
386-
return Column(
387-
children: [
388-
Icon(Icons.error_outline, color: Theme.of(context).colorScheme.error),
389-
...formatTextErrors(
390-
widgets,
391-
title: title,
392-
color: Theme.of(context).colorScheme.error,
391+
return Container(
392+
constraints: const BoxConstraints(maxHeight: 250),
393+
child: SingleChildScrollView(
394+
child: Column(
395+
children: [
396+
Icon(Icons.error_outline, color: Theme.of(context).colorScheme.error),
397+
...formatTextErrors(
398+
widgets,
399+
title: title,
400+
color: Theme.of(context).colorScheme.error,
401+
),
402+
],
393403
),
394-
],
404+
),
395405
);
396406
}
397407
}

0 commit comments

Comments
 (0)