mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
new: iperf
This commit is contained in:
@@ -140,9 +140,13 @@ class ServerProvider extends ChangeNotifier {
|
||||
static final refreshKey = GlobalKey<RefreshIndicatorState>();
|
||||
|
||||
Future<void> startAutoRefresh() async {
|
||||
final duration = Stores.setting.serverStatusUpdateInterval.fetch();
|
||||
var duration = Stores.setting.serverStatusUpdateInterval.fetch();
|
||||
stopAutoRefresh();
|
||||
if (duration == 0) return;
|
||||
if (duration < 0 || duration > 10 || duration == 1) {
|
||||
duration = 3;
|
||||
Loggers.app.warning('Invalid duration: $duration, use default 3');
|
||||
}
|
||||
refreshKey.currentState?.show();
|
||||
_timer = Timer.periodic(Duration(seconds: duration), (_) async {
|
||||
await refreshData();
|
||||
|
||||
Reference in New Issue
Block a user