fluffychat/lib/config/app_config.dart

75 lines
3.2 KiB
Dart
Raw Normal View History

2021-01-24 15:38:25 +00:00
import 'dart:ui';
2020-12-11 13:14:33 +00:00
abstract class AppConfig {
2020-12-18 10:43:13 +00:00
static String _applicationName = 'FluffyChat';
static String get applicationName => _applicationName;
static String _applicationWelcomeMessage;
static String get applicationWelcomeMessage => _applicationWelcomeMessage;
static String _defaultHomeserver = 'tchncs.de';
2020-12-18 10:43:13 +00:00
static String get defaultHomeserver => _defaultHomeserver;
2020-12-11 13:14:33 +00:00
static String jitsiInstance = 'https://meet.jit.si/';
2021-02-07 07:59:58 +00:00
static double fontSizeFactor = 1.0;
2020-12-11 13:14:33 +00:00
static const bool allowOtherHomeservers = true;
static const bool enableRegistration = true;
2021-01-24 15:38:25 +00:00
static const Color primaryColor = Color(0xFF5625BA);
2021-01-31 22:54:33 +00:00
static const Color primaryColorLight = Color(0xFFCCBDEA);
static const Color secondaryColor = Color(0xFF41a2bc);
2020-12-18 10:43:13 +00:00
static String _privacyUrl = 'https://fluffychat.im/en/privacy.html';
static String get privacyUrl => _privacyUrl;
2021-01-18 21:59:02 +00:00
static const String appId = 'im.fluffychat.FluffyChat';
2021-02-01 11:12:28 +00:00
static const String appOpenUrlScheme = 'im.fluffychat';
2020-12-23 09:20:24 +00:00
static const String sourceCodeUrl = 'https://gitlab.com/famedly/fluffychat';
2020-12-11 13:14:33 +00:00
static const String supportUrl =
2020-12-23 09:15:25 +00:00
'https://gitlab.com/famedly/fluffychat/issues';
2020-12-11 13:14:33 +00:00
static const bool enableSentry = true;
static const String sentryDns =
'https://8591d0d863b646feb4f3dda7e5dcab38@o256755.ingest.sentry.io/5243143';
static bool renderHtml = true;
2020-12-11 13:14:33 +00:00
static bool hideRedactedEvents = false;
static bool hideUnknownEvents = true;
2020-12-12 16:01:59 +00:00
static const bool hideTypingUsernames = false;
2020-12-12 08:27:17 +00:00
static const bool hideAllStateEvents = false;
2020-12-11 13:14:33 +00:00
static const String inviteLinkPrefix = 'https://matrix.to/#/';
static const String schemePrefix = 'matrix:';
2020-12-11 13:14:33 +00: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 17:00:16 +00:00
static const String pushNotificationsGatewayUrl =
2021-03-12 06:55:53 +00:00
'https://push.fluffychat.im/_matrix/push/v1/notify';
2020-12-11 13:14:33 +00:00
static const String pushNotificationsPusherFormat = 'event_id_only';
2021-01-20 18:53:19 +00:00
static const String emojiFontName = 'Noto Emoji';
static const String emojiFontUrl =
'https://github.com/googlefonts/noto-emoji/';
2021-02-07 08:12:34 +00:00
static const double borderRadius = 12.0;
2021-05-23 11:11:55 +00:00
static const double columnWidth = 360.0;
2020-12-18 10:43:13 +00: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) {
_privacyUrl = json['privacy_url'];
}
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 13:14:33 +00:00
}