1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-02-16 21:52:38 +00:00

Use theme

This commit is contained in:
Pierre HUBERT 2020-05-09 09:44:41 +02:00
parent e7e81da05d
commit 782e6bc978

View File

@ -36,31 +36,34 @@ Widget buildErrorCard(String message,
{List<Widget> actions, bool hide = false}) { {List<Widget> actions, bool hide = false}) {
if (hide) return Container(); if (hide) return Container();
return Card( return Theme(
elevation: 2.0, data:
color: Colors.red, ThemeData(textTheme: TextTheme(body1: TextStyle(color: Colors.white))),
child: Padding( child: Card(
padding: const EdgeInsets.all(8.0), elevation: 2.0,
child: Row( color: Colors.red,
children: <Widget>[ child: Padding(
Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.only(right: 8.0), child: Row(
child: Icon( children: <Widget>[
Icons.error, Padding(
color: Colors.white, padding: const EdgeInsets.only(right: 8.0),
child: Icon(
Icons.error,
color: Colors.white,
),
), ),
), Flexible(
Flexible( child: Text(
child: Text( message,
message, maxLines: null,
style: TextStyle(color: Colors.white), ),
maxLines: null,
), ),
), Row(
Row( children: actions == null ? <Widget>[] : actions,
children: actions == null ? <Widget>[] : actions, )
) ],
], ),
), ),
), ),
); );