once 1.0.0 copy "once: ^1.0.0" to clipboard
once: ^1.0.0 copied to clipboard

outdated

Want to run a piece of code once (Only - Week - Month - Year - Any duration)? We got you.

once #

Want to run a piece of code once (Once - Hourly - Daily - Weekly - Monthly - Every new vetsion - Any Custom duration)? We got your back.


Some things should happen once.

  • Users should only get the guided tour once.
  • Release notes should only pop up once every mew app version come.
  • Your app should only phone home to update content once every hour.
  • Etc.. once every (What ever you want).

Once supports runOnce, runEvery12Hours, runHourly, runDaily, runWeekly, runMonthly, runOnNewMonth, runYearly and Custom (Duration).

Usage #

Done on the time that you want the thing to be done #

Now you're ready to go. Say you wanted to show the new features dialog when the app is updated:

Once.runOnEveryNewVersion(() {
    /* What's new in 2.3.2 version? dialog */
});

Or maybe you want to show the rate this app dialog every week for the user:

if (!rated){
  Once.runWeekly("ratingDialog",() { 
    /* Like our app, Please rate us. dialog */ 
  });
}

Contributors #

inspired by the java library Once made by Jon Finerty

186
likes
0
pub points
90%
popularity

Publisher

verified publishermosoliman.tech

Want to run a piece of code once (Only - Week - Month - Year - Any duration)? We got you.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

package_info_plus, shared_preferences

More

Packages that depend on once