1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-30 14:58:52 +00:00
comunicmobile/lib/models/config.dart

47 lines
1.0 KiB
Dart

import 'dart:ui';
import 'package:meta/meta.dart';
/// Application configuration model
///
/// @author Pierre HUBERT
const defaultColor = Color(0xFF1A237E);
/// Configuration class
class Config {
final String apiServerName;
final String apiServerUri;
final bool apiServerSecure;
final String clientName;
final Color splashBackgroundColor;
const Config({
@required this.apiServerName,
@required this.apiServerUri,
@required this.apiServerSecure,
@required this.clientName,
this.splashBackgroundColor = defaultColor,
}) : assert(apiServerName != null),
assert(apiServerUri != null),
assert(apiServerSecure != null),
assert(clientName != null),
assert(splashBackgroundColor != null);
/// Get and set static configuration
static Config _config;
static Config get() {
return _config;
}
static void set(Config conf) {
_config = conf;
}
}
/// Get the current configuration of the application
Config config() {
return Config.get();
}