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

Flutter plugin that can show specific widgets based on the number of launches and the install time.

Launch Counter #

Flutter plugin that can show specific widgets based on the number of launches and install time.

Pub

Introduction #

We may want to display certain pages or dialogs based on the number of times the user has launched the app or the number of days since the first launch (e.g., to introduce other apps, offer paid plans, request surveys, etc.).

With this package, you can easily display specific Widgets based on the number of launches or install time.

Minimal Example #

Below is the minimal code example. This will be for the basic minimal working of this plugin. The below will show a dialog or navigate to a new screen after the defined minimal days/minimal launches.

Place this in your main widget state :

LaunchCounter launchCounter = LaunchCounter(
  preferencesPrefix: 'launchCounter_',
  minDays: 0, // First day of install.
  minLaunches: 5, // 5 launches of app after minDays is passed.
// remindDays: 10,
// remindLaunches: 10,
);
@override
void initState() {
  super.initState();
  WidgetsBinding.instance.addPostFrameCallback((_) async {
    await launchCounter.init();
    if (mounted && launchCounter.isConditionMet) {
      // Show dialog or navigate to a new screen
    }
  });
}

If you want a more complete example, please check this one on Github.

Notes #

When a dialog or page is displayed, please choose one of the following options using the callEvent method:

  • LaunchCounterEventType.later
  • LaunchCounterEventType.neverShow

Otherwise, the dialog or page will be displayed again when the app is launched next time. Please check this one on Github for more details.

Contributions #

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

5
likes
160
points
659
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin that can show specific widgets based on the number of launches and the install time.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, shared_preferences

More

Packages that depend on launch_counter