Dart/flutter How To Change The Timer Inside Periodic After Every Time
I'm making a custom logic for showing ads in my app, so when the user opens the app after 1 min pops up an ad then supposed this 1 min to get increased by 1 min every time, So x be
Solution 1:
I think you cannot do it. You can alternatively cancel the current timer and start a new timer based on conditions. Check the following pseudo-code
Timer.periodic(Duration(minutes: 5), (timer) {
if(condition){
timer.cancel();
createNewPeriodicTask();
}
// task code
});
Post a Comment for "Dart/flutter How To Change The Timer Inside Periodic After Every Time"