2021-01-24 16:38:25 +01:00
|
|
|
import 'dart:ui';
|
|
|
|
|
2020-12-11 14:14:33 +01:00
|
|
|
abstract class AppConfig {
|
2020-12-18 11:43:13 +01:00
|
|
|
static String _applicationName = 'FluffyChat';
|
|
|
|
static String get applicationName => _applicationName;
|
|
|
|
static String _applicationWelcomeMessage;
|
|
|
|
static String get applicationWelcomeMessage => _applicationWelcomeMessage;
|
2021-06-06 16:55:31 +02:00
|
|
|
static String _defaultHomeserver = 'matrix.org';
|
2020-12-18 11:43:13 +01:00
|
|
|
static String get defaultHomeserver => _defaultHomeserver;
|
2020-12-11 14:14:33 +01:00
|
|
|
static String jitsiInstance = 'https://meet.jit.si/';
|
2021-02-07 08:59:58 +01:00
|
|
|
static double fontSizeFactor = 1.0;
|
2020-12-11 14:14:33 +01:00
|
|
|
static const bool allowOtherHomeservers = true;
|
|
|
|
static const bool enableRegistration = true;
|
2021-01-24 16:38:25 +01:00
|
|
|
static const Color primaryColor = Color(0xFF5625BA);
|
2021-01-31 23:54:33 +01:00
|
|
|
static const Color primaryColorLight = Color(0xFFCCBDEA);
|
2021-05-31 17:43:27 +02:00
|
|
|
static const Color secondaryColor = Color(0xFF41a2bc);
|
2020-12-18 11:43:13 +01:00
|
|
|
static String _privacyUrl = 'https://fluffychat.im/en/privacy.html';
|
|
|
|
static String get privacyUrl => _privacyUrl;
|
2021-09-24 11:42:56 +02:00
|
|
|
static const String enablePushTutorial = 'https://fluffychat.im/en/push.html';
|
2021-01-18 22:59:02 +01:00
|
|
|
static const String appId = 'im.fluffychat.FluffyChat';
|
2021-02-01 12:12:28 +01:00
|
|
|
static const String appOpenUrlScheme = 'im.fluffychat';
|
2021-06-18 15:38:01 +02:00
|
|
|
static String _webBaseUrl = 'https://fluffychat.im/web';
|
|
|
|
static String get webBaseUrl => _webBaseUrl;
|
2020-12-23 10:20:24 +01:00
|
|
|
static const String sourceCodeUrl = 'https://gitlab.com/famedly/fluffychat';
|
2020-12-11 14:14:33 +01:00
|
|
|
static const String supportUrl =
|
2020-12-23 10:15:25 +01:00
|
|
|
'https://gitlab.com/famedly/fluffychat/issues';
|
2020-12-11 14:14:33 +01:00
|
|
|
static const bool enableSentry = true;
|
|
|
|
static const String sentryDns =
|
|
|
|
'https://8591d0d863b646feb4f3dda7e5dcab38@o256755.ingest.sentry.io/5243143';
|
2021-04-09 17:40:14 +02:00
|
|
|
static bool renderHtml = true;
|
2020-12-11 14:14:33 +01:00
|
|
|
static bool hideRedactedEvents = false;
|
2021-04-09 17:40:14 +02:00
|
|
|
static bool hideUnknownEvents = true;
|
2021-08-07 19:36:42 +02:00
|
|
|
static bool autoplayImages = true;
|
2021-08-24 20:43:21 +02:00
|
|
|
static bool sendOnEnter = false;
|
2020-12-12 17:01:59 +01:00
|
|
|
static const bool hideTypingUsernames = false;
|
2020-12-12 09:27:17 +01:00
|
|
|
static const bool hideAllStateEvents = false;
|
2020-12-11 14:14:33 +01:00
|
|
|
static const String inviteLinkPrefix = 'https://matrix.to/#/';
|
2021-01-10 18:00:27 +01:00
|
|
|
static const String schemePrefix = 'matrix:';
|
2020-12-11 14:14:33 +01:00
|
|
|
static const String pushNotificationsChannelId = 'fluffychat_push';
|
|
|
|
static const String pushNotificationsChannelName = 'FluffyChat push channel';
|
|
|
|
static const String pushNotificationsChannelDescription =
|
|
|
|
'Push notifications for FluffyChat';
|
|
|
|
static const String pushNotificationsAppId = 'chat.fluffy.fluffychat';
|
2021-01-14 18:00:16 +01:00
|
|
|
static const String pushNotificationsGatewayUrl =
|
2021-03-12 07:55:53 +01:00
|
|
|
'https://push.fluffychat.im/_matrix/push/v1/notify';
|
2020-12-11 14:14:33 +01:00
|
|
|
static const String pushNotificationsPusherFormat = 'event_id_only';
|
2021-01-20 19:53:19 +01:00
|
|
|
static const String emojiFontName = 'Noto Emoji';
|
|
|
|
static const String emojiFontUrl =
|
|
|
|
'https://github.com/googlefonts/noto-emoji/';
|
2021-02-07 09:12:34 +01:00
|
|
|
static const double borderRadius = 12.0;
|
2021-05-23 13:11:55 +02:00
|
|
|
static const double columnWidth = 360.0;
|
2020-12-18 11:43:13 +01:00
|
|
|
|
|
|
|
static void loadFromJson(Map<String, dynamic> json) {
|
|
|
|
if (json['application_name'] is String) {
|
|
|
|
_applicationName = json['application_name'];
|
|
|
|
}
|
|
|
|
if (json['application_welcome_message'] is String) {
|
|
|
|
_applicationWelcomeMessage = json['application_welcome_message'];
|
|
|
|
}
|
|
|
|
if (json['default_homeserver'] is String) {
|
|
|
|
_defaultHomeserver = json['default_homeserver'];
|
|
|
|
}
|
|
|
|
if (json['jitsi_instance'] is String) {
|
|
|
|
jitsiInstance = json['jitsi_instance'];
|
|
|
|
}
|
|
|
|
if (json['privacy_url'] is String) {
|
2021-06-18 15:38:01 +02:00
|
|
|
_webBaseUrl = json['privacy_url'];
|
|
|
|
}
|
|
|
|
if (json['web_base_url'] is String) {
|
|
|
|
_privacyUrl = json['web_base_url'];
|
2020-12-18 11:43:13 +01:00
|
|
|
}
|
|
|
|
if (json['render_html'] is bool) {
|
|
|
|
renderHtml = json['render_html'];
|
|
|
|
}
|
|
|
|
if (json['hide_redacted_events'] is bool) {
|
|
|
|
hideRedactedEvents = json['hide_redacted_events'];
|
|
|
|
}
|
|
|
|
if (json['hide_unknown_events'] is bool) {
|
|
|
|
hideUnknownEvents = json['hide_unknown_events'];
|
|
|
|
}
|
|
|
|
}
|
2020-12-11 14:14:33 +01:00
|
|
|
}
|