From c434b3dddce286fe6949fb552a385ebb327c687f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Mon, 20 Oct 2025 07:01:37 +0200 Subject: [PATCH] feat: Add donation buttons except for PlayStore&AppStore version --- lib/l10n/intl_en.arb | 3 ++- lib/pages/chat_list/client_chooser_button.dart | 15 +++++++++++++++ lib/utils/background_push.dart | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 7a285f1ad..d7836c494 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -3410,5 +3410,6 @@ "type": "String" } } - } + }, + "donate": "Donate" } diff --git a/lib/pages/chat_list/client_chooser_button.dart b/lib/pages/chat_list/client_chooser_button.dart index a9b13e731..dd01bf053 100644 --- a/lib/pages/chat_list/client_chooser_button.dart +++ b/lib/pages/chat_list/client_chooser_button.dart @@ -67,6 +67,17 @@ class ClientChooserButton extends StatelessWidget { ], ), ), + if (Matrix.of(context).backgroundPush?.firebaseEnabled == false) + PopupMenuItem( + value: SettingsAction.support, + child: Row( + children: [ + const Icon(Icons.favorite, color: Colors.red), + const SizedBox(width: 18), + Text(L10n.of(context).donate), + ], + ), + ), PopupMenuItem( value: SettingsAction.settings, child: Row( @@ -207,6 +218,9 @@ class ClientChooserButton extends StatelessWidget { case SettingsAction.invite: FluffyShare.shareInviteLink(context); break; + case SettingsAction.support: + // TODO: Implement me + break; case SettingsAction.settings: context.go('/rooms/settings'); break; @@ -226,6 +240,7 @@ enum SettingsAction { newGroup, setStatus, invite, + support, settings, archive, } diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart index 4fa5a52b4..31b1e82e2 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -66,6 +66,7 @@ class BackgroundPush { } final pendingTests = >{}; + bool firebaseEnabled = false; //final firebase = FcmSharedIsolate(); @@ -74,6 +75,7 @@ class BackgroundPush { bool upAction = false; void _init() async { + //firebaseEnabled = true; try { if (PlatformInfos.isAndroid) { final port = ReceivePort();