📜  如何使手表颤动 - 任何代码示例

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

代码示例1
Timer.periodic(Duration(seconds: 1), (timer) {
      var perviousMinute = DateTime.now().add(Duration(seconds: -1)).minute;
      var currentMinute = DateTime.now().minute;
      if (perviousMinute != currentMinute)
        setState(() {
          formattedTime = DateFormat('HH:mm').format(DateTime.now());
        });
    });