📜  颤振每秒在后台运行 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:05.601000             🧑  作者: Mango

代码示例1
Timer timer;

@override
void initState() {
  super.initState();
  timer = Timer.periodic(Duration(seconds: 15), (Timer t) => checkForNewSharedLists());
}

@override
void dispose() {
  timer?.cancel();
  super.dispose();
}