immich/mobile/lib/models/server_info/server_version.model.dart
shenlong e52b9d15b5
chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8

* chore: make build

* make pigeon

* chore: format files

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-28 14:04:03 -05:00

33 lines
917 B
Dart

import 'package:openapi/api.dart';
class ServerVersion {
final int major;
final int minor;
final int patch;
const ServerVersion({required this.major, required this.minor, required this.patch});
ServerVersion copyWith({int? major, int? minor, int? patch}) {
return ServerVersion(major: major ?? this.major, minor: minor ?? this.minor, patch: patch ?? this.patch);
}
@override
String toString() {
return 'ServerVersion(major: $major, minor: $minor, patch: $patch)';
}
ServerVersion.fromDto(ServerVersionResponseDto dto) : major = dto.major, minor = dto.minor, patch = dto.patch_;
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is ServerVersion && other.major == major && other.minor == minor && other.patch == patch;
}
@override
int get hashCode {
return major.hashCode ^ minor.hashCode ^ patch.hashCode;
}
}