mobile peer online status
This commit is contained in:
parent
1f751ddb04
commit
4d7c3f6eb7
@ -74,9 +74,12 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
_showPeerMenu(peer.id);
|
_showPeerMenu(peer.id);
|
||||||
},
|
},
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
contentPadding: const EdgeInsets.only(left: 12),
|
contentPadding: const EdgeInsets.only(left: 12), //
|
||||||
subtitle: Text('${peer.username}@${peer.hostname}'),
|
subtitle: Text('${peer.username}@${peer.hostname}'),
|
||||||
title: Text(peer.alias.isEmpty ? formatID(peer.id) : peer.alias),
|
title: Row(children: [
|
||||||
|
getOnline(4, peer.online),
|
||||||
|
Text(peer.alias.isEmpty ? formatID(peer.id) : peer.alias)
|
||||||
|
]),
|
||||||
leading: Container(
|
leading: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: str2color('${peer.id}${peer.platform}', 0x7f),
|
color: str2color('${peer.id}${peer.platform}', 0x7f),
|
||||||
@ -160,7 +163,7 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(children: [
|
Row(children: [
|
||||||
getOnline(4, peer.online),
|
getOnline(8, peer.online),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
alias.isEmpty ? formatID(peer.id) : alias,
|
alias.isEmpty ? formatID(peer.id) : alias,
|
||||||
@ -252,7 +255,7 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
getOnline(4, peer.online),
|
getOnline(8, peer.online),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
peer.alias.isEmpty ? formatID(peer.id) : peer.alias,
|
peer.alias.isEmpty ? formatID(peer.id) : peer.alias,
|
||||||
@ -997,12 +1000,12 @@ void _rdpDialog(String id) async {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget getOnline(int rightMargin, bool online) {
|
Widget getOnline(double rightPadding, bool online) {
|
||||||
return Tooltip(
|
return Tooltip(
|
||||||
message: translate(online ? 'Online' : 'Offline'),
|
message: translate(online ? 'Online' : 'Offline'),
|
||||||
waitDuration: const Duration(seconds: 1),
|
waitDuration: const Duration(seconds: 1),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(0, 4, 8, 4),
|
padding: EdgeInsets.fromLTRB(0, 4, rightPadding, 4),
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
radius: 3, backgroundColor: online ? Colors.green : kColorWarn)));
|
radius: 3, backgroundColor: online ? Colors.green : kColorWarn)));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user