mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
* chore(mobile): example freezed implementation on some models * Don't commit Freezed generated code * Freezed easy pass * Formatting fix * Generate Flutter debugging info
26 lines
726 B
Dart
26 lines
726 B
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
import 'package:openapi/api.dart';
|
|
|
|
part 'server_features.model.freezed.dart';
|
|
|
|
@freezed
|
|
abstract class ServerFeatures with _$ServerFeatures {
|
|
const factory ServerFeatures({
|
|
required bool trash,
|
|
required bool map,
|
|
required bool oauthEnabled,
|
|
required bool passwordLogin,
|
|
@Default(false) bool ocr,
|
|
@Default(false) bool smartSearch,
|
|
}) = _ServerFeatures;
|
|
|
|
factory ServerFeatures.fromDto(ServerFeaturesDto dto) => ServerFeatures(
|
|
trash: dto.trash,
|
|
map: dto.map,
|
|
oauthEnabled: dto.oauth,
|
|
passwordLogin: dto.passwordLogin,
|
|
ocr: dto.ocr,
|
|
smartSearch: dto.smartSearch,
|
|
);
|
|
}
|