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