rate_my_app 0.4.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 98

Rate my app ! #

This plugin allows to kindly ask users to rate your app if custom conditions are met (eg. install time, number of launches, etc...).

Rate my app is really inspired by Android-Rate.

How to use #

Installation #

To target an iOS version before 10.3, add this in your Info.plist :


By the way, it's important to note that your bundle identifier (in your Info.plist) must match the App ID on iTunes Connect and the package identifier (in your build.gradle) must match your App ID on Google Play.

If for any reason it doesn't match please go to the Using custom identifiers section.

How it works #

Rate my app takes two parameters :

  1. minDays Minimum elapsed days since the first app launch.
  2. minLaunches Minimum launches.

If everything above is verified, the method shouldOpenDialog will return true (false otherwise). Then you should call showRateDialog which is going to show a native rating dialog on iOS >= 10.3 and a custom rating prompt dialog on Android (and on older iOS versions).

If you prefer, you can call showStarRateDialog which will show a dialog containing a star rating bar that will allow you to take custom actions based on the rating (for example if the user puts less than 3 stars then open your app bugs report page or something like this and if he puts more ask him to rate your app on the store page).

Using custom identifiers #

It's possible to use custom identifiers ! Just pass the following parameters during the plugin initialization :

  1. googlePlayIdentifier Your Google Play identifier (usually a package name).
  2. appStoreIdentifier Your App Store identifier (usually numbers). It's required if you're targeting an iOS version before iOS 10.3.

Screenshots #

On Android #

showRateDialog method.

On iOS #

iOS < 10.3

No screenshot for the moment. If you have one, please don't hesitate to submit it !

iOS >= 10.3

showRateDialog and showStarRateDialog method with ignoreIOS set to false.

Example #

RateMyApp rateMyApp = RateMyApp(
  preferencesPrefix: 'rateMyApp_',
  minDays: 7,
  minLaunches: 10,
  remindDays: 7,
  remindLaunches: 10,

_rateMyApp.init().then((_) {
  if (_rateMyApp.shouldOpenDialog) {
      title: 'Rate this app',
      message: 'If you like this app, please take a little bit of your time to review it !\nIt really helps us and it shouldn\'t take you more than one minute.',
      rateButton: 'RATE',
      noButton: 'NO THANKS',
      laterButton: 'MAYBE LATER',
      ignoreIOS: false,
      dialogStyle: DialogStyle(),
    // Or if you prefer to show a star rating bar :
      title: 'Rate this app',
      message: 'You like this app ? Then take a little bit of your time to leave a rating :',
      onRatingChanged: (stars) {
        return [
            child: Text('OK'),
            onPressed: () {
              print('Thanks for the ' + (stars == null ? '0' : stars.round().toString()) + ' star(s) !');
              // You can handle the result as you want (for instance if the user puts 1 star then open your contact page, if he puts more then open the store page, etc...).
              _rateMyApp.doNotOpenAgain = true;
              _rateMyApp.save().then((v) => Navigator.pop(context));
      ignoreIOS: false,
      dialogStyle: DialogStyle(
        titleAlign: TextAlign.center,
        messageAlign: TextAlign.center,
        messagePadding: EdgeInsets.only(bottom: 20),
      starRatingOptions: StarRatingOptions(),

Contributions #

You have a lot of options to contribute to this project ! You can :

Dependencies #

This library depends on some other libraries :

0.4.0 #

  • Moved some files to the src folder.
  • Added some options that allow you to tweak the dialogs look.

0.3.0+4 #

  • Updated README.

0.3.0+3 #

  • Changed the default stars border color.

0.3.0+2 #

  • Added an option to change the showStarRateDialog style.

0.3.0+1 #

  • Updated README.

0.3.0 #

  • Added an option to ignore iOS checks (when showing a dialog).
  • Added a showStarRateDialog method that allows to show a dialog with stars rating.

0.2.0+4 #

  • preferencesPrefix was not used. As it changes preference keys, this release resets Rate my app user preferences.
  • baseLaunchDate not affected by the Maybe Later button.

0.2.0+3 #

  • Fixed remindLaunches constantly triggering.

0.2.0+2 #

  • Updated README and examples.

0.2.0+1 #

  • Updated minimum SDK version.

0.2.0 #

  • Added the ability to use custom identifiers.
  • Removed a dependency.
  • Fixed a bug where the dialog was not closing after the user successfully clicked on "Rate".

0.1.0 #

  • First published release.


Examples #

If you want a "real project" example, you can check this one on Github.

If you want a little snippet, go to the projet page.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  rate_my_app: ^0.4.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:rate_my_app/rate_my_app.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Nov 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/rate_my_app.dart.

Run flutter format to format lib/rate_my_app.dart.

Format lib/src/core.dart.

Run flutter format to format lib/src/core.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
shared_preferences ^0.5.3 0.5.4+5
smooth_star_rating ^1.0.3 1.0.3
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8