diff --git a/flutter/lib/components/badge_display/badge_display.dart b/flutter/lib/components/badge_display/badge_display.dart index efaa995..5f6f27b 100644 --- a/flutter/lib/components/badge_display/badge_display.dart +++ b/flutter/lib/components/badge_display/badge_display.dart @@ -79,8 +79,8 @@ class _BadgeDisplayState extends State { Positioned _buildCloseButton(BuildContext context, Color colFG) { return Positioned( - top: 1, - right: 1, + top: 4, + right: 4, child: Material( color: Colors.transparent, child: InkWell( diff --git a/flutter/lib/pages/channel_scanner/channel_scanner.dart b/flutter/lib/pages/channel_scanner/channel_scanner.dart index 33d797e..d7d1874 100644 --- a/flutter/lib/pages/channel_scanner/channel_scanner.dart +++ b/flutter/lib/pages/channel_scanner/channel_scanner.dart @@ -3,11 +3,13 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; +import 'package:simplecloudnotifier/components/badge_display/badge_display.dart'; import 'package:simplecloudnotifier/components/layout/scaffold.dart'; import 'package:simplecloudnotifier/models/scan_result.dart'; import 'package:simplecloudnotifier/pages/channel_scanner/channel_scanner_result_channelsubscribe.dart'; import 'package:simplecloudnotifier/pages/channel_scanner/channel_scanner_result_channelview.dart'; import 'package:simplecloudnotifier/pages/channel_scanner/channel_scanner_result_messagesend.dart'; +import 'package:simplecloudnotifier/state/app_settings.dart'; import 'package:simplecloudnotifier/utils/ui.dart'; class ChannelScannerPage extends StatefulWidget { @@ -40,6 +42,16 @@ class _ChannelScannerPageState extends State { padding: const EdgeInsets.fromLTRB(24, 16, 24, 16), child: Column( children: [ + SizedBox(height: 16), + BadgeDisplay( + text: "Scan the QR Code of an account to send messages to this account,\nor the QR Code of an channel to request a subscription to this channel.", + icon: null, + mode: BadgeMode.info, + textAlign: TextAlign.left, + closable: true, + extraPadding: EdgeInsets.fromLTRB(0, 0, 0, 16), + hidden: !AppSettings().showInfoAlerts, + ), SizedBox(height: 16), if (scanResult == null) ...[ Center( diff --git a/flutter/lib/pages/channel_view/channel_view.dart b/flutter/lib/pages/channel_view/channel_view.dart index 145a30f..7831af0 100644 --- a/flutter/lib/pages/channel_view/channel_view.dart +++ b/flutter/lib/pages/channel_view/channel_view.dart @@ -15,6 +15,7 @@ import 'package:simplecloudnotifier/pages/filtered_message_view/filtered_message import 'package:simplecloudnotifier/pages/subscription_view/subscription_view.dart'; import 'package:simplecloudnotifier/state/app_auth.dart'; import 'package:simplecloudnotifier/state/app_bar_state.dart'; +import 'package:simplecloudnotifier/state/app_settings.dart'; import 'package:simplecloudnotifier/state/application_log.dart'; import 'package:simplecloudnotifier/types/immediate_future.dart'; import 'package:simplecloudnotifier/utils/dialogs.dart'; @@ -182,18 +183,20 @@ class _ChannelViewPageState extends State { children: [ _buildQRCode(context), SizedBox(height: 8), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidIdCardClip, - title: 'ChannelID', - values: [channel.channelID], - ), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidInputNumeric, - title: 'InternalName', - values: [channel.internalName], - ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'ChannelID', + values: [channel.channelID], + ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidInputNumeric, + title: 'InternalName', + values: [channel.internalName], + ), _buildDisplayNameCard(context, true), _buildDescriptionNameCard(context, true), UI.metaCard( @@ -284,18 +287,20 @@ class _ChannelViewPageState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SizedBox(height: 8), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidIdCardClip, - title: 'ChannelID', - values: [channel.channelID], - ), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidInputNumeric, - title: 'InternalName', - values: [channel.internalName], - ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'ChannelID', + values: [channel.channelID], + ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidInputNumeric, + title: 'InternalName', + values: [channel.internalName], + ), _buildDisplayNameCard(context, false), _buildDescriptionNameCard(context, false), subCard, @@ -345,12 +350,20 @@ class _ChannelViewPageState extends State { future: _futureOwner.future, builder: (context, snapshot) { if (snapshot.hasData) { - return UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidUser, - title: 'Owner', - values: [channelPreview!.ownerUserID + (isOwned ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], - ); + if (AppSettings().showExtendedAttributes) + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'Owner', + values: [channelPreview!.ownerUserID + (isOwned ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], + ); + else + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'Owner', + values: [(snapshot.data?.username ?? channelPreview!.ownerUserID) + (isOwned ? ' (you)' : '')], + ); } else { return UI.metaCard( context: context, diff --git a/flutter/lib/pages/keytoken_list/keytoken_created_modal.dart b/flutter/lib/pages/keytoken_list/keytoken_created_modal.dart index 3dcb022..cdfabd1 100644 --- a/flutter/lib/pages/keytoken_list/keytoken_created_modal.dart +++ b/flutter/lib/pages/keytoken_list/keytoken_created_modal.dart @@ -3,6 +3,8 @@ import 'package:flutter/services.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:simplecloudnotifier/components/badge_display/badge_display.dart'; import 'package:simplecloudnotifier/models/keytoken.dart'; +import 'package:simplecloudnotifier/state/app_auth.dart'; +import 'package:simplecloudnotifier/state/app_settings.dart'; import 'package:simplecloudnotifier/utils/toaster.dart'; import 'package:simplecloudnotifier/utils/ui.dart'; @@ -18,6 +20,8 @@ class KeyTokenCreatedModal extends StatelessWidget { @override Widget build(BuildContext context) { + final acc = AppAuth(); + return AlertDialog( title: const Text('A new key was created'), content: Container( @@ -27,12 +31,27 @@ class KeyTokenCreatedModal extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidIdCardClip, - title: 'KeyTokenID', - values: [keytoken.keytokenID], + const BadgeDisplay( + text: "Please copy and save the token now, it cannot be retrieved later.", + icon: null, + mode: BadgeMode.warn, ), + const SizedBox(height: 16), + if (acc.userID != null) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'UserID', + values: [acc.userID!], + iconActions: [(FontAwesomeIcons.copy, null, () => _copy(acc.userID!))], + ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'KeyTokenID', + values: [keytoken.keytokenID], + ), UI.metaCard( context: context, icon: FontAwesomeIcons.solidInputText, @@ -45,19 +64,12 @@ class KeyTokenCreatedModal extends StatelessWidget { title: 'Permissions', values: _formatPermissions(keytoken.permissions), ), - const SizedBox(height: 16), - const BadgeDisplay( - text: "Please copy and save the token now, it cannot be retrieved later.", - icon: null, - mode: BadgeMode.warn, - ), - const SizedBox(height: 4), UI.metaCard( context: context, icon: FontAwesomeIcons.solidKey, title: 'Token', - values: [tokenValue.substring(0, 12) + '...'], - iconActions: [(FontAwesomeIcons.copy, null, _copy)], + values: [tokenValue], + iconActions: [(FontAwesomeIcons.copy, null, () => _copy(tokenValue))], ), ], ), @@ -89,9 +101,9 @@ class KeyTokenCreatedModal extends StatelessWidget { return result; } - void _copy() { - Clipboard.setData(new ClipboardData(text: tokenValue)); + void _copy(String v) { + Clipboard.setData(new ClipboardData(text: v)); Toaster.info("Clipboard", 'Copied text to Clipboard'); - print('================= [CLIPBOARD] =================\n${tokenValue}\n================= [/CLIPBOARD] ================='); + print('================= [CLIPBOARD] =================\n${v}\n================= [/CLIPBOARD] ================='); } } diff --git a/flutter/lib/pages/keytoken_view/keytoken_view.dart b/flutter/lib/pages/keytoken_view/keytoken_view.dart index 182435f..9fbe619 100644 --- a/flutter/lib/pages/keytoken_view/keytoken_view.dart +++ b/flutter/lib/pages/keytoken_view/keytoken_view.dart @@ -201,16 +201,17 @@ class _KeyTokenViewPageState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SizedBox(height: 8), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidIdCardClip, - title: 'KeyTokenID', - values: [ - keytoken.keytokenID, - if (keytokenUserAccAdmin?.keytokenID == keytoken.keytokenID) '(Currently used as Admin-Token)', - if (keytokenUserAccSend?.keytokenID == keytoken.keytokenID) '(Currently used as Send-Token)', - ], - ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'KeyTokenID', + values: [ + keytoken.keytokenID, + if (keytokenUserAccAdmin?.keytokenID == keytoken.keytokenID) '(Currently used as Admin-Token)', + if (keytokenUserAccSend?.keytokenID == keytoken.keytokenID) '(Currently used as Send-Token)', + ], + ), _buildNameCard(context, true), UI.metaCard( context: context, @@ -250,12 +251,13 @@ class _KeyTokenViewPageState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SizedBox(height: 8), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidIdCardClip, - title: 'KeyTokenID', - values: [keytoken.keytokenID], - ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'KeyTokenID', + values: [keytoken.keytokenID], + ), _buildNameCard(context, false), _buildOwnerCard(context, false), ..._buildPermissionCard(context, false, keytoken), @@ -270,12 +272,20 @@ class _KeyTokenViewPageState extends State { future: _futureOwner.future, builder: (context, snapshot) { if (snapshot.hasData) { - return UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidUser, - title: 'Owner', - values: [keytokenPreview!.ownerUserID + (isOwned ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], - ); + if (AppSettings().showExtendedAttributes) + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'Owner', + values: [keytokenPreview!.ownerUserID + (isOwned ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], + ); + else + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'Owner', + values: [(snapshot.data?.username ?? keytokenPreview!.ownerUserID) + (isOwned ? ' (you)' : '')], + ); } else { return UI.metaCard( context: context, diff --git a/flutter/lib/pages/message_view/message_view.dart b/flutter/lib/pages/message_view/message_view.dart index 4798a18..5e25e61 100644 --- a/flutter/lib/pages/message_view/message_view.dart +++ b/flutter/lib/pages/message_view/message_view.dart @@ -141,6 +141,8 @@ class _MessageViewPageState extends State { Widget _buildMessageView(BuildContext context, SCNMessage message, ChannelPreview? channel, KeyTokenPreview? token, UserPreview? user) { final userAccUserID = context.select((v) => v.userID); + var cfg = AppSettings(); + final child = Padding( padding: const EdgeInsets.fromLTRB(24, 16, 24, 16), child: Column( @@ -150,6 +152,13 @@ class _MessageViewPageState extends State { SizedBox(height: 8), if (message.content != null) ..._buildMessageContent(context, message), SizedBox(height: 8), + if (cfg.showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'MessageID', + values: [message.messageID, if (message.userMessageID != null) message.userMessageID!], + ), if (message.senderName != null) UI.metaCard( context: context, @@ -160,30 +169,39 @@ class _MessageViewPageState extends State { Navi.push(context, () => FilteredMessageViewPage(title: message.senderName!, alertText: 'All message sent from \'${message.senderName!}\'', filter: MessageFilter(senderNames: [message.senderName!]))) }, ), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidGearCode, - title: 'KeyToken', - values: [message.usedKeyID, token?.name ?? '...'], - mainAction: () { - if (message.senderUserID == userAccUserID) { - Navi.push(context, () => KeyTokenViewPage(keytokenID: message.usedKeyID, preloadedData: null, needsReload: null)); - } else { - Navi.push(context, () => FilteredMessageViewPage(title: token?.name ?? message.usedKeyID, alertText: 'All message sent with the specified key', filter: MessageFilter(usedKeys: [message.usedKeyID]))); - } - }, - ), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidIdCardClip, - title: 'MessageID', - values: [message.messageID, message.userMessageID ?? ''], - ), + if (cfg.showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidGearCode, + title: 'KeyToken', + values: [message.usedKeyID, token?.name ?? '...'], + mainAction: () { + if (message.senderUserID == userAccUserID) { + Navi.push(context, () => KeyTokenViewPage(keytokenID: message.usedKeyID, preloadedData: null, needsReload: null)); + } else { + Navi.push(context, () => FilteredMessageViewPage(title: token?.name ?? message.usedKeyID, alertText: 'All message sent with the specified key', filter: MessageFilter(usedKeys: [message.usedKeyID]))); + } + }, + ), + if (!cfg.showExtendedAttributes && token != null) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidGearCode, + title: 'KeyToken', + values: [token.name], + mainAction: () { + if (message.senderUserID == userAccUserID) { + Navi.push(context, () => KeyTokenViewPage(keytokenID: message.usedKeyID, preloadedData: null, needsReload: null)); + } else { + Navi.push(context, () => FilteredMessageViewPage(title: token.name, alertText: 'All message sent with key \'${token.name}\'', filter: MessageFilter(usedKeys: [message.usedKeyID]))); + } + }, + ), UI.metaCard( context: context, icon: FontAwesomeIcons.solidSnake, title: 'Channel', - values: [message.channelID, channel?.displayName ?? message.channelInternalName], + values: [if (cfg.showExtendedAttributes) message.channelID, channel?.displayName ?? message.channelInternalName], mainAction: (channel != null) ? () { Navi.push(context, () => ChannelViewPage(channelID: channel.channelID, preloadedData: null, needsReload: null)); @@ -196,19 +214,28 @@ class _MessageViewPageState extends State { title: 'Timestamp', values: [message.timestamp], ), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidUser, - title: 'User', - values: [user?.userID ?? message.senderUserID, user?.username ?? ''], - mainAction: () => Navi.push(context, () => FilteredMessageViewPage(title: user?.username ?? message.senderUserID, alertText: 'All message sent by the specified account', filter: MessageFilter(senderUserID: [message.senderUserID]))), - ), + if (cfg.showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'User', + values: [user?.userID ?? message.senderUserID, if (user?.username != null) user?.username ?? ''], + mainAction: () => Navi.push(context, () => FilteredMessageViewPage(title: user?.username ?? message.senderUserID, alertText: 'All message sent by the specified account', filter: MessageFilter(senderUserID: [message.senderUserID]))), + ), + if (!cfg.showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'User', + values: [user?.username ?? user?.userID ?? message.senderUserID], + mainAction: () => Navi.push(context, () => FilteredMessageViewPage(title: user?.username ?? message.senderUserID, alertText: 'All message sent by the specified account', filter: MessageFilter(senderUserID: [message.senderUserID]))), + ), UI.metaCard( context: context, icon: FontAwesomeIcons.solidBolt, title: 'Priority', values: [_prettyPrintPriority(message.priority)], - mainAction: () => Navi.push(context, () => FilteredMessageViewPage(title: "Priority ${message.priority}", alertText: 'All message sent with priority ${message.priority}', filter: MessageFilter(priority: [message.priority]))), + mainAction: () => Navi.push(context, () => FilteredMessageViewPage(title: "Priority ${message.priority}", alertText: 'All message sent with priority ' + _prettyPrintPriority(message.priority), filter: MessageFilter(priority: [message.priority]))), ), if (message.senderUserID == userAccUserID) UI.button( diff --git a/flutter/lib/pages/settings/settings_view.dart b/flutter/lib/pages/settings/settings_view.dart index 6c358c6..7353589 100644 --- a/flutter/lib/pages/settings/settings_view.dart +++ b/flutter/lib/pages/settings/settings_view.dart @@ -152,6 +152,12 @@ class _SettingsRootPageState extends State { title: Text('Show various helpful info boxes'), onToggle: (value) => AppSettings().update((p) => p.showInfoAlerts = !p.showInfoAlerts), ), + SettingsTile.switchTile( + initialValue: cfg.showExtendedAttributes, + leading: Icon(FontAwesomeIcons.solidSheetPlastic), + title: Text('Show all attributes of entities'), + onToggle: (value) => AppSettings().update((p) => p.showExtendedAttributes = !p.showExtendedAttributes), + ), ], ), SettingsSection( diff --git a/flutter/lib/pages/subscription_view/subscription_view.dart b/flutter/lib/pages/subscription_view/subscription_view.dart index e673f53..039ae90 100644 --- a/flutter/lib/pages/subscription_view/subscription_view.dart +++ b/flutter/lib/pages/subscription_view/subscription_view.dart @@ -169,12 +169,13 @@ class _SubscriptionViewPageState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SizedBox(height: 8), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidIdCardClip, - title: 'SubscriptionID', - values: [subscription.subscriptionID], - ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'SubscriptionID', + values: [subscription.subscriptionID], + ), _buildChannelOwnerCard(context, subscription), _buildSubscriberCard(context, subscription), _buildChannelCard(context, subscription), @@ -202,12 +203,13 @@ class _SubscriptionViewPageState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SizedBox(height: 8), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidIdCardClip, - title: 'SubscriptionID', - values: [subscription.subscriptionID], - ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'SubscriptionID', + values: [subscription.subscriptionID], + ), _buildChannelOwnerCard(context, subscription), _buildSubscriberCard(context, subscription), _buildChannelCard(context, subscription), @@ -237,12 +239,13 @@ class _SubscriptionViewPageState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ SizedBox(height: 8), - UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidIdCardClip, - title: 'SubscriptionID', - values: [subscription.subscriptionID], - ), + if (AppSettings().showExtendedAttributes) + UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidIdCardClip, + title: 'SubscriptionID', + values: [subscription.subscriptionID], + ), _buildChannelOwnerCard(context, subscription), _buildSubscriberCard(context, subscription), _buildChannelCard(context, subscription), @@ -272,12 +275,20 @@ class _SubscriptionViewPageState extends State { future: _futureChannelOwner.future, builder: (context, snapshot) { if (snapshot.hasData) { - return UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidUser, - title: 'Channel Owner', - values: [subscription.channelOwnerUserID + (isSelf ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], - ); + if (AppSettings().showExtendedAttributes) + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'Channel Owner', + values: [subscription.channelOwnerUserID + (isSelf ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], + ); + else + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'Channel Owner', + values: [(snapshot.data?.username ?? subscription.channelOwnerUserID) + (isSelf ? ' (you)' : '')], + ); } else { return UI.metaCard( context: context, @@ -299,12 +310,20 @@ class _SubscriptionViewPageState extends State { future: _futureSubscriber.future, builder: (context, snapshot) { if (snapshot.hasData) { - return UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidUser, - title: 'Subscriber', - values: [subscription.subscriberUserID + (isSelf ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], - ); + if (AppSettings().showExtendedAttributes) + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'Subscriber', + values: [subscription.subscriberUserID + (isSelf ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], + ); + else + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidUser, + title: 'Subscriber', + values: [(snapshot.data?.username ?? subscription.subscriberUserID) + (isSelf ? ' (you)' : '')], + ); } else { return UI.metaCard( context: context, @@ -322,13 +341,22 @@ class _SubscriptionViewPageState extends State { future: _futureChannel.future, builder: (context, snapshot) { if (snapshot.hasData) { - return UI.metaCard( - context: context, - icon: FontAwesomeIcons.solidSnake, - title: 'Channel', - values: [subscription.channelID, snapshot.data!.displayName], - mainAction: () => Navi.push(context, () => ChannelViewPage(channelID: subscription.channelID, preloadedData: null, needsReload: null)), - ); + if (AppSettings().showExtendedAttributes) + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidSnake, + title: 'Channel', + values: [subscription.channelID, snapshot.data!.displayName], + mainAction: () => Navi.push(context, () => ChannelViewPage(channelID: subscription.channelID, preloadedData: null, needsReload: null)), + ); + else + return UI.metaCard( + context: context, + icon: FontAwesomeIcons.solidSnake, + title: 'Channel', + values: [snapshot.data!.displayName], + mainAction: () => Navi.push(context, () => ChannelViewPage(channelID: subscription.channelID, preloadedData: null, needsReload: null)), + ); } else { return UI.metaCard( context: context, diff --git a/flutter/lib/state/app_settings.dart b/flutter/lib/state/app_settings.dart index a197f23..811d5a5 100644 --- a/flutter/lib/state/app_settings.dart +++ b/flutter/lib/state/app_settings.dart @@ -57,6 +57,7 @@ class AppSettings extends ChangeNotifier { AppSettingsDateFormat dateFormat = AppSettingsDateFormat.ISO; int messagePreviewLength = 3; bool showInfoAlerts = true; + bool showExtendedAttributes = false; AppNotificationSettings notification0 = AppNotificationSettings(); AppNotificationSettings notification1 = AppNotificationSettings(); @@ -82,6 +83,7 @@ class AppSettings extends ChangeNotifier { dateFormat = AppSettingsDateFormat.ISO; messagePreviewLength = 3; showInfoAlerts = true; + showExtendedAttributes = true; notification0 = AppNotificationSettings(); notification1 = AppNotificationSettings(); @@ -100,6 +102,7 @@ class AppSettings extends ChangeNotifier { dateFormat = AppSettingsDateFormat.parse(Globals().sharedPrefs.getString('settings.dateFormat')) ?? dateFormat; messagePreviewLength = Globals().sharedPrefs.getInt('settings.messagePreviewLength') ?? messagePreviewLength; showInfoAlerts = Globals().sharedPrefs.getBool('settings.showInfoAlerts') ?? showInfoAlerts; + showInfoAlerts = Globals().sharedPrefs.getBool('settings.showExtendedAttributes') ?? showExtendedAttributes; notification0 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification0'); notification1 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification1'); @@ -116,6 +119,7 @@ class AppSettings extends ChangeNotifier { await Globals().sharedPrefs.setString('settings.dateFormat', dateFormat.key); await Globals().sharedPrefs.setInt('settings.messagePreviewLength', messagePreviewLength); await Globals().sharedPrefs.setBool('settings.showInfoAlerts', showInfoAlerts); + await Globals().sharedPrefs.setBool('settings.showExtendedAttributes', showExtendedAttributes); await notification0.save(Globals().sharedPrefs, 'settings.notification0'); await notification1.save(Globals().sharedPrefs, 'settings.notification1');