mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
opt.: display err if home widget fails (#659)
This commit is contained in:
25
lib/core/chan.dart
Normal file
25
lib/core/chan.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:server_box/data/res/misc.dart';
|
||||
|
||||
abstract final class MethodChans {
|
||||
static const _channel = MethodChannel('${Miscs.pkgName}/main_chan');
|
||||
|
||||
static void moveToBg() {
|
||||
_channel.invokeMethod('sendToBackground');
|
||||
}
|
||||
|
||||
/// TODO: try fix the fn, then uncomment it and [stopService]
|
||||
/// Issues #639
|
||||
static void startService() {
|
||||
// _channel.invokeMethod('startService');
|
||||
}
|
||||
|
||||
static void stopService() {
|
||||
// _channel.invokeMethod('stopService');
|
||||
}
|
||||
|
||||
static void updateHomeWidget() async {
|
||||
//if (!Stores.setting.autoUpdateHomeWidget.fetch()) return;
|
||||
await _channel.invokeMethod('updateHomeWidget');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user