Hide a bunch of expert-properties by default

This commit is contained in:
2025-11-09 22:00:29 +01:00
parent fd5e714074
commit febc0a8f43
9 changed files with 248 additions and 136 deletions

View File

@@ -79,8 +79,8 @@ class _BadgeDisplayState extends State<BadgeDisplay> {
Positioned _buildCloseButton(BuildContext context, Color colFG) { Positioned _buildCloseButton(BuildContext context, Color colFG) {
return Positioned( return Positioned(
top: 1, top: 4,
right: 1, right: 4,
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,
child: InkWell( child: InkWell(

View File

@@ -3,11 +3,13 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:mobile_scanner/mobile_scanner.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/components/layout/scaffold.dart';
import 'package:simplecloudnotifier/models/scan_result.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_channelsubscribe.dart';
import 'package:simplecloudnotifier/pages/channel_scanner/channel_scanner_result_channelview.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/pages/channel_scanner/channel_scanner_result_messagesend.dart';
import 'package:simplecloudnotifier/state/app_settings.dart';
import 'package:simplecloudnotifier/utils/ui.dart'; import 'package:simplecloudnotifier/utils/ui.dart';
class ChannelScannerPage extends StatefulWidget { class ChannelScannerPage extends StatefulWidget {
@@ -40,6 +42,16 @@ class _ChannelScannerPageState extends State<ChannelScannerPage> {
padding: const EdgeInsets.fromLTRB(24, 16, 24, 16), padding: const EdgeInsets.fromLTRB(24, 16, 24, 16),
child: Column( child: Column(
children: [ 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), SizedBox(height: 16),
if (scanResult == null) ...[ if (scanResult == null) ...[
Center( Center(

View File

@@ -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/pages/subscription_view/subscription_view.dart';
import 'package:simplecloudnotifier/state/app_auth.dart'; import 'package:simplecloudnotifier/state/app_auth.dart';
import 'package:simplecloudnotifier/state/app_bar_state.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/state/application_log.dart';
import 'package:simplecloudnotifier/types/immediate_future.dart'; import 'package:simplecloudnotifier/types/immediate_future.dart';
import 'package:simplecloudnotifier/utils/dialogs.dart'; import 'package:simplecloudnotifier/utils/dialogs.dart';
@@ -182,12 +183,14 @@ class _ChannelViewPageState extends State<ChannelViewPage> {
children: [ children: [
_buildQRCode(context), _buildQRCode(context),
SizedBox(height: 8), SizedBox(height: 8),
if (AppSettings().showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidIdCardClip, icon: FontAwesomeIcons.solidIdCardClip,
title: 'ChannelID', title: 'ChannelID',
values: [channel.channelID], values: [channel.channelID],
), ),
if (AppSettings().showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidInputNumeric, icon: FontAwesomeIcons.solidInputNumeric,
@@ -284,12 +287,14 @@ class _ChannelViewPageState extends State<ChannelViewPage> {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
SizedBox(height: 8), SizedBox(height: 8),
if (AppSettings().showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidIdCardClip, icon: FontAwesomeIcons.solidIdCardClip,
title: 'ChannelID', title: 'ChannelID',
values: [channel.channelID], values: [channel.channelID],
), ),
if (AppSettings().showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidInputNumeric, icon: FontAwesomeIcons.solidInputNumeric,
@@ -345,12 +350,20 @@ class _ChannelViewPageState extends State<ChannelViewPage> {
future: _futureOwner.future, future: _futureOwner.future,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
if (AppSettings().showExtendedAttributes)
return UI.metaCard( return UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidUser, icon: FontAwesomeIcons.solidUser,
title: 'Owner', title: 'Owner',
values: [channelPreview!.ownerUserID + (isOwned ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], 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 { } else {
return UI.metaCard( return UI.metaCard(
context: context, context: context,

View File

@@ -3,6 +3,8 @@ import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:simplecloudnotifier/components/badge_display/badge_display.dart'; import 'package:simplecloudnotifier/components/badge_display/badge_display.dart';
import 'package:simplecloudnotifier/models/keytoken.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/toaster.dart';
import 'package:simplecloudnotifier/utils/ui.dart'; import 'package:simplecloudnotifier/utils/ui.dart';
@@ -18,6 +20,8 @@ class KeyTokenCreatedModal extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final acc = AppAuth();
return AlertDialog( return AlertDialog(
title: const Text('A new key was created'), title: const Text('A new key was created'),
content: Container( content: Container(
@@ -27,6 +31,21 @@ class KeyTokenCreatedModal extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
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( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidIdCardClip, icon: FontAwesomeIcons.solidIdCardClip,
@@ -45,19 +64,12 @@ class KeyTokenCreatedModal extends StatelessWidget {
title: 'Permissions', title: 'Permissions',
values: _formatPermissions(keytoken.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( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidKey, icon: FontAwesomeIcons.solidKey,
title: 'Token', title: 'Token',
values: [tokenValue.substring(0, 12) + '...'], values: [tokenValue],
iconActions: [(FontAwesomeIcons.copy, null, _copy)], iconActions: [(FontAwesomeIcons.copy, null, () => _copy(tokenValue))],
), ),
], ],
), ),
@@ -89,9 +101,9 @@ class KeyTokenCreatedModal extends StatelessWidget {
return result; return result;
} }
void _copy() { void _copy(String v) {
Clipboard.setData(new ClipboardData(text: tokenValue)); Clipboard.setData(new ClipboardData(text: v));
Toaster.info("Clipboard", 'Copied text to Clipboard'); Toaster.info("Clipboard", 'Copied text to Clipboard');
print('================= [CLIPBOARD] =================\n${tokenValue}\n================= [/CLIPBOARD] ================='); print('================= [CLIPBOARD] =================\n${v}\n================= [/CLIPBOARD] =================');
} }
} }

View File

@@ -201,6 +201,7 @@ class _KeyTokenViewPageState extends State<KeyTokenViewPage> {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
SizedBox(height: 8), SizedBox(height: 8),
if (AppSettings().showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidIdCardClip, icon: FontAwesomeIcons.solidIdCardClip,
@@ -250,6 +251,7 @@ class _KeyTokenViewPageState extends State<KeyTokenViewPage> {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
SizedBox(height: 8), SizedBox(height: 8),
if (AppSettings().showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidIdCardClip, icon: FontAwesomeIcons.solidIdCardClip,
@@ -270,12 +272,20 @@ class _KeyTokenViewPageState extends State<KeyTokenViewPage> {
future: _futureOwner.future, future: _futureOwner.future,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
if (AppSettings().showExtendedAttributes)
return UI.metaCard( return UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidUser, icon: FontAwesomeIcons.solidUser,
title: 'Owner', title: 'Owner',
values: [keytokenPreview!.ownerUserID + (isOwned ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], 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 { } else {
return UI.metaCard( return UI.metaCard(
context: context, context: context,

View File

@@ -141,6 +141,8 @@ class _MessageViewPageState extends State<MessageViewPage> {
Widget _buildMessageView(BuildContext context, SCNMessage message, ChannelPreview? channel, KeyTokenPreview? token, UserPreview? user) { Widget _buildMessageView(BuildContext context, SCNMessage message, ChannelPreview? channel, KeyTokenPreview? token, UserPreview? user) {
final userAccUserID = context.select<AppAuth, String?>((v) => v.userID); final userAccUserID = context.select<AppAuth, String?>((v) => v.userID);
var cfg = AppSettings();
final child = Padding( final child = Padding(
padding: const EdgeInsets.fromLTRB(24, 16, 24, 16), padding: const EdgeInsets.fromLTRB(24, 16, 24, 16),
child: Column( child: Column(
@@ -150,6 +152,13 @@ class _MessageViewPageState extends State<MessageViewPage> {
SizedBox(height: 8), SizedBox(height: 8),
if (message.content != null) ..._buildMessageContent(context, message), if (message.content != null) ..._buildMessageContent(context, message),
SizedBox(height: 8), 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) if (message.senderName != null)
UI.metaCard( UI.metaCard(
context: context, context: context,
@@ -160,6 +169,7 @@ class _MessageViewPageState extends State<MessageViewPage> {
Navi.push(context, () => FilteredMessageViewPage(title: message.senderName!, alertText: 'All message sent from \'${message.senderName!}\'', filter: MessageFilter(senderNames: [message.senderName!]))) Navi.push(context, () => FilteredMessageViewPage(title: message.senderName!, alertText: 'All message sent from \'${message.senderName!}\'', filter: MessageFilter(senderNames: [message.senderName!])))
}, },
), ),
if (cfg.showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidGearCode, icon: FontAwesomeIcons.solidGearCode,
@@ -173,17 +183,25 @@ class _MessageViewPageState extends State<MessageViewPage> {
} }
}, },
), ),
if (!cfg.showExtendedAttributes && token != null)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidIdCardClip, icon: FontAwesomeIcons.solidGearCode,
title: 'MessageID', title: 'KeyToken',
values: [message.messageID, message.userMessageID ?? ''], 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( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidSnake, icon: FontAwesomeIcons.solidSnake,
title: 'Channel', title: 'Channel',
values: [message.channelID, channel?.displayName ?? message.channelInternalName], values: [if (cfg.showExtendedAttributes) message.channelID, channel?.displayName ?? message.channelInternalName],
mainAction: (channel != null) mainAction: (channel != null)
? () { ? () {
Navi.push(context, () => ChannelViewPage(channelID: channel.channelID, preloadedData: null, needsReload: null)); Navi.push(context, () => ChannelViewPage(channelID: channel.channelID, preloadedData: null, needsReload: null));
@@ -196,11 +214,20 @@ class _MessageViewPageState extends State<MessageViewPage> {
title: 'Timestamp', title: 'Timestamp',
values: [message.timestamp], values: [message.timestamp],
), ),
if (cfg.showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidUser, icon: FontAwesomeIcons.solidUser,
title: 'User', title: 'User',
values: [user?.userID ?? message.senderUserID, user?.username ?? ''], 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]))), 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( UI.metaCard(
@@ -208,7 +235,7 @@ class _MessageViewPageState extends State<MessageViewPage> {
icon: FontAwesomeIcons.solidBolt, icon: FontAwesomeIcons.solidBolt,
title: 'Priority', title: 'Priority',
values: [_prettyPrintPriority(message.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) if (message.senderUserID == userAccUserID)
UI.button( UI.button(

View File

@@ -152,6 +152,12 @@ class _SettingsRootPageState extends State<SettingsRootPage> {
title: Text('Show various helpful info boxes'), title: Text('Show various helpful info boxes'),
onToggle: (value) => AppSettings().update((p) => p.showInfoAlerts = !p.showInfoAlerts), 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( SettingsSection(

View File

@@ -169,6 +169,7 @@ class _SubscriptionViewPageState extends State<SubscriptionViewPage> {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
SizedBox(height: 8), SizedBox(height: 8),
if (AppSettings().showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidIdCardClip, icon: FontAwesomeIcons.solidIdCardClip,
@@ -202,6 +203,7 @@ class _SubscriptionViewPageState extends State<SubscriptionViewPage> {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
SizedBox(height: 8), SizedBox(height: 8),
if (AppSettings().showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidIdCardClip, icon: FontAwesomeIcons.solidIdCardClip,
@@ -237,6 +239,7 @@ class _SubscriptionViewPageState extends State<SubscriptionViewPage> {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
SizedBox(height: 8), SizedBox(height: 8),
if (AppSettings().showExtendedAttributes)
UI.metaCard( UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidIdCardClip, icon: FontAwesomeIcons.solidIdCardClip,
@@ -272,12 +275,20 @@ class _SubscriptionViewPageState extends State<SubscriptionViewPage> {
future: _futureChannelOwner.future, future: _futureChannelOwner.future,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
if (AppSettings().showExtendedAttributes)
return UI.metaCard( return UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidUser, icon: FontAwesomeIcons.solidUser,
title: 'Channel Owner', title: 'Channel Owner',
values: [subscription.channelOwnerUserID + (isSelf ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], 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 { } else {
return UI.metaCard( return UI.metaCard(
context: context, context: context,
@@ -299,12 +310,20 @@ class _SubscriptionViewPageState extends State<SubscriptionViewPage> {
future: _futureSubscriber.future, future: _futureSubscriber.future,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
if (AppSettings().showExtendedAttributes)
return UI.metaCard( return UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidUser, icon: FontAwesomeIcons.solidUser,
title: 'Subscriber', title: 'Subscriber',
values: [subscription.subscriberUserID + (isSelf ? ' (you)' : ''), if (snapshot.data?.username != null) snapshot.data!.username!], 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 { } else {
return UI.metaCard( return UI.metaCard(
context: context, context: context,
@@ -322,6 +341,7 @@ class _SubscriptionViewPageState extends State<SubscriptionViewPage> {
future: _futureChannel.future, future: _futureChannel.future,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
if (AppSettings().showExtendedAttributes)
return UI.metaCard( return UI.metaCard(
context: context, context: context,
icon: FontAwesomeIcons.solidSnake, icon: FontAwesomeIcons.solidSnake,
@@ -329,6 +349,14 @@ class _SubscriptionViewPageState extends State<SubscriptionViewPage> {
values: [subscription.channelID, snapshot.data!.displayName], values: [subscription.channelID, snapshot.data!.displayName],
mainAction: () => Navi.push(context, () => ChannelViewPage(channelID: subscription.channelID, preloadedData: null, needsReload: null)), 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 { } else {
return UI.metaCard( return UI.metaCard(
context: context, context: context,

View File

@@ -57,6 +57,7 @@ class AppSettings extends ChangeNotifier {
AppSettingsDateFormat dateFormat = AppSettingsDateFormat.ISO; AppSettingsDateFormat dateFormat = AppSettingsDateFormat.ISO;
int messagePreviewLength = 3; int messagePreviewLength = 3;
bool showInfoAlerts = true; bool showInfoAlerts = true;
bool showExtendedAttributes = false;
AppNotificationSettings notification0 = AppNotificationSettings(); AppNotificationSettings notification0 = AppNotificationSettings();
AppNotificationSettings notification1 = AppNotificationSettings(); AppNotificationSettings notification1 = AppNotificationSettings();
@@ -82,6 +83,7 @@ class AppSettings extends ChangeNotifier {
dateFormat = AppSettingsDateFormat.ISO; dateFormat = AppSettingsDateFormat.ISO;
messagePreviewLength = 3; messagePreviewLength = 3;
showInfoAlerts = true; showInfoAlerts = true;
showExtendedAttributes = true;
notification0 = AppNotificationSettings(); notification0 = AppNotificationSettings();
notification1 = AppNotificationSettings(); notification1 = AppNotificationSettings();
@@ -100,6 +102,7 @@ class AppSettings extends ChangeNotifier {
dateFormat = AppSettingsDateFormat.parse(Globals().sharedPrefs.getString('settings.dateFormat')) ?? dateFormat; dateFormat = AppSettingsDateFormat.parse(Globals().sharedPrefs.getString('settings.dateFormat')) ?? dateFormat;
messagePreviewLength = Globals().sharedPrefs.getInt('settings.messagePreviewLength') ?? messagePreviewLength; messagePreviewLength = Globals().sharedPrefs.getInt('settings.messagePreviewLength') ?? messagePreviewLength;
showInfoAlerts = Globals().sharedPrefs.getBool('settings.showInfoAlerts') ?? showInfoAlerts; showInfoAlerts = Globals().sharedPrefs.getBool('settings.showInfoAlerts') ?? showInfoAlerts;
showInfoAlerts = Globals().sharedPrefs.getBool('settings.showExtendedAttributes') ?? showExtendedAttributes;
notification0 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification0'); notification0 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification0');
notification1 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification1'); 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.setString('settings.dateFormat', dateFormat.key);
await Globals().sharedPrefs.setInt('settings.messagePreviewLength', messagePreviewLength); await Globals().sharedPrefs.setInt('settings.messagePreviewLength', messagePreviewLength);
await Globals().sharedPrefs.setBool('settings.showInfoAlerts', showInfoAlerts); await Globals().sharedPrefs.setBool('settings.showInfoAlerts', showInfoAlerts);
await Globals().sharedPrefs.setBool('settings.showExtendedAttributes', showExtendedAttributes);
await notification0.save(Globals().sharedPrefs, 'settings.notification0'); await notification0.save(Globals().sharedPrefs, 'settings.notification0');
await notification1.save(Globals().sharedPrefs, 'settings.notification1'); await notification1.save(Globals().sharedPrefs, 'settings.notification1');