From bf34c1bcdbe8b004a51062e044c3306bbc2aa3e0 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Thu, 7 Dec 2023 21:47:56 -0500 Subject: [PATCH] Let users store a custom note per app (#1126) --- lib/pages/app.dart | 23 +++++++++++++++++++++++ lib/providers/source_provider.dart | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/pages/app.dart b/lib/pages/app.dart index 14e33d4..18bd1fe 100644 --- a/lib/pages/app.dart +++ b/lib/pages/app.dart @@ -145,6 +145,29 @@ class _AppPageState extends State { appsProvider.saveApps([app.app]); } }), + if (app?.app.additionalSettings['about'] is String && + app?.app.additionalSettings['about'].isNotEmpty) + Column( + children: [ + const SizedBox( + height: 48, + ), + GestureDetector( + onLongPress: () { + Clipboard.setData(ClipboardData( + text: app?.app.additionalSettings['about'] ?? '')); + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + content: Text(tr('copiedToClipboard')), + )); + }, + child: Text( + app?.app.additionalSettings['about'], + textAlign: TextAlign.center, + style: const TextStyle(fontStyle: FontStyle.italic), + ), + ) + ], + ), ], ); diff --git a/lib/providers/source_provider.dart b/lib/providers/source_provider.dart index 43822f4..f8bc7a5 100644 --- a/lib/providers/source_provider.dart +++ b/lib/providers/source_provider.dart @@ -454,7 +454,8 @@ abstract class AppSource { [ GeneratedFormSwitch('skipUpdateNotifications', label: tr('skipUpdateNotifications')) - ] + ], + [GeneratedFormTextField('about', label: tr('about'), required: false)] ]; // Previous 2 variables combined into one at runtime for convenient usage