Add app rating
This commit is contained in:
parent
74f1fe5475
commit
4e5998da61
4 changed files with 44 additions and 1 deletions
|
|
@ -155,6 +155,9 @@ PODS:
|
||||||
- PromisesObjC (= 2.4.0)
|
- PromisesObjC (= 2.4.0)
|
||||||
- quick_actions_ios (0.0.1):
|
- quick_actions_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- rate_my_app (2.3.0):
|
||||||
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
- shared_preferences_foundation (0.0.1):
|
- shared_preferences_foundation (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
|
|
@ -168,6 +171,7 @@ DEPENDENCIES:
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- flutter_background_geolocation (from `.symlinks/plugins/flutter_background_geolocation/ios`)
|
- flutter_background_geolocation (from `.symlinks/plugins/flutter_background_geolocation/ios`)
|
||||||
- quick_actions_ios (from `.symlinks/plugins/quick_actions_ios/ios`)
|
- quick_actions_ios (from `.symlinks/plugins/quick_actions_ios/ios`)
|
||||||
|
- rate_my_app (from `.symlinks/plugins/rate_my_app/darwin`)
|
||||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
|
|
@ -207,6 +211,8 @@ EXTERNAL SOURCES:
|
||||||
:path: ".symlinks/plugins/flutter_background_geolocation/ios"
|
:path: ".symlinks/plugins/flutter_background_geolocation/ios"
|
||||||
quick_actions_ios:
|
quick_actions_ios:
|
||||||
:path: ".symlinks/plugins/quick_actions_ios/ios"
|
:path: ".symlinks/plugins/quick_actions_ios/ios"
|
||||||
|
rate_my_app:
|
||||||
|
:path: ".symlinks/plugins/rate_my_app/darwin"
|
||||||
shared_preferences_foundation:
|
shared_preferences_foundation:
|
||||||
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||||
|
|
||||||
|
|
@ -236,6 +242,7 @@ SPEC CHECKSUMS:
|
||||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||||
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
||||||
quick_actions_ios: 4b07fb49d8d8f3518d7565fbb7a91014067a7d82
|
quick_actions_ios: 4b07fb49d8d8f3518d7565fbb7a91014067a7d82
|
||||||
|
rate_my_app: 567848e885b804d65eb9443f96e9fc2c30a06abb
|
||||||
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
|
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
|
||||||
|
|
||||||
PODFILE CHECKSUM: f8c2dcdfb50bb67645580d28a6bf814fca30bdec
|
PODFILE CHECKSUM: f8c2dcdfb50bb67645580d28a6bf814fca30bdec
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
import 'package:flutter_background_geolocation/flutter_background_geolocation.dart' as bg;
|
import 'package:flutter_background_geolocation/flutter_background_geolocation.dart' as bg;
|
||||||
|
import 'package:rate_my_app/rate_my_app.dart';
|
||||||
import 'package:traccar_client/quick_actions.dart';
|
import 'package:traccar_client/quick_actions.dart';
|
||||||
|
|
||||||
import 'main_screen.dart';
|
import 'main_screen.dart';
|
||||||
|
|
@ -17,9 +18,27 @@ void main() async {
|
||||||
runApp(const MainApp());
|
runApp(const MainApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
class MainApp extends StatelessWidget {
|
class MainApp extends StatefulWidget {
|
||||||
const MainApp({super.key});
|
const MainApp({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MainApp> createState() => _MainAppState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MainAppState extends State<MainApp> {
|
||||||
|
RateMyApp rateMyApp = RateMyApp(minDays: 0, minLaunches: 0);
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
|
await rateMyApp.init();
|
||||||
|
if (mounted && rateMyApp.shouldOpenDialog) {
|
||||||
|
rateMyApp.showRateDialog(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
|
|
|
||||||
16
pubspec.lock
16
pubspec.lock
|
|
@ -195,6 +195,14 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_rating_bar:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_rating_bar
|
||||||
|
sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.1"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
@ -349,6 +357,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
rate_my_app:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: rate_my_app
|
||||||
|
sha256: "9ce6239399c9df6f40786cfc0214ec9bcaa44f9ae12fecff5e89c6f8022db3f8"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.1"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ dependencies:
|
||||||
firebase_analytics: ^11.4.5
|
firebase_analytics: ^11.4.5
|
||||||
firebase_crashlytics: ^4.3.5
|
firebase_crashlytics: ^4.3.5
|
||||||
quick_actions: ^1.1.0
|
quick_actions: ^1.1.0
|
||||||
|
rate_my_app: ^2.3.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue