77 lines
3.0 KiB
Dart
77 lines
3.0 KiB
Dart
|
|
import 'package:feedback/feedback.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:in_app_review/in_app_review.dart';
|
|
import '../../widget/ListItem.dart';
|
|
import '../../widget/centeredLeading.dart';
|
|
import '../../widget/infoDialog.dart';
|
|
import '../settings/settings.dart';
|
|
import 'more/feedback/feedbackSender.dart';
|
|
import 'more/gradeAverages/gradeAverage.dart';
|
|
import 'more/holidays/holidays.dart';
|
|
import 'more/message/message.dart';
|
|
import 'more/roomplan/roomplan.dart';
|
|
import 'more/share/selectShareTypeDialog.dart';
|
|
|
|
class Overhang extends StatelessWidget {
|
|
const Overhang({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text("Mehr"),
|
|
actions: [
|
|
IconButton(onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (context) => const Settings())), icon: const Icon(Icons.settings))
|
|
],
|
|
),
|
|
body: ListView(
|
|
children: [
|
|
const ListItemNavigator(icon: Icons.newspaper, text: "Marianum Message", target: Message()),
|
|
const ListItemNavigator(icon: Icons.room, text: "Raumplan", target: Roomplan()),
|
|
const ListItemNavigator(icon: Icons.calculate, text: "Notendurschnittsrechner", target: GradeAverage()),
|
|
const ListItemNavigator(icon: Icons.calendar_month, text: "Schulferien", target: Holidays()),
|
|
const Divider(),
|
|
ListTile(
|
|
leading: const Icon(Icons.share_outlined),
|
|
title: const Text("Teile die App"),
|
|
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"),
|
|
trailing: const Icon(Icons.arrow_right),
|
|
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: () {
|
|
BetterFeedback.of(context).show((UserFeedback feedback) => FeedbackSender.send(context, feedback));
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|