more refactors
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
class ServerConfig {
|
||||
final String? oauthButtonText;
|
||||
|
||||
@@ -11,12 +9,7 @@ class ServerConfig {
|
||||
);
|
||||
}
|
||||
|
||||
factory ServerConfig.fromDto(ServerConfigDto dto) => ServerConfig(
|
||||
oauthButtonText:
|
||||
dto.oauthButtonText.isEmpty ? null : dto.oauthButtonText,
|
||||
);
|
||||
|
||||
const ServerConfig.reset() : oauthButtonText = null;
|
||||
const ServerConfig.initial() : oauthButtonText = null;
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
|
||||
@@ -17,9 +17,9 @@ class ServerFeatureConfig {
|
||||
);
|
||||
}
|
||||
|
||||
const ServerFeatureConfig.reset()
|
||||
: features = const ServerFeatures.reset(),
|
||||
config = const ServerConfig.reset();
|
||||
const ServerFeatureConfig.initial()
|
||||
: features = const ServerFeatures.initial(),
|
||||
config = const ServerConfig.initial();
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
class ServerFeatures {
|
||||
final bool hasPasswordLogin;
|
||||
final bool hasOAuthLogin;
|
||||
@@ -16,12 +14,7 @@ class ServerFeatures {
|
||||
);
|
||||
}
|
||||
|
||||
factory ServerFeatures.fromDto(ServerFeaturesDto dto) => ServerFeatures(
|
||||
hasPasswordLogin: dto.passwordLogin,
|
||||
hasOAuthLogin: dto.oauth,
|
||||
);
|
||||
|
||||
const ServerFeatures.reset()
|
||||
const ServerFeatures.initial()
|
||||
: hasPasswordLogin = true,
|
||||
hasOAuthLogin = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user