Merge pull request #1943 from famedly/krille/add-additional-properties-for-login-flow
feat: Add additional properties for LoginFlow type
This commit is contained in:
commit
5e39ce9753
|
|
@ -2116,15 +2116,20 @@ class LoginFlow {
|
||||||
LoginFlow({
|
LoginFlow({
|
||||||
this.getLoginToken,
|
this.getLoginToken,
|
||||||
required this.type,
|
required this.type,
|
||||||
|
this.additionalProperties = const {},
|
||||||
});
|
});
|
||||||
|
|
||||||
LoginFlow.fromJson(Map<String, Object?> json)
|
LoginFlow.fromJson(Map<String, Object?> json)
|
||||||
: getLoginToken =
|
: getLoginToken =
|
||||||
((v) => v != null ? v as bool : null)(json['get_login_token']),
|
((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() {
|
Map<String, Object?> toJson() {
|
||||||
final getLoginToken = this.getLoginToken;
|
final getLoginToken = this.getLoginToken;
|
||||||
return {
|
return {
|
||||||
|
...additionalProperties,
|
||||||
if (getLoginToken != null) 'get_login_token': getLoginToken,
|
if (getLoginToken != null) 'get_login_token': getLoginToken,
|
||||||
'type': type,
|
'type': type,
|
||||||
};
|
};
|
||||||
|
|
@ -2142,6 +2147,8 @@ class LoginFlow {
|
||||||
/// logging in.
|
/// logging in.
|
||||||
String type;
|
String type;
|
||||||
|
|
||||||
|
Map<String, Object?> additionalProperties;
|
||||||
|
|
||||||
@dart.override
|
@dart.override
|
||||||
bool operator ==(Object other) =>
|
bool operator ==(Object other) =>
|
||||||
identical(this, other) ||
|
identical(this, other) ||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue