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:
Timon
2026-06-03 14:13:17 +02:00
committed by GitHub
parent 1bb7517da0
commit 96d521e149
161 changed files with 3531 additions and 3369 deletions
+6 -7
View File
@@ -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;