|
|
|
|
@ -5,51 +5,44 @@ import 'package:flutter/foundation.dart';
|
|
|
|
|
import 'package:http/http.dart' as http;
|
|
|
|
|
import 'package:matrix/matrix_api_lite/utils/logs.dart';
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
|
|
|
|
|
abstract class SettingKeys {
|
|
|
|
|
static const String renderHtml = 'chat.pantheon.renderHtml';
|
|
|
|
|
static const String hideRedactedEvents = 'chat.pantheon.hideRedactedEvents';
|
|
|
|
|
static const String hideUnknownEvents = 'chat.pantheon.hideUnknownEvents';
|
|
|
|
|
static const String hideUnimportantStateEvents =
|
|
|
|
|
'chat.pantheon.hideUnimportantStateEvents';
|
|
|
|
|
static const String separateChatTypes = 'chat.pantheon.separateChatTypes';
|
|
|
|
|
static const String sentry = 'sentry';
|
|
|
|
|
static const String theme = 'theme';
|
|
|
|
|
static const String amoledEnabled = 'amoled_enabled';
|
|
|
|
|
static const String codeLanguage = 'code_language';
|
|
|
|
|
static const String showNoGoogle = 'chat.pantheon.show_no_google';
|
|
|
|
|
static const String fontSizeFactor = 'chat.pantheon.font_size_factor';
|
|
|
|
|
static const String showNoPid = 'chat.pantheon.show_no_pid';
|
|
|
|
|
static const String databasePassword = 'database-password';
|
|
|
|
|
static const String appLockKey = 'chat.pantheon.app_lock';
|
|
|
|
|
static const String unifiedPushRegistered =
|
|
|
|
|
'chat.pantheon.unifiedpush.registered';
|
|
|
|
|
static const String unifiedPushEndpoint =
|
|
|
|
|
'chat.pantheon.unifiedpush.endpoint';
|
|
|
|
|
static const String ownStatusMessage = 'chat.pantheon.status_msg';
|
|
|
|
|
static const String dontAskForBootstrapKey = 'chat.hermes.dont_ask_bootstrap';
|
|
|
|
|
static const String autoplayImages = 'chat.pantheon.autoplay_images';
|
|
|
|
|
static const String sendTypingNotifications =
|
|
|
|
|
'chat.pantheon.send_typing_notifications';
|
|
|
|
|
static const String sendPublicReadReceipts =
|
|
|
|
|
'chat.pantheon.send_public_read_receipts';
|
|
|
|
|
static const String sendOnEnter = 'chat.pantheon.send_on_enter';
|
|
|
|
|
static const String swipeRightToLeftToReply =
|
|
|
|
|
'chat.pantheon.swipeRightToLeftToReply';
|
|
|
|
|
|
|
|
|
|
static const String swipePopEnableFullScreenDrag =
|
|
|
|
|
'chat.pantheon.swipePopEnableFullScreenDrag';
|
|
|
|
|
static const String swipePopDurationMs = 'chat.pantheon.swipePopDurationMs';
|
|
|
|
|
static const String swipePopMinimumDragFraction =
|
|
|
|
|
'chat.pantheon.swipePopMinimumDragFraction';
|
|
|
|
|
static const String swipePopVelocityThreshold =
|
|
|
|
|
'chat.pantheon.swipePopVelocityThreshold';
|
|
|
|
|
|
|
|
|
|
static const String experimentalVoip = 'chat.pantheon.experimental_voip';
|
|
|
|
|
static const String showPresences = 'chat.pantheon.show_presences';
|
|
|
|
|
static const String displayNavigationRail =
|
|
|
|
|
'chat.pantheon.display_navigation_rail';
|
|
|
|
|
}
|
|
|
|
|
import 'package:hermes/utils/platform_infos.dart';
|
|
|
|
|
|
|
|
|
|
// abstract class SettingKeys {
|
|
|
|
|
// static const String renderHtml = 'chat.pantheon.renderHtml';
|
|
|
|
|
// static const String hideRedactedEvents = 'chat.pantheon.hideRedactedEvents';
|
|
|
|
|
// static const String hideUnknownEvents = 'chat.pantheon.hideUnknownEvents';
|
|
|
|
|
// static const String hideUnimportantStateEvents =
|
|
|
|
|
// 'chat.pantheon.hideUnimportantStateEvents';
|
|
|
|
|
// static const String separateChatTypes = 'chat.pantheon.separateChatTypes';
|
|
|
|
|
// static const String sentry = 'sentry';
|
|
|
|
|
// static const String theme = 'theme';
|
|
|
|
|
// static const String amoledEnabled = 'amoled_enabled';
|
|
|
|
|
// static const String codeLanguage = 'code_language';
|
|
|
|
|
// static const String showNoGoogle = 'chat.pantheon.show_no_google';
|
|
|
|
|
// static const String fontSizeFactor = 'chat.pantheon.font_size_factor';
|
|
|
|
|
// static const String showNoPid = 'chat.pantheon.show_no_pid';
|
|
|
|
|
// static const String databasePassword = 'database-password';
|
|
|
|
|
// static const String appLockKey = 'chat.pantheon.app_lock';
|
|
|
|
|
// static const String unifiedPushRegistered =
|
|
|
|
|
// 'chat.pantheon.unifiedpush.registered';
|
|
|
|
|
// static const String unifiedPushEndpoint =
|
|
|
|
|
// 'chat.pantheon.unifiedpush.endpoint';
|
|
|
|
|
// static const String ownStatusMessage = 'chat.pantheon.status_msg';
|
|
|
|
|
// static const String dontAskForBootstrapKey = 'chat.hermes.dont_ask_bootstrap';
|
|
|
|
|
// static const String autoplayImages = 'chat.pantheon.autoplay_images';
|
|
|
|
|
// static const String sendTypingNotifications =
|
|
|
|
|
// 'chat.pantheon.send_typing_notifications';
|
|
|
|
|
// static const String sendPublicReadReceipts =
|
|
|
|
|
// 'chat.pantheon.send_public_read_receipts';
|
|
|
|
|
// static const String sendOnEnter = 'chat.pantheon.send_on_enter';
|
|
|
|
|
// static const String swipeRightToLeftToReply =
|
|
|
|
|
// 'chat.pantheon.swipeRightToLeftToReply';
|
|
|
|
|
|
|
|
|
|
// static const String experimentalVoip = 'chat.pantheon.experimental_voip';
|
|
|
|
|
// static const String showPresences = 'chat.pantheon.show_presences';
|
|
|
|
|
// static const String displayNavigationRail =
|
|
|
|
|
// 'chat.pantheon.display_navigation_rail';
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
enum AppSettings<T> {
|
|
|
|
|
textMessageMaxLength<int>('textMessageMaxLength', 16384),
|
|
|
|
|
@ -79,6 +72,23 @@ enum AppSettings<T> {
|
|
|
|
|
sendTypingNotifications<bool>('chat.fluffy.send_typing_notifications', true),
|
|
|
|
|
sendPublicReadReceipts<bool>('chat.fluffy.send_public_read_receipts', true),
|
|
|
|
|
swipeRightToLeftToReply<bool>('chat.fluffy.swipeRightToLeftToReply', true),
|
|
|
|
|
swipePopEnableFullScreenDrag<bool>(
|
|
|
|
|
'chat.pantheon.swipePopEnableFullScreenDrag',
|
|
|
|
|
true,
|
|
|
|
|
),
|
|
|
|
|
swipePopDuration<int>(
|
|
|
|
|
'chat.pantheon.swipePopDuration',
|
|
|
|
|
280,
|
|
|
|
|
),
|
|
|
|
|
swipePopMinimumDragFraction<double>(
|
|
|
|
|
'chat.pantheon.swipePopMinimumDragFraction',
|
|
|
|
|
0.3,
|
|
|
|
|
),
|
|
|
|
|
swipePopVelocityThreshold<double>(
|
|
|
|
|
'chat.pantheon.swipePopVelocityThreshold',
|
|
|
|
|
350.0,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
sendOnEnter<bool>('chat.fluffy.send_on_enter', false),
|
|
|
|
|
showPresences<bool>('chat.fluffy.show_presences', true),
|
|
|
|
|
displayNavigationRail<bool>('chat.fluffy.display_navigation_rail', false),
|
|
|
|
|
|