📜  每 x 秒抖动一次重复动作 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:07.096000             🧑  作者: 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();
}