feat: make memories slideshow duration configurable (#22783)

This commit is contained in:
Mees Frensel 2025-11-08 23:46:43 +01:00 committed by GitHub
parent 4905bba694
commit 9cc88ed2a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 65 additions and 4 deletions

View file

@ -13,9 +13,19 @@ part of openapi.api;
class MemoriesUpdate {
/// Returns a new [MemoriesUpdate] instance.
MemoriesUpdate({
this.duration,
this.enabled,
});
/// Minimum value: 1
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? duration;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
@ -26,18 +36,25 @@ class MemoriesUpdate {
@override
bool operator ==(Object other) => identical(this, other) || other is MemoriesUpdate &&
other.duration == duration &&
other.enabled == enabled;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(duration == null ? 0 : duration!.hashCode) +
(enabled == null ? 0 : enabled!.hashCode);
@override
String toString() => 'MemoriesUpdate[enabled=$enabled]';
String toString() => 'MemoriesUpdate[duration=$duration, enabled=$enabled]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.duration != null) {
json[r'duration'] = this.duration;
} else {
// json[r'duration'] = null;
}
if (this.enabled != null) {
json[r'enabled'] = this.enabled;
} else {
@ -55,6 +72,7 @@ class MemoriesUpdate {
final json = value.cast<String, dynamic>();
return MemoriesUpdate(
duration: mapValueOfType<int>(json, r'duration'),
enabled: mapValueOfType<bool>(json, r'enabled'),
);
}