fix: disabled android service related (#670)

Fixes #662
This commit is contained in:
lollipopkit🏳️‍⚧️
2025-01-07 20:36:12 +08:00
committed by GitHub
parent 7f58237589
commit e7a5f43cc4
3 changed files with 49 additions and 43 deletions

View File

@@ -1,6 +1,5 @@
import 'package:flutter/services.dart';
import 'package:server_box/data/res/misc.dart';
import 'package:server_box/data/res/store.dart';
abstract final class MethodChans {
static const _channel = MethodChannel('${Miscs.pkgName}/main_chan');
@@ -9,14 +8,16 @@ abstract final class MethodChans {
_channel.invokeMethod('sendToBackground');
}
/// Issue #662
static void startService() {
if (Stores.setting.fgService.fetch() != true) return;
_channel.invokeMethod('startService');
// if (Stores.setting.fgService.fetch() != true) return;
// _channel.invokeMethod('startService');
}
/// Issue #662
static void stopService() {
if (Stores.setting.fgService.fetch() != true) return;
_channel.invokeMethod('stopService');
// if (Stores.setting.fgService.fetch() != true) return;
// _channel.invokeMethod('stopService');
}
static void updateHomeWidget() async {