From 66ec42b923eec50738038aa94492fa9ad7b28784 Mon Sep 17 00:00:00 2001 From: Arthi-chaud Date: Sun, 6 Mar 2022 11:53:16 +0100 Subject: [PATCH] Mobile Client: format error message display --- .../lib/src/views/pipeline_detail_page.dart | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/mobile/lib/src/views/pipeline_detail_page.dart b/mobile/lib/src/views/pipeline_detail_page.dart index 983f30b..cbb18eb 100644 --- a/mobile/lib/src/views/pipeline_detail_page.dart +++ b/mobile/lib/src/views/pipeline_detail_page.dart @@ -148,9 +148,45 @@ class _PipelineDetailPageState extends State { child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: const EdgeInsets.only(bottom: 40), + padding: const EdgeInsets.only(bottom: 30), child: cardHeader, ), + pipeline.errorMessage != null + ? Padding( + child: Card( + elevation: 0, + color: Theme.of(context).colorScheme.errorContainer.withAlpha(100), + shape: RoundedRectangleBorder( + side: BorderSide( + color: Theme.of(context).colorScheme.error + ), + borderRadius: const BorderRadius.all(Radius.circular(4)), + ), + child: Padding( + padding: const EdgeInsets.only(right: 10, top: 10, bottom: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(flex: 2, + child: Icon( + Icons.warning, + color: Theme.of(context).colorScheme.onErrorContainer + ) + ), + Expanded(flex: 8, child: Text( + pipeline.errorMessage!, + maxLines: 5, overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Theme.of(context).colorScheme.onErrorContainer + ), + )) + ] + ) + ), + ), + padding: const EdgeInsets.only(bottom: 20), + ) + : Container(), Text(AppLocalizations.of(context).action, style: const TextStyle(fontWeight: FontWeight.w500)), ActionDetailCard(