File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,30 @@ StreamMessage streamMessage(
71
71
});
72
72
}
73
73
74
+ User user ({int ? userId, String ? fullName}) {
75
+ // The use of JSON here is convenient in order to delegate parts of the data
76
+ // to helper functions. The main downside is that it loses static typing
77
+ // of the properties as we're constructing the data. That's probably OK
78
+ // because (a) this is only for tests; (b) the types do get checked
79
+ // dynamically in the constructor, so any ill-typing won't propagate further.
80
+ return User .fromJson ({
81
+ 'user_id' : userId ?? 123 , // TODO generate example IDs
82
+
83
+ 'full_name' : fullName ?? 'Full Name' ,
84
+ 'date_joined' : '2023-04-28' ,
85
+ 'is_active' : true ,
86
+ 'is_owner' : false ,
87
+ 'is_admin' : false ,
88
+ 'is_guest' : false ,
89
+ 'is_billing_admin' : false ,
90
+ 'is_bot' : false ,
91
+ 'role' : 400 ,
92
+ 'timezone' : 'UTC' ,
93
+ 'avatar_version' : 0 ,
94
+ 'profile_data' : < String , dynamic > {},
95
+ });
96
+ }
97
+
74
98
// TODO example data for many more types
75
99
76
100
final InitialSnapshot initialSnapshot = InitialSnapshot (
You can’t perform that action at this time.
0 commit comments