2022-07-13 14:23:48 +02:00
|
|
|
import 'package:openapi/api.dart';
|
2022-03-22 08:22:04 +02:00
|
|
|
|
|
|
|
class ServerInfoState {
|
2022-07-13 14:23:48 +02:00
|
|
|
final ServerVersionReponseDto serverVersion;
|
2022-03-22 08:22:04 +02:00
|
|
|
final bool isVersionMismatch;
|
|
|
|
final String versionMismatchErrorMessage;
|
|
|
|
|
|
|
|
ServerInfoState({
|
|
|
|
required this.serverVersion,
|
|
|
|
required this.isVersionMismatch,
|
|
|
|
required this.versionMismatchErrorMessage,
|
|
|
|
});
|
|
|
|
|
|
|
|
ServerInfoState copyWith({
|
2022-07-13 14:23:48 +02:00
|
|
|
ServerVersionReponseDto? serverVersion,
|
2022-03-22 08:22:04 +02:00
|
|
|
bool? isVersionMismatch,
|
|
|
|
String? versionMismatchErrorMessage,
|
|
|
|
}) {
|
|
|
|
return ServerInfoState(
|
|
|
|
serverVersion: serverVersion ?? this.serverVersion,
|
|
|
|
isVersionMismatch: isVersionMismatch ?? this.isVersionMismatch,
|
2022-06-25 22:12:47 +02:00
|
|
|
versionMismatchErrorMessage:
|
|
|
|
versionMismatchErrorMessage ?? this.versionMismatchErrorMessage,
|
2022-03-22 08:22:04 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
2022-07-13 14:23:48 +02:00
|
|
|
return 'ServerInfoState( serverVersion: $serverVersion, isVersionMismatch: $isVersionMismatch, versionMismatchErrorMessage: $versionMismatchErrorMessage)';
|
2022-03-22 08:22:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
if (identical(this, other)) return true;
|
|
|
|
|
|
|
|
return other is ServerInfoState &&
|
|
|
|
other.serverVersion == serverVersion &&
|
|
|
|
other.isVersionMismatch == isVersionMismatch &&
|
|
|
|
other.versionMismatchErrorMessage == versionMismatchErrorMessage;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode {
|
2022-07-13 14:23:48 +02:00
|
|
|
return serverVersion.hashCode ^
|
2022-03-22 08:22:04 +02:00
|
|
|
isVersionMismatch.hashCode ^
|
|
|
|
versionMismatchErrorMessage.hashCode;
|
|
|
|
}
|
|
|
|
}
|