Implement native rating dialog
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
import 'package:rate_my_app/rate_my_app.dart';
|
||||
|
||||
class Globals {
|
||||
static String appDevPhase = 'Beta';
|
||||
static RateMyApp rateMyApp = RateMyApp(
|
||||
appStoreIdentifier: '6747105718',
|
||||
minDays: 15,
|
||||
remindDays: 45,
|
||||
minLaunches: 15,
|
||||
remindLaunches: 40);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:cabo_counter/core/custom_theme.dart';
|
||||
import 'package:cabo_counter/core/globals.dart';
|
||||
import 'package:cabo_counter/data/game_manager.dart';
|
||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||
import 'package:cabo_counter/presentation/views/active_game_view.dart';
|
||||
@@ -29,6 +30,13 @@ class _MainMenuViewState extends State<MainMenuView> {
|
||||
});
|
||||
});
|
||||
gameManager.addListener(_updateView);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
await Globals.rateMyApp.init();
|
||||
if (mounted && Globals.rateMyApp.shouldOpenDialog) {
|
||||
Globals.rateMyApp.showStarRateDialog(context);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _updateView() {
|
||||
|
||||
Reference in New Issue
Block a user