-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrealtime.freezed.dart
More file actions
286 lines (230 loc) · 8.43 KB
/
realtime.freezed.dart
File metadata and controls
286 lines (230 loc) · 8.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'realtime.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$RealtimeMessage {
String get topic; Map<String, dynamic> get payload;
/// Create a copy of RealtimeMessage
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$RealtimeMessageCopyWith<RealtimeMessage> get copyWith => _$RealtimeMessageCopyWithImpl<RealtimeMessage>(this as RealtimeMessage, _$identity);
/// Serializes this RealtimeMessage to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is RealtimeMessage&&(identical(other.topic, topic) || other.topic == topic)&&const DeepCollectionEquality().equals(other.payload, payload));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,topic,const DeepCollectionEquality().hash(payload));
@override
String toString() {
return 'RealtimeMessage(topic: $topic, payload: $payload)';
}
}
/// @nodoc
abstract mixin class $RealtimeMessageCopyWith<$Res> {
factory $RealtimeMessageCopyWith(RealtimeMessage value, $Res Function(RealtimeMessage) _then) = _$RealtimeMessageCopyWithImpl;
@useResult
$Res call({
String topic, Map<String, dynamic> payload
});
}
/// @nodoc
class _$RealtimeMessageCopyWithImpl<$Res>
implements $RealtimeMessageCopyWith<$Res> {
_$RealtimeMessageCopyWithImpl(this._self, this._then);
final RealtimeMessage _self;
final $Res Function(RealtimeMessage) _then;
/// Create a copy of RealtimeMessage
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? topic = null,Object? payload = null,}) {
return _then(_self.copyWith(
topic: null == topic ? _self.topic : topic // ignore: cast_nullable_to_non_nullable
as String,payload: null == payload ? _self.payload : payload // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>,
));
}
}
/// Adds pattern-matching-related methods to [RealtimeMessage].
extension RealtimeMessagePatterns on RealtimeMessage {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _RealtimeMessage value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _RealtimeMessage() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _RealtimeMessage value) $default,){
final _that = this;
switch (_that) {
case _RealtimeMessage():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _RealtimeMessage value)? $default,){
final _that = this;
switch (_that) {
case _RealtimeMessage() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String topic, Map<String, dynamic> payload)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _RealtimeMessage() when $default != null:
return $default(_that.topic,_that.payload);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String topic, Map<String, dynamic> payload) $default,) {final _that = this;
switch (_that) {
case _RealtimeMessage():
return $default(_that.topic,_that.payload);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String topic, Map<String, dynamic> payload)? $default,) {final _that = this;
switch (_that) {
case _RealtimeMessage() when $default != null:
return $default(_that.topic,_that.payload);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _RealtimeMessage extends RealtimeMessage {
const _RealtimeMessage({required this.topic, required final Map<String, dynamic> payload}): _payload = payload,super._();
factory _RealtimeMessage.fromJson(Map<String, dynamic> json) => _$RealtimeMessageFromJson(json);
@override final String topic;
final Map<String, dynamic> _payload;
@override Map<String, dynamic> get payload {
if (_payload is EqualUnmodifiableMapView) return _payload;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(_payload);
}
/// Create a copy of RealtimeMessage
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$RealtimeMessageCopyWith<_RealtimeMessage> get copyWith => __$RealtimeMessageCopyWithImpl<_RealtimeMessage>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$RealtimeMessageToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _RealtimeMessage&&(identical(other.topic, topic) || other.topic == topic)&&const DeepCollectionEquality().equals(other._payload, _payload));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,topic,const DeepCollectionEquality().hash(_payload));
@override
String toString() {
return 'RealtimeMessage(topic: $topic, payload: $payload)';
}
}
/// @nodoc
abstract mixin class _$RealtimeMessageCopyWith<$Res> implements $RealtimeMessageCopyWith<$Res> {
factory _$RealtimeMessageCopyWith(_RealtimeMessage value, $Res Function(_RealtimeMessage) _then) = __$RealtimeMessageCopyWithImpl;
@override @useResult
$Res call({
String topic, Map<String, dynamic> payload
});
}
/// @nodoc
class __$RealtimeMessageCopyWithImpl<$Res>
implements _$RealtimeMessageCopyWith<$Res> {
__$RealtimeMessageCopyWithImpl(this._self, this._then);
final _RealtimeMessage _self;
final $Res Function(_RealtimeMessage) _then;
/// Create a copy of RealtimeMessage
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? topic = null,Object? payload = null,}) {
return _then(_RealtimeMessage(
topic: null == topic ? _self.topic : topic // ignore: cast_nullable_to_non_nullable
as String,payload: null == payload ? _self._payload : payload // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>,
));
}
}
// dart format on