@@ -7,13 +7,13 @@ import '../models/profile.dart';
7
7
import '../models/validation_error.dart' ;
8
8
import 'response.dart' ;
9
9
10
- // TODO: preferences, subscriptions should be in `AccountResponse `
10
+ // TODO: preferences, subscriptions should be in `GetAccountResponse `
11
11
12
- /// The extension type for the account response.
12
+ /// The extension type for the get account response.
13
13
@JS ()
14
14
@anonymous
15
15
@staticInterop
16
- extension type AccountResponse (Response baseResponse) {
16
+ extension type GetAccountResponse (Response baseResponse) {
17
17
/// The timestamp of the creation of the user.
18
18
external String ? get created;
19
19
@@ -23,6 +23,11 @@ extension type AccountResponse(Response baseResponse) {
23
23
/// The verified and unverified email addresses of the user.
24
24
external Emails ? get emails;
25
25
26
+ /// Whether this account is currently in transition.
27
+ ///
28
+ /// An account that is in transition cannot be modified.
29
+ external bool ? get inTransition;
30
+
26
31
/// Whether the user is active.
27
32
external bool ? get isActive;
28
33
@@ -80,12 +85,17 @@ extension type AccountResponse(Response baseResponse) {
80
85
/// The timestamp when the user was verified.
81
86
external String ? get verified;
82
87
88
+ // TODO: add lockedUntil when DateTime static interop is fixed.
89
+ // Currently it is not supported, so add a static interop type for the date class
90
+ // See: https://github.com/dart-lang/sdk/issues/52021
91
+
83
92
/// Convert this response to a [Map] .
84
93
Map <String , dynamic > toMap () {
85
94
return < String , dynamic > {
86
95
'created' : created,
87
96
'data' : data.dartify (),
88
97
'emails' : emails? .toMap (),
98
+ 'inTransition' : inTransition,
89
99
'isActive' : isActive,
90
100
'isRegistered' : isRegistered,
91
101
'isVerified' : isVerified,
@@ -105,29 +115,6 @@ extension type AccountResponse(Response baseResponse) {
105
115
'UIDSignature' : UIDSignature ,
106
116
'verified' : verified,
107
117
};
108
- }
109
- }
110
-
111
- /// The extension type for the get account response.
112
- @JS ()
113
- @anonymous
114
- @staticInterop
115
- extension type GetAccountResponse (AccountResponse accountResponse) {
116
- /// Whether this account is currently in transition.
117
- ///
118
- /// An account that is in transition cannot be modified.
119
- external bool ? get inTransition;
120
-
121
- // TODO: add lockedUntil when DateTime static interop is fixed.
122
- // Currently it is not supported, so add a static interop type for the date class
123
- // See: https://github.com/dart-lang/sdk/issues/52021
124
-
125
- /// Convert this response to a [Map] .
126
- Map <String , dynamic > toMap () {
127
- return < String , dynamic > {
128
- ...accountResponse.toMap (),
129
- 'inTransition' : inTransition,
130
- };
131
118
}
132
119
}
133
120
0 commit comments