You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.9 KiB
62 lines
1.9 KiB
/// Configuration class that holds application settings.
|
|
///
|
|
/// This class contains environment-specific configuration values
|
|
/// such as API base URL, Immich settings, and logging settings.
|
|
class AppConfig {
|
|
/// The base URL for API requests.
|
|
final String apiBaseUrl;
|
|
|
|
/// Whether logging is enabled in the application.
|
|
final bool enableLogging;
|
|
|
|
/// Immich server base URL (e.g., 'https://immich.example.com').
|
|
final String immichBaseUrl;
|
|
|
|
/// Immich API key for authentication.
|
|
final String immichApiKey;
|
|
|
|
/// List of Nostr relay URLs for testing and production.
|
|
final List<String> nostrRelays;
|
|
|
|
/// Creates an [AppConfig] instance with the provided values.
|
|
///
|
|
/// [apiBaseUrl] - The base URL for API requests.
|
|
/// [enableLogging] - Whether logging should be enabled.
|
|
/// [immichBaseUrl] - Immich server base URL.
|
|
/// [immichApiKey] - Immich API key for authentication.
|
|
/// [nostrRelays] - List of Nostr relay URLs (e.g., ['wss://relay.example.com']).
|
|
const AppConfig({
|
|
required this.apiBaseUrl,
|
|
required this.enableLogging,
|
|
required this.immichBaseUrl,
|
|
required this.immichApiKey,
|
|
required this.nostrRelays,
|
|
});
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AppConfig(apiBaseUrl: $apiBaseUrl, enableLogging: $enableLogging, '
|
|
'immichBaseUrl: $immichBaseUrl, nostrRelays: ${nostrRelays.length})';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
if (identical(this, other)) return true;
|
|
return other is AppConfig &&
|
|
other.apiBaseUrl == apiBaseUrl &&
|
|
other.enableLogging == enableLogging &&
|
|
other.immichBaseUrl == immichBaseUrl &&
|
|
other.immichApiKey == immichApiKey &&
|
|
other.nostrRelays.toString() == nostrRelays.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
apiBaseUrl.hashCode ^
|
|
enableLogging.hashCode ^
|
|
immichBaseUrl.hashCode ^
|
|
immichApiKey.hashCode ^
|
|
nostrRelays.hashCode;
|
|
}
|
|
|