1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-21 01:39:59 +02:00
immich/mobile/lib/shared/models/server_info/server_features.model.dart
shenlong b05132a01a
refactor(mobile): server info to use data classes instead of dtos (#4591)
* refactor: server info model to use data classes instead of dtos

* mobile: add return types and refactor private variables in map / stack

---------

Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2023-10-22 15:15:34 -05:00

43 lines
798 B
Dart

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