Skyost / RateMyApp

This plugin allows to kindly ask users to rate your app if custom conditions are met (eg. install time, number of launches, etc...).
https://pub.dev/packages/rate_my_app
MIT License
273 stars 111 forks source link

Star rate + Comment not available at once ? #123

Open zakblacki opened 2 years ago

zakblacki commented 2 years ago

I'm trying to display/show both star rating and comment box at once, but I'm only managing to do one or the other why ? Also remindDaysand remindLaunchesare not working for me it's only showing the first time no matter how many time I restart app not sure what I'm doing wrong

image image

 ` return RateMyAppBuilder(
    rateMyApp: RateMyApp(
        googlePlayIdentifier: '',
        appStoreIdentifier: '',
        minDays: 0,
        minLaunches: 1,
        remindDays: 0,
        remindLaunches: 1,
    ),
  onInitialized: (context, rateMyApp) {
      if(mounted) {
        setState(() => this.rateMyApp = rateMyApp);
      }
    if (rateMyApp.shouldOpenDialog) {
      rateMyApp.showStarRateDialog(
        context,
        //contentBuilder: (context, _) => buildComment(context),
        title: 'Rate this app',
        message:
        'If you like this app, please take a little bit of your time to review it !',
        actionsBuilder: actionsBuilder,
        ignoreNativeDialog: Platform.isAndroid,
        dialogStyle: const DialogStyle( // Custom dialog styles.
          titleAlign: TextAlign.center,
          messageAlign: TextAlign.center,
          messagePadding: EdgeInsets.only(bottom: 20),
        ),
        starRatingOptions: const StarRatingOptions(initialRating: 4), // Custom star bar rating options.
        onDismissed: () => rateMyApp.callEvent(RateMyAppEventType.laterButtonPressed), // Called when the user dismissed the dialog (either by taping outside or by pressing the "back" button).
      );
    }
  },
    builder: (context) => rateMyApp == null ? Center(child: CircularProgressIndicator()) : widget.builder(rateMyApp),
    );`

 Widget buildComment(BuildContext context) => TextFormField(
autofocus: true,
onFieldSubmitted: (_) => Navigator.of(context).pop(),
maxLines: 3,
decoration: InputDecoration(
    hintText: 'Write Comment...', border: OutlineInputBorder()),
 onChanged: (comment) => setState(() => this.comment = comment),
 );