startService method

Future<void> startService({
  1. int intervalSeconds = 5,
})

Implementation

Future<void> startService({int intervalSeconds = 5}) async {
  _timer?.cancel();
  _timer = Timer.periodic(Duration(seconds: intervalSeconds), (timer) async {
    final value = await ActiveWindowPlatform.instance.getActiveWindow();
    _loadData(value);
  });
}