#40 added 'rate app' button
This commit is contained in:
@ -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()),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user