Flutter package to determine whether to prompt a user to rate your app based on a given criteria.

Overview

should_review

Build codecov pub package License: MIT

This package helps determine if a user should be prompted to rate your app.

The behavior of this package was inspired by the stackoverflow answer at https://stackoverflow.com/a/11284580/2628500 and a couple extra ideas.

You can safely call the determining function Future<bool> shouldReview() of this package every time your app launches or at a particular point in your app to determine if you need to prompt for a review.

Features

  • Determine if you need to prompt user for review based on number of days since first app launch, number of times launched.
  • Determine the above by a custom criteria. (In Progress)

Getting started

Add the below to your pubspec.yaml file.

dependencies:
  should_review: ^0.2.5

As this package doesn't actually prompt users for a review, you will need a plugin or a native implementation or other means to do that for you.

A good candidate is the in_app_review plugin.

Usage

There are currently three ways or criteria with which you can use this package.

  1. Using Days (Criteria.days) criteria (Using number of days since first app launch and subsequent set days interval after that has elapsed).
  2. Using Times Launched (Criteria.timesLaunched) criteria (Using number of times app has been launched).
  3. Using a custom criteria. e.g. made_purchase.

Using Days Criteria

To determine whether to prompt a user for review based on days criteria which is actually the default criteria do the following.

import 'package:should_review/should_review.dart';

if (await ShouldReview.shouldReview()) {
    // Prompt user for review.
    ShouldReview.neverReview(); // This ensures the shouldReview function never returns true again.
}

or outright provide arguments while calling the function as below.

import 'package:should_review/should_review.dart';

if (await ShouldReview.shouldReview(
    criteria: Criteria.days,
    minDays: 5,
    coolDownDays: 2,
    )) {
    // Prompt user for review.
    ShouldReview.neverReview(); // This ensures the shouldReview function never returns true again.
}

NB: The shouldReview function can only return true once a day for all criteria.

Using Launch Times Criteria

To determine whether to prompt a user for review based on launch times criteria do the following.

import 'package:should_review/should_review.dart';

if (await ShouldReview.shouldReview(
    criteria: Criteria.launchTimes,
    minLaunchTimes: 8,
    coolDownLaunchTimes: 4,
    )) {
    // Prompt user for review.
    ShouldReview.neverReview(); // This ensures the shouldReview function never returns true again.
}

NB: For the above to work as expected, there is one thing you have to put in place, which is the recordLaunch function.

The recordLaunch function must be called somewhere in your app that runs once the app is launched. Suitably in your lib\main.dart file or in the initState of your Dashboard widget for instance.

This enables the package record how many times the app was launched and use it while determining review possibility with the times launched criteria.

Using Custom Criteria

If you want to use some other kinds of criteria like when a user performs an action a given number of times, you can use the Criteria.custom criteria and provide a key (e.g. made_purchase) for the action. For this to work as intended, you need to call the recordCustomCriteriaMet function with the same custom key (e.g. made_purchase) every time that action or criteria is met. See an example below.

import 'package:should_review/should_review.dart';

// Every time a purchase is made, the below is called.
ShouldReview.recordCustomCriteriaMet("made_purchase");

if (await ShouldReview.shouldReview(
    criteria: Criteria.custom,
    customCriteriaKey: "made_purchase",
    minCustomCriteriaValue: 5,
    coolDownCustomCriteriaInterval: 2,
    )) {
    // Prompt user for review.
    ShouldReview.neverReview(); // This ensures the shouldReview function never returns true again.
}

NB: minCustomCriteriaValue and customCriteriaKey is required when criteria is set to Criteria.custom. Not providing the two values in this scenario will result in an error.

NB: The coolDown... parameters are nullable. passing null to them will ignore all cool down logic and return false all through.

Parameters

Parameter Description Example Default
criteria The criteria to use for determining if you should prompt a user for review. Criteria.days, Criteria.timesLaunched Criteria.days
minDays The minimum number of days since first app launch to prompt a user for review. 5, 8, 2 5
coolDownDays The number of days after the minimum days has elapsed to prompt a user for review. In other words, if you provided 2 to this parameter, it means that every 2 days, the shouldReview function will return true if neverReview has not been called. 2, 3, 1 2
minLaunchTimes The number of times the app has to be launched before the shouldReview function can return true. 8, 5 5
coolDownLaunchTimes Same as coolDownDays but for the launch times criteria. 3, 5 4
minCustomCriteriaValue The minimum value for the given a given custom criterion. 3, 10 null
coolDownCustomCriteriaInterval Cool down interval value for custom criteria. Similar to coolDownDays and coolDownLaunchTimes. 2, 5 null
customCriteriaKey Custom Criteria Key made_purchase, advanced_a_level, etc. null

Additional information

For a practical example, see the package example section.

Contributing

Pull requests are welcome.

Send pull requests to the develop branch.

For major changes, please open an issue first to discuss what you would like to change.

TODO

  • Determine if user should be prompted for a review based on a custom criteria.
  • Determine if user should be prompted for a review based on aggregated custom criteria.
  • Get next prompt date.
  • Get number of times app launched.
  • Get number of days since first launch.
You might also like...

Venni client app - A flutter ride-sharing end-user app supporting map location picking

Venni client app - A flutter ride-sharing end-user app supporting map location picking, driver location tracking, in-app credit card payments, trip rating system, and trip history.

Jan 3, 2022

A Flutter Package to render Mathematics, Physics and Chemistry Equations based on LaTeX

A Flutter Package to render Mathematics, Physics and Chemistry Equations based on LaTeX

flutter_tex Contents About Demo Video Screenshots How to use? Android iOS Web Examples Quick Example TeXView Document TeXView Markdown TeXView Quiz Te

Jan 5, 2023

A Flutter Package to render Mathematics, Physics and Chemistry Equations based on LaTeX

A Flutter Package to render Mathematics, Physics and Chemistry Equations based on LaTeX

flutter_tex Contents About Demo Video Screenshots How to use? Android iOS Web Examples Quick Example TeXView Document TeXView Markdown TeXView Quiz Te

Jan 5, 2023

A Dart FFI package to send 💬 toasts on Windows. Written in C++, based on WinToast.

A Dart FFI package to send 💬 toasts on Windows. Written in C++, based on WinToast.

desktoasts A Dart package to send native 💬 toasts on Windows. Installation For Flutter dependencies: ... desktoasts: ^0.0.2 For Dart CLI here Sup

Mar 7, 2022

Dart package to rank proposals according to Majority Judgment, using a score-based algorithm for performance and scalability

Majority Judgment for Dart This Dart package helps to resolve polls using Majority Judgment. Features Efficient Majority Judgment algorithm, scales we

Oct 18, 2021

A Package providing Core functionality/Template to start off a Clean Architecture based project

A Package providing Core functionality/Template to start off a Clean Architecture based project Features Provides with APIResult & UseCaseResult model

Dec 25, 2021

An app built using Flutter that performs conversion of bitcoin price with other currencies and displays it to user.

bitcoin_ticker A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

Feb 3, 2022

Sample Flutter Drawing App which allows the user to draw onto the canvas along with color picker and brush thickness slider.

Sample Flutter Drawing App which allows the user to draw onto the canvas along with color picker and brush thickness slider.

DrawApp Sample Flutter Drawing App which allows the user to draw onto the canvas along with color picker and brush thickness slider. All code free to

Nov 3, 2022

A simple flutter app to list the movies added by user

flutter_application A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

Oct 5, 2021
Releases(v0.2.5)
Owner
Francis Ilechukwu
Software Engineer, Aspiring Content Creator.
Francis Ilechukwu
Plant-Disease-Detector - A Flutter app that detects a plant's disease given a photo of an affected part of the plant

Plant Disease Detector A Flutter app that detects a plant's disease given a phot

suis458 5 Dec 14, 2022
A chat-like app that allows students to exchange chargers given port type and the room it is currently located in.

charger_connect A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Lani 2 Dec 22, 2021
Calculates the convex hull of a given set of points.

Calculates the convex hull of a given set of points. Monotone chain is used as algorithm. Info Given a set of points, the convex hull is a subset of p

Daniel 2 Sep 7, 2022
A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully & easily modifiable.

A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully

Muhammad Hamza 21 Jan 1, 2023
A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Burhanuddin Rashid 1k Jan 6, 2023
A mobile image uploader in which you can upload image to your personal gallery from either your camera or mobile gallery and it can detect your current geographic location and address using firebase firestore and storage.

Image Uploader In Flutter About It is an Image Uploader gallery which tracks your address from which you're uploading using Flutter and Image picker.

Prahen parija 6 Dec 20, 2022
Munem Sarker 1 Jan 25, 2022
This App Currently is a Simple Budget Manager Show Analytics Based on Your Past Transactions

Budgex [In Progress] This App Currently is a Simple Budget Manager Show Analytics Based on Your Past Transactions Features Localization Persistant Sto

Mohammad Javad Hossieni 8 Nov 14, 2022
📱 Tracking the impact of COVID-19 cases based on your location, built in Flutter

Installation Download apk here Get on Github Releases, or Build on your own: git clone https://github.com/adityanjr/covid19-tracker.git flutter pub ge

Aditya Singh 33 Dec 26, 2022