2021-02-16 18:30:06 +00:00
|
|
|
import 'package:flutter/widgets.dart';
|
2021-02-20 08:24:51 +00:00
|
|
|
import 'package:version/version.dart';
|
2021-02-16 18:30:06 +00:00
|
|
|
|
|
|
|
/// Server static configuration
|
|
|
|
///
|
|
|
|
/// @author Pierre Hubert
|
|
|
|
|
2021-02-18 17:20:50 +00:00
|
|
|
class PasswordPolicy {
|
|
|
|
final bool allowMailInPassword;
|
|
|
|
final bool allowNameInPassword;
|
|
|
|
final int minPasswordLength;
|
|
|
|
final int minNumberUpperCaseLetters;
|
|
|
|
final int minNumberLowerCaseLetters;
|
|
|
|
final int minNumberDigits;
|
|
|
|
final int minNumberSpecialCharacters;
|
|
|
|
final int minCategoriesPresence;
|
|
|
|
|
|
|
|
const PasswordPolicy({
|
|
|
|
@required this.allowMailInPassword,
|
|
|
|
@required this.allowNameInPassword,
|
|
|
|
@required this.minPasswordLength,
|
|
|
|
@required this.minNumberUpperCaseLetters,
|
|
|
|
@required this.minNumberLowerCaseLetters,
|
|
|
|
@required this.minNumberDigits,
|
|
|
|
@required this.minNumberSpecialCharacters,
|
|
|
|
@required this.minCategoriesPresence,
|
|
|
|
}) : assert(allowMailInPassword != null),
|
|
|
|
assert(allowNameInPassword != null),
|
|
|
|
assert(minPasswordLength != null),
|
|
|
|
assert(minNumberUpperCaseLetters != null),
|
|
|
|
assert(minNumberLowerCaseLetters != null),
|
|
|
|
assert(minNumberDigits != null),
|
|
|
|
assert(minNumberSpecialCharacters != null),
|
|
|
|
assert(minCategoriesPresence != null);
|
|
|
|
}
|
|
|
|
|
2021-02-16 18:30:06 +00:00
|
|
|
class ServerDataConservationPolicy {
|
|
|
|
final int minInactiveAccountLifetime;
|
|
|
|
final int minNotificationLifetime;
|
|
|
|
final int minCommentsLifetime;
|
|
|
|
final int minPostsLifetime;
|
|
|
|
final int minConversationMessagesLifetime;
|
|
|
|
final int minLikesLifetime;
|
|
|
|
|
|
|
|
const ServerDataConservationPolicy({
|
|
|
|
@required this.minInactiveAccountLifetime,
|
|
|
|
@required this.minNotificationLifetime,
|
|
|
|
@required this.minCommentsLifetime,
|
|
|
|
@required this.minPostsLifetime,
|
|
|
|
@required this.minConversationMessagesLifetime,
|
|
|
|
@required this.minLikesLifetime,
|
|
|
|
}) : assert(minInactiveAccountLifetime != null),
|
|
|
|
assert(minNotificationLifetime != null),
|
|
|
|
assert(minCommentsLifetime != null),
|
|
|
|
assert(minPostsLifetime != null),
|
|
|
|
assert(minConversationMessagesLifetime != null),
|
|
|
|
assert(minLikesLifetime != null);
|
|
|
|
}
|
|
|
|
|
|
|
|
class ServerConfig {
|
2021-02-20 08:24:51 +00:00
|
|
|
final Version minSupportedMobileVersion;
|
2021-02-20 08:35:03 +00:00
|
|
|
final String termsURL;
|
2021-02-20 08:59:21 +00:00
|
|
|
final String playStoreURL;
|
|
|
|
final String androidDirectDownloadURL;
|
2021-02-18 17:20:50 +00:00
|
|
|
final PasswordPolicy passwordPolicy;
|
2021-02-16 18:30:06 +00:00
|
|
|
final ServerDataConservationPolicy dataConservationPolicy;
|
|
|
|
|
|
|
|
const ServerConfig({
|
2021-02-20 08:24:51 +00:00
|
|
|
@required this.minSupportedMobileVersion,
|
2021-02-20 08:35:03 +00:00
|
|
|
@required this.termsURL,
|
2021-02-20 08:59:21 +00:00
|
|
|
@required this.playStoreURL,
|
|
|
|
@required this.androidDirectDownloadURL,
|
2021-02-18 17:20:50 +00:00
|
|
|
@required this.passwordPolicy,
|
2021-02-16 18:30:06 +00:00
|
|
|
@required this.dataConservationPolicy,
|
2021-02-20 08:24:51 +00:00
|
|
|
}) : assert(minSupportedMobileVersion != null),
|
2021-02-20 08:35:03 +00:00
|
|
|
assert(termsURL != null),
|
2021-02-20 08:59:21 +00:00
|
|
|
assert(playStoreURL != null),
|
|
|
|
assert(androidDirectDownloadURL != null),
|
2021-02-20 08:24:51 +00:00
|
|
|
assert(passwordPolicy != null),
|
2021-02-18 17:20:50 +00:00
|
|
|
assert(dataConservationPolicy != null);
|
2021-02-16 18:30:06 +00:00
|
|
|
}
|