timer in flutter
Future.delayed(Duration(seconds: 1), () {
print('yo hey');
});
timer in flutter
Future.delayed(Duration(seconds: 1), () {
print('yo hey');
});
how to use timer in a widget flutter
Timer _timer;
int seconds = 0;
int minutes = 0;
int hours = 0;
void startTimer() {
const oneSec = const Duration(seconds: 1);
_timer = new Timer.periodic(
oneSec,
(Timer timer) => setState(
() {
if (seconds < 0) {
timer.cancel();
} else {
seconds = seconds + 1;
if (seconds > 59) {
minutes += 1;
seconds = 0;
if (minutes > 59) {
hours += 1;
minutes = 0;
}
}
}
},
),
);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us