fix connect status colors

This commit is contained in:
rustdesk
2022-09-23 15:12:50 +08:00
parent 95a241bdf4
commit 4f92555399
4 changed files with 23 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
import 'package:contextmenu/contextmenu.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hbb/consts.dart';
import 'package:get/get.dart';
import '../../common.dart';
@@ -156,13 +157,7 @@ class _PeerCardState extends State<_PeerCard>
child: Column(
children: [
Row(children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 4, 4, 4),
child: CircleAvatar(
radius: 5,
backgroundColor: peer.online
? Colors.green
: Colors.yellow)),
getOnline(4, peer.online),
Expanded(
child: Text(
alias.isEmpty ? formatID(peer.id) : alias,
@@ -256,13 +251,7 @@ class _PeerCardState extends State<_PeerCard>
children: [
Expanded(
child: Row(children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 4, 8, 4),
child: CircleAvatar(
radius: 5,
backgroundColor: peer.online
? Colors.green
: Colors.yellow)),
getOnline(4, peer.online),
Expanded(
child: Text(
peer.alias.isEmpty ? formatID(peer.id) : peer.alias,
@@ -991,3 +980,13 @@ void _rdpDialog(String id) async {
);
});
}
Widget getOnline(int rightMargin, bool online) {
return Tooltip(
message: translate(online ? 'Online' : 'Offline'),
waitDuration: const Duration(seconds: 1),
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 4, 8, 4),
child: CircleAvatar(
radius: 3, backgroundColor: online ? Colors.green : kColorWarn)));
}