simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
+16 -14
View File
@@ -17,6 +17,8 @@ class Overhang extends StatefulWidget {
}
class _OverhangState extends State<Overhang> {
late final Future<bool> _reviewAvailable = InAppReview.instance.isAvailable();
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
@@ -48,7 +50,7 @@ class _OverhangState extends State<Overhang> {
onTap: () => AppRoutes.openQrShare(context),
),
FutureBuilder(
future: InAppReview.instance.isAvailable(),
future: _reviewAvailable,
builder: (context, snapshot) {
String? getPlatformStoreName() {
if (Platform.isAndroid) return 'Play store';
@@ -60,19 +62,19 @@ class _OverhangState extends State<Overhang> {
.openStoreListing(appStoreId: '6458789560')
.then(
(value) {
if (!context.mounted) return;
InfoDialog.show(context, 'Vielen Dank!');
},
onError: (error) {
if (!context.mounted) return;
InfoDialog.show(
context,
error.toString(),
copyable: true,
title: 'Fehler',
if (!context.mounted) return;
InfoDialog.show(context, 'Vielen Dank!');
},
onError: (error) {
if (!context.mounted) return;
InfoDialog.show(
context,
error.toString(),
copyable: true,
title: 'Fehler',
);
},
);
},
);
final ready = snapshot.connectionState == ConnectionState.done;
return ListTile(
@@ -83,7 +85,7 @@ class _OverhangState extends State<Overhang> {
(data) => Text('Im $data'),
),
trailing: const Icon(Icons.arrow_right),
onTap: !ready ? null : rate
onTap: !ready ? null : rate,
);
},
),