fix overflow for number of comments

This commit is contained in:
krawieck 2020-08-29 20:31:53 +02:00
parent 697bbf4e9c
commit 9fabb75676
1 changed files with 11 additions and 3 deletions

View File

@ -298,9 +298,17 @@ class PostWidget extends StatelessWidget {
child: Row(
children: [
Icon(Icons.comment),
post.numberOfComments == 1
? Text(' 1 comment')
: Text(' ${post.numberOfComments} comments'),
if (post.numberOfComments == 1)
Text(' 1 comment')
else
Expanded(
flex: 999,
child: Text(
''' ${NumberFormat.compact().format(post.numberOfComments)} comments''',
overflow: TextOverflow.fade,
softWrap: false,
),
),
Spacer(),
IconButton(
icon: Icon(Icons.share),