1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 21:09:21 +00:00

Reduce containers size for small messages

This commit is contained in:
Pierre HUBERT 2019-05-02 08:29:10 +02:00
parent bc02131045
commit 533d2a86a3

View File

@ -98,7 +98,7 @@ class ConversationMessageTile extends StatelessWidget {
/// Build a message of the current user /// Build a message of the current user
Widget _buildRightMessage(BuildContext context) { Widget _buildRightMessage(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.only(bottom: isLastMessage ? 20.0 : 10.0), margin: EdgeInsets.only(bottom: isLastMessage ? 20.0 : 2.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
@ -119,18 +119,21 @@ class ConversationMessageTile extends StatelessWidget {
Container( Container(
child: message.hasMessage child: message.hasMessage
? Container( ? Container(
width: 200.0,
alignment: Alignment.centerRight,
child: Container(
child: TextRichContentWidget( child: TextRichContentWidget(
message.message, message.message,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
padding: padding: EdgeInsets.fromLTRB(
EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 10.0), 15.0, 10.0, 15.0, 10.0),
width: 200.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.blueAccent, color: Colors.blueAccent,
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
), ),
),
) )
: null, : null,
), ),
@ -191,6 +194,9 @@ class ConversationMessageTile extends StatelessWidget {
Container( Container(
child: message.hasMessage child: message.hasMessage
? Container( ? Container(
width: 200.0,
alignment: Alignment.centerLeft,
child: Container(
child: TextRichContentWidget( child: TextRichContentWidget(
message.message, message.message,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
@ -198,11 +204,11 @@ class ConversationMessageTile extends StatelessWidget {
), ),
padding: padding:
EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 10.0), EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 10.0),
width: 200.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.black12, color: Colors.black12,
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
), ),
),
) )
: null, : null,
), ),