From d3ae3a5e4d6d58d6c669c4661938d7165d7fd82e Mon Sep 17 00:00:00 2001 From: xsahil03x Date: Thu, 19 Nov 2020 17:06:44 +0530 Subject: [PATCH] [UserItem] Add "showLastSeen" property --- lib/src/user_item.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/user_item.dart b/lib/src/user_item.dart index ef442440..d4331cf8 100644 --- a/lib/src/user_item.dart +++ b/lib/src/user_item.dart @@ -24,6 +24,7 @@ class UserItem extends StatelessWidget { this.onLongPress, this.onImageTap, this.selected = false, + this.showLastSeen = true, }) : super(key: key); /// Function called when tapping this widget @@ -41,6 +42,9 @@ class UserItem extends StatelessWidget { /// If true the [UserItem] will show a trailing checkmark final bool selected; + /// If true the [UserItem] will show the last seen + final bool showLastSeen; + @override Widget build(BuildContext context) { return ListTile( @@ -72,7 +76,7 @@ class UserItem extends StatelessWidget { ) : null, title: Text(user.name), - subtitle: _buildLastActive(context), + subtitle: showLastSeen ? _buildLastActive(context) : null, ); }