1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Start to integrate push notifications

This commit is contained in:
2021-04-12 19:26:05 +02:00
parent 38c639331f
commit 612fc7b0d9
9 changed files with 324 additions and 2 deletions

View File

@ -1,25 +1,32 @@
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(clientName != null),
assert(splashBackgroundColor != null);
/// Get and set static configuration
static Config _config;

View File

@ -5,6 +5,17 @@ import 'package:version/version.dart';
///
/// @author Pierre Hubert
class NotificationsPolicy {
final bool hasFirebase;
final bool hasIndependent;
const NotificationsPolicy({
@required this.hasFirebase,
@required this.hasIndependent,
}) : assert(hasFirebase != null),
assert(hasIndependent != null);
}
class PasswordPolicy {
final bool allowMailInPassword;
final bool allowNameInPassword;
@ -106,6 +117,7 @@ class ServerConfig {
final String termsURL;
final String playStoreURL;
final String androidDirectDownloadURL;
final NotificationsPolicy notificationsPolicy;
final PasswordPolicy passwordPolicy;
final ServerDataConservationPolicy dataConservationPolicy;
final ConversationsPolicy conversationsPolicy;
@ -115,6 +127,7 @@ class ServerConfig {
@required this.termsURL,
@required this.playStoreURL,
@required this.androidDirectDownloadURL,
@required this.notificationsPolicy,
@required this.passwordPolicy,
@required this.dataConservationPolicy,
@required this.conversationsPolicy,
@ -122,6 +135,7 @@ class ServerConfig {
assert(termsURL != null),
assert(playStoreURL != null),
assert(androidDirectDownloadURL != null),
assert(notificationsPolicy != null),
assert(passwordPolicy != null),
assert(dataConservationPolicy != null),
assert(conversationsPolicy != null);