server_features.model.dart 798 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:openapi/api.dart';
  2. class ServerFeatures {
  3. final bool trash;
  4. final bool map;
  5. const ServerFeatures({
  6. required this.trash,
  7. required this.map,
  8. });
  9. ServerFeatures copyWith({
  10. bool? trash,
  11. bool? map,
  12. }) {
  13. return ServerFeatures(
  14. trash: trash ?? this.trash,
  15. map: map ?? this.map,
  16. );
  17. }
  18. @override
  19. String toString() {
  20. return 'ServerFeatures(trash: $trash, map: $map)';
  21. }
  22. ServerFeatures.fromDto(ServerFeaturesDto dto)
  23. : trash = dto.trash,
  24. map = dto.map;
  25. @override
  26. bool operator ==(Object other) {
  27. if (identical(this, other)) return true;
  28. return other is ServerFeatures && other.trash == trash && other.map == map;
  29. }
  30. @override
  31. int get hashCode {
  32. return trash.hashCode ^ map.hashCode;
  33. }
  34. }