[UserItem] Add "showLastSeen" property

This commit is contained in:
xsahil03x
2020-11-19 17:06:44 +05:30
parent 33e91ff188
commit d3ae3a5e4d
+5 -1
View File
@@ -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,
);
}