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

discontinued
outdated

Want to show a widget once periodically (Daily - Weekly - Monthly - Yearly - Any period)? We got your back.

flutter_once #

Built on once. #

Want to show a widget once periodically (Daily - Weekly - Monthly - Yearly - Any period)? We got you.


Some widgets should show OnceWidget.

  • Users should only get the guided widget OnceWidget.
  • Release notes widget should only pop up OnceWidget every new app version comes.
  • Etc.. OnceWidget every (Whatever you want).

OnceWidgets supports showOnce, showOnEveryNewVersion, showEvery12Hours, showHourly, showDaily, showWeekly, showMonthly, showOnNewMonth, showYearly and Custom (Duration).

Usage #

Mainly builder functions consists of builders and fallbacks

  • builder is the generic function that shows and returns a Widget .
  • fallback is the same but only shows in case that callback future returns null (defaults to SizedBox.shrink()).

Now you're ready to go. Say you wanted to view a banner widget when the app is updated:

OnceWidget.showOnEveryNewVersion(
  builder: () {
   return Container(...);
  },
);

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

Once.showWeekly("ratingDialog",
  builder: () {
     return Text('Hello, New Week');
   },
  fallback: () {
     return Text('Hello!');
   },
);

Contributors #

inspired by the java library Once made by Jon Finerty

9
likes
0
pub points
0%
popularity

Publisher

verified publishermosoliman.tech

Want to show a widget once periodically (Daily - Weekly - Monthly - Yearly - Any period)? We got your back.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, once

More

Packages that depend on flutter_once