[UserItem] Add "showLastSeen" property
This commit is contained in:
@@ -24,6 +24,7 @@ class UserItem extends StatelessWidget {
|
|||||||
this.onLongPress,
|
this.onLongPress,
|
||||||
this.onImageTap,
|
this.onImageTap,
|
||||||
this.selected = false,
|
this.selected = false,
|
||||||
|
this.showLastSeen = true,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
/// Function called when tapping this widget
|
/// Function called when tapping this widget
|
||||||
@@ -41,6 +42,9 @@ class UserItem extends StatelessWidget {
|
|||||||
/// If true the [UserItem] will show a trailing checkmark
|
/// If true the [UserItem] will show a trailing checkmark
|
||||||
final bool selected;
|
final bool selected;
|
||||||
|
|
||||||
|
/// If true the [UserItem] will show the last seen
|
||||||
|
final bool showLastSeen;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
@@ -72,7 +76,7 @@ class UserItem extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
title: Text(user.name),
|
title: Text(user.name),
|
||||||
subtitle: _buildLastActive(context),
|
subtitle: showLastSeen ? _buildLastActive(context) : null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user