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

Exception when startin RateMyApp for native ratings #96

Closed Arcturus5404 closed 3 years ago

Arcturus5404 commented 3 years ago

Describe the bug When calling the showRateDialog method with ignoreNativeDialog: false, an exception is being thrown:

E/flutter ( 6167): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type 'Future<bool?>' is not a subtype of type 'FutureOr' in type cast E/flutter ( 6167): #0 RateMyApp.showRateDialog (package:rate_my_app/src/core.dart:128:46) E/flutter ( 6167): #1 _StartScreenState._showRateMyApp (package:paintmaster/screens/start_screen.dart:342:24) E/flutter ( 6167): #2 _StartScreenState.initState. (package:paintmaster/screens/start_screen.dart:335:9) E/flutter ( 6167):

To Reproduce Steps to reproduce the behavior:

  1. Call the method, see an exception

Expected behavior No exceptions, I am not sure if the rate dialog works right now

Screenshots The app runs fine though

Arcturus5404 commented 3 years ago

I think the fix is simple. The as Future<bool> should be Future<bool?>

Skyost commented 3 years ago

You're right, thanks for reporting !