implemented a backend-independent emergency notice system
This commit is contained in:
@@ -17,12 +17,18 @@ class DevToolsSettings {
|
||||
@JsonKey(defaultValue: '')
|
||||
String marianumConnectCustomUrl;
|
||||
|
||||
/// Optional override for the backend-independent emergency-notice source.
|
||||
/// Empty falls back to [emergencyNoticeDefaultUrl].
|
||||
@JsonKey(defaultValue: '')
|
||||
String emergencyNoticeUrl;
|
||||
|
||||
DevToolsSettings({
|
||||
required this.showPerformanceOverlay,
|
||||
required this.checkerboardOffscreenLayers,
|
||||
required this.checkerboardRasterCacheImages,
|
||||
this.marianumConnectEndpoint = MarianumConnectEndpoint.live,
|
||||
this.marianumConnectCustomUrl = '',
|
||||
this.emergencyNoticeUrl = '',
|
||||
});
|
||||
|
||||
// Resolves the effective base URL, falling back to live when the custom URL
|
||||
@@ -43,6 +49,14 @@ class DevToolsSettings {
|
||||
static const String liveUrl = 'https://connect.marianum-fulda.de';
|
||||
static const String betaUrl = 'https://connect-beta.marianum-fulda.de';
|
||||
|
||||
/// Compiled-in source for the backend-independent emergency notice. Must live
|
||||
/// on infrastructure that is reachable even when MarianumConnect is down.
|
||||
static const String emergencyNoticeDefaultUrl = 'https://www.marianum-fulda.de/~aushang/marMobile.override';
|
||||
|
||||
String? resolveEmergencyNoticeUrl() =>
|
||||
sanitizeCustomUrl(emergencyNoticeUrl) ??
|
||||
sanitizeCustomUrl(emergencyNoticeDefaultUrl);
|
||||
|
||||
/// `true` in builds where plaintext HTTP custom endpoints are still allowed
|
||||
/// (debug, profile). Release builds keep this `false` and the picker
|
||||
/// rejects `http://` entirely.
|
||||
|
||||
@@ -19,6 +19,7 @@ DevToolsSettings _$DevToolsSettingsFromJson(
|
||||
) ??
|
||||
MarianumConnectEndpoint.live,
|
||||
marianumConnectCustomUrl: json['marianumConnectCustomUrl'] as String? ?? '',
|
||||
emergencyNoticeUrl: json['emergencyNoticeUrl'] as String? ?? '',
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DevToolsSettingsToJson(DevToolsSettings instance) =>
|
||||
@@ -29,6 +30,7 @@ Map<String, dynamic> _$DevToolsSettingsToJson(DevToolsSettings instance) =>
|
||||
'marianumConnectEndpoint':
|
||||
_$MarianumConnectEndpointEnumMap[instance.marianumConnectEndpoint]!,
|
||||
'marianumConnectCustomUrl': instance.marianumConnectCustomUrl,
|
||||
'emergencyNoticeUrl': instance.emergencyNoticeUrl,
|
||||
};
|
||||
|
||||
const _$MarianumConnectEndpointEnumMap = {
|
||||
|
||||
Reference in New Issue
Block a user