mirror of
https://github.com/immich-app/immich.git
synced 2026-06-05 13:45:20 -04:00
feat(mobile): add three-state field serialization (#27231)
* bump to v7.22.0 and update patching * gen client * migrate mobile call sites
This commit is contained in:
+6
-7
@@ -14,7 +14,7 @@ class QueueCommandDto {
|
||||
/// Returns a new [QueueCommandDto] instance.
|
||||
QueueCommandDto({
|
||||
required this.command,
|
||||
this.force,
|
||||
this.force = const Optional.absent(),
|
||||
});
|
||||
|
||||
QueueCommand command;
|
||||
@@ -26,7 +26,7 @@ class QueueCommandDto {
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
bool? force;
|
||||
Optional<bool?> force;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is QueueCommandDto &&
|
||||
@@ -45,10 +45,9 @@ class QueueCommandDto {
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'command'] = this.command;
|
||||
if (this.force != null) {
|
||||
json[r'force'] = this.force;
|
||||
} else {
|
||||
// json[r'force'] = null;
|
||||
if (this.force.isPresent) {
|
||||
final value = this.force.value;
|
||||
json[r'force'] = value;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
@@ -63,7 +62,7 @@ class QueueCommandDto {
|
||||
|
||||
return QueueCommandDto(
|
||||
command: QueueCommand.fromJson(json[r'command'])!,
|
||||
force: mapValueOfType<bool>(json, r'force'),
|
||||
force: json.containsKey(r'force') ? Optional.present(mapValueOfType<bool>(json, r'force')) : const Optional.absent(),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user