debug, mobile, connection state

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-06-23 14:29:58 +08:00
parent e6c3c55b39
commit ef102bdf94
4 changed files with 5 additions and 7 deletions

View File

@ -11,7 +11,6 @@ import '../../common/widgets/login.dart';
import '../../common/widgets/peer_tab_page.dart';
import '../../consts.dart';
import '../../models/model.dart';
import '../../models/state_model.dart';
import '../../models/platform_model.dart';
import 'home_page.dart';
import 'scan_page.dart';
@ -55,7 +54,6 @@ class _ConnectionPageState extends State<ConnectionPage> {
}
}();
}
stateGlobal.startSvcStatusTimer();
if (isAndroid) {
Timer(const Duration(seconds: 5), () async {
_updateUrl = await bind.mainGetSoftwareUpdateUrl();
@ -182,7 +180,6 @@ class _ConnectionPageState extends State<ConnectionPage> {
@override
void dispose() {
_idController.dispose();
stateGlobal.cancelSvcStatusTimer();
super.dispose();
}
}

View File

@ -201,7 +201,6 @@ class ServerInfo extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isPermanent = model.verificationMethod == kUsePermanentPassword;
final serverModel = Provider.of<ServerModel>(context);
const Color colorPositive = Colors.green;
const Color colorNegative = Colors.red;

View File

@ -15,7 +15,8 @@ import '../common/formatter/id_formatter.dart';
import '../desktop/pages/server_page.dart' as desktop;
import '../desktop/widgets/tabbar_widget.dart';
import '../mobile/pages/server_page.dart';
import 'model.dart';
import './model.dart';
import './state_model.dart';
const kLoginDialogTag = "LOGIN";
@ -117,6 +118,7 @@ class ServerModel with ChangeNotifier {
_serverId = IDTextEditingController(text: _emptyIdShow);
timerCallback() async {
stateGlobal.updateSvcStatus();
if (desktopType == DesktopType.cm) {
final res = await bind.cmCheckClientsLength(length: _clients.length);
if (res != null) {

View File

@ -95,7 +95,7 @@ class StateGlobal {
startSvcStatusTimer() {
_svcStatusTimer = periodic_immediate(Duration(seconds: 1), () async {
_updateSvcStatus();
updateSvcStatus();
});
}
@ -104,7 +104,7 @@ class StateGlobal {
_svcStatusTimer = null;
}
_updateSvcStatus() async {
updateSvcStatus() async {
final status =
jsonDecode(await bind.mainGetConnectStatus()) as Map<String, dynamic>;
final statusNum = status['status_num'] as int;