feat: Add additional properties for LoginFlow type

This commit is contained in:
Krille 2024-10-22 15:03:38 +02:00
parent d8723b7339
commit 9918c5ab8f
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
1 changed files with 8 additions and 1 deletions

View File

@ -2116,15 +2116,20 @@ class LoginFlow {
LoginFlow({
this.getLoginToken,
required this.type,
this.additionalProperties = const {},
});
LoginFlow.fromJson(Map<String, Object?> json)
: getLoginToken =
((v) => v != null ? v as bool : null)(json['get_login_token']),
type = json['type'] as String;
type = json['type'] as String,
additionalProperties = Map.fromEntries(json.entries
.where((e) => !['get_login_token', 'type'].contains(e.key))
.map((e) => MapEntry(e.key, e.value)));
Map<String, Object?> toJson() {
final getLoginToken = this.getLoginToken;
return {
...additionalProperties,
if (getLoginToken != null) 'get_login_token': getLoginToken,
'type': type,
};
@ -2142,6 +2147,8 @@ class LoginFlow {
/// logging in.
String type;
Map<String, Object?> additionalProperties;
@dart.override
bool operator ==(Object other) =>
identical(this, other) ||