Reputation: 15
After setting, I want this checking to be started HH:00, not just after 1 min from set. Do you have any idea of it?
Timer runAlarm() {
return Timer.periodic(Duration(minutes: 1), (timer) async {
workTodo();
}
Upvotes: 1
Views: 979
Reputation: 63799
The concept to get data on start point will be calling the work method before assigning the timer.
workToDo() {
print("data");
}
Timer runAlarm() {
workToDo();
return Timer.periodic(duration, (timer) {
workToDo();
});
}
Upvotes: 2