Implement native rating dialog
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
import 'package:rate_my_app/rate_my_app.dart';
|
||||||
|
|
||||||
class Globals {
|
class Globals {
|
||||||
static String appDevPhase = 'Beta';
|
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/custom_theme.dart';
|
||||||
|
import 'package:cabo_counter/core/globals.dart';
|
||||||
import 'package:cabo_counter/data/game_manager.dart';
|
import 'package:cabo_counter/data/game_manager.dart';
|
||||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||||
import 'package:cabo_counter/presentation/views/active_game_view.dart';
|
import 'package:cabo_counter/presentation/views/active_game_view.dart';
|
||||||
@@ -29,6 +30,13 @@ class _MainMenuViewState extends State<MainMenuView> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
gameManager.addListener(_updateView);
|
gameManager.addListener(_updateView);
|
||||||
|
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
|
await Globals.rateMyApp.init();
|
||||||
|
if (mounted && Globals.rateMyApp.shouldOpenDialog) {
|
||||||
|
Globals.rateMyApp.showStarRateDialog(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _updateView() {
|
void _updateView() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: cabo_counter
|
|||||||
description: "Mobile app for the card game Cabo"
|
description: "Mobile app for the card game Cabo"
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.4.0+382
|
version: 0.4.0+411
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|||||||
Reference in New Issue
Block a user