Change last seen text to last online
This commit is contained in:
@@ -939,7 +939,7 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
|||||||
key: ObjectKey(user),
|
key: ObjectKey(user),
|
||||||
user: user,
|
user: user,
|
||||||
selected: true,
|
selected: true,
|
||||||
showLastSeen: false,
|
showLastOnline: false,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class UserItem extends StatelessWidget {
|
|||||||
this.onLongPress,
|
this.onLongPress,
|
||||||
this.onImageTap,
|
this.onImageTap,
|
||||||
this.selected = false,
|
this.selected = false,
|
||||||
this.showLastSeen = true,
|
this.showLastOnline = true,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
/// Function called when tapping this widget
|
/// Function called when tapping this widget
|
||||||
@@ -43,7 +43,7 @@ class UserItem extends StatelessWidget {
|
|||||||
final bool selected;
|
final bool selected;
|
||||||
|
|
||||||
/// If true the [UserItem] will show the last seen
|
/// If true the [UserItem] will show the last seen
|
||||||
final bool showLastSeen;
|
final bool showLastOnline;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -81,11 +81,11 @@ class UserItem extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
title: Text(user.name,style: TextStyle(fontWeight: FontWeight.bold),),
|
title: Text(user.name,style: TextStyle(fontWeight: FontWeight.bold),),
|
||||||
subtitle: showLastSeen ? _buildLastActive(context) : null,
|
subtitle: showLastOnline ? _buildLastActive(context) : null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildLastActive(context) {
|
Widget _buildLastActive(context) {
|
||||||
return Text('Last seen ${Jiffy(user.lastActive).fromNow()}');
|
return Text('Last online ${Jiffy(user.lastActive).fromNow()}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user