Refact. Flutter web, mid commit (#7494)

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2024-03-24 11:23:06 +08:00
committed by GitHub
parent 96e1b5b0f6
commit 85cafda168
33 changed files with 298 additions and 152 deletions

View File

@@ -1,6 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/consts.dart';
@@ -383,7 +382,7 @@ class ServerModel with ChangeNotifier {
// ugly is here, because for desktop, below is useless
await bind.mainStartService();
updateClientState();
if (Platform.isAndroid) {
if (isAndroid) {
WakelockPlus.enable();
}
}
@@ -395,7 +394,7 @@ class ServerModel with ChangeNotifier {
await parent.target?.invokeMethod("stop_service");
await bind.mainStopService();
notifyListeners();
if (!Platform.isLinux) {
if (!isLinux) {
// current linux is not supported
WakelockPlus.disable();
}