From 782e6bc978819003f705c012feccd6b64b38fee0 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 9 May 2020 09:44:41 +0200 Subject: [PATCH] Use theme --- lib/utils/ui_utils.dart | 49 ++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/lib/utils/ui_utils.dart b/lib/utils/ui_utils.dart index 3a8b98d..3e855cd 100644 --- a/lib/utils/ui_utils.dart +++ b/lib/utils/ui_utils.dart @@ -36,31 +36,34 @@ Widget buildErrorCard(String message, {List actions, bool hide = false}) { if (hide) return Container(); - return Card( - elevation: 2.0, - color: Colors.red, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - Padding( - padding: const EdgeInsets.only(right: 8.0), - child: Icon( - Icons.error, - color: Colors.white, + return Theme( + data: + ThemeData(textTheme: TextTheme(body1: TextStyle(color: Colors.white))), + child: Card( + elevation: 2.0, + color: Colors.red, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Icon( + Icons.error, + color: Colors.white, + ), ), - ), - Flexible( - child: Text( - message, - style: TextStyle(color: Colors.white), - maxLines: null, + Flexible( + child: Text( + message, + maxLines: null, + ), ), - ), - Row( - children: actions == null ? [] : actions, - ) - ], + Row( + children: actions == null ? [] : actions, + ) + ], + ), ), ), );