server_info_state.model.dart 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'package:openapi/api.dart';
  2. class ServerInfoState {
  3. final ServerVersionReponseDto serverVersion;
  4. final bool isVersionMismatch;
  5. final String versionMismatchErrorMessage;
  6. ServerInfoState({
  7. required this.serverVersion,
  8. required this.isVersionMismatch,
  9. required this.versionMismatchErrorMessage,
  10. });
  11. ServerInfoState copyWith({
  12. ServerVersionReponseDto? serverVersion,
  13. bool? isVersionMismatch,
  14. String? versionMismatchErrorMessage,
  15. }) {
  16. return ServerInfoState(
  17. serverVersion: serverVersion ?? this.serverVersion,
  18. isVersionMismatch: isVersionMismatch ?? this.isVersionMismatch,
  19. versionMismatchErrorMessage:
  20. versionMismatchErrorMessage ?? this.versionMismatchErrorMessage,
  21. );
  22. }
  23. @override
  24. String toString() {
  25. return 'ServerInfoState( serverVersion: $serverVersion, isVersionMismatch: $isVersionMismatch, versionMismatchErrorMessage: $versionMismatchErrorMessage)';
  26. }
  27. @override
  28. bool operator ==(Object other) {
  29. if (identical(this, other)) return true;
  30. return other is ServerInfoState &&
  31. other.serverVersion == serverVersion &&
  32. other.isVersionMismatch == isVersionMismatch &&
  33. other.versionMismatchErrorMessage == versionMismatchErrorMessage;
  34. }
  35. @override
  36. int get hashCode {
  37. return serverVersion.hashCode ^
  38. isVersionMismatch.hashCode ^
  39. versionMismatchErrorMessage.hashCode;
  40. }
  41. }