diff --git a/lib/view/pages/more/overhang.dart b/lib/view/pages/more/overhang.dart index edd6ac3..23a5b69 100644 --- a/lib/view/pages/more/overhang.dart +++ b/lib/view/pages/more/overhang.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:in_app_review/in_app_review.dart'; +import 'package:marianum_mobile/widget/infoDialog.dart'; import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart'; import '../../../widget/ListItem.dart'; @@ -38,13 +40,33 @@ class Overhang extends StatelessWidget { trailing: const Icon(Icons.arrow_right), onTap: () => showDialog(context: context, builder: (context) => const SelectShareTypeDialog()) ), + FutureBuilder( + future: InAppReview.instance.isAvailable(), + builder: (context, snapshot) { + if(!snapshot.hasData) return const SizedBox.shrink(); + + return Visibility( + visible: snapshot.requireData, + child: ListTile( + leading: const CenteredLeading(Icon(Icons.star_rate_outlined)), + title: const Text("App Bewerten"), + onTap: () { + InAppReview.instance.openStoreListing(appStoreId: "6458789560").then( + (value) => InfoDialog.show(context, "Vielen Dank!"), + onError: (error) => InfoDialog.show(context, error.toString()) + ); + }, + ), + ); + }, + ), ListTile( leading: const CenteredLeading(Icon(Icons.feedback_outlined)), title: const Text("Du hast eine Idee?"), subtitle: const Text("Fehler und Verbessungsvorschläge"), trailing: const Icon(Icons.arrow_right), onTap: () => showDialog(context: context, barrierDismissible: false, builder: (context) => const FeedbackDialog()), - ) + ), ], ), ); diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 162c289..6058252 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,6 +12,7 @@ import firebase_core import firebase_messaging import flutter_app_badger import flutter_local_notifications +import in_app_review import package_info import path_provider_foundation import share_plus @@ -28,6 +29,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FlutterAppBadgerPlugin.register(with: registry.registrar(forPlugin: "FlutterAppBadgerPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) + InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin")) FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) diff --git a/pubspec.yaml b/pubspec.yaml index 06c92f3..f377674 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -96,6 +96,7 @@ dependencies: rrule_generator: ^0.5.6 rrule: ^0.2.16 time_range_picker: ^2.2.0 + in_app_review: ^2.0.8 dev_dependencies: flutter_test: