add adaptive_scaffold

This commit is contained in:
shenlong-tanwen
2024-05-24 09:42:02 +05:30
parent fb6253d2d1
commit 1631df70e9
295 changed files with 2540 additions and 44480 deletions
@@ -0,0 +1,42 @@
import 'package:openapi/openapi.dart';
class ServerFeatures {
final bool hasPasswordLogin;
final bool hasOAuthLogin;
const ServerFeatures({
required this.hasPasswordLogin,
required this.hasOAuthLogin,
});
ServerFeatures copyWith({bool? hasPasswordLogin, bool? hasOAuthLogin}) {
return ServerFeatures(
hasPasswordLogin: hasPasswordLogin ?? this.hasPasswordLogin,
hasOAuthLogin: hasOAuthLogin ?? this.hasOAuthLogin,
);
}
factory ServerFeatures.fromDto(ServerFeaturesDto dto) => ServerFeatures(
hasPasswordLogin: dto.passwordLogin,
hasOAuthLogin: dto.oauth,
);
const ServerFeatures.reset()
: hasPasswordLogin = true,
hasOAuthLogin = false;
@override
String toString() =>
'ServerFeatures(hasPasswordLogin: $hasPasswordLogin, hasOAuthLogin: $hasOAuthLogin)';
@override
bool operator ==(covariant ServerFeatures other) {
if (identical(this, other)) return true;
return other.hasPasswordLogin == hasPasswordLogin &&
other.hasOAuthLogin == hasOAuthLogin;
}
@override
int get hashCode => hasPasswordLogin.hashCode ^ hasOAuthLogin.hashCode;
}