chore(llc): re-generate all files

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-04-08 15:30:57 +05:30
parent c80fc0a6b4
commit c289871a56
21 changed files with 507 additions and 636 deletions
@@ -13,7 +13,10 @@ Map<String, dynamic> _$SortOptionToJson<T>(SortOption<T> instance) =>
};
Map<String, dynamic> _$PaginationParamsToJson(PaginationParams instance) {
final val = <String, dynamic>{};
final val = <String, dynamic>{
'limit': instance.limit,
'offset': instance.offset,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
@@ -21,11 +24,10 @@ Map<String, dynamic> _$PaginationParamsToJson(PaginationParams instance) {
}
}
writeNotNull('limit', instance.limit);
writeNotNull('offset', instance.offset);
writeNotNull('id_gt', instance.greaterThan);
writeNotNull('id_gte', instance.greaterThanOrEqual);
writeNotNull('id_lt', instance.lessThan);
writeNotNull('id_lte', instance.lessThanOrEqual);
val['hash_code'] = instance.hashCode;
return val;
}
+128 -186
View File
@@ -8,392 +8,334 @@ part of 'responses.dart';
SyncResponse _$SyncResponseFromJson(Map json) {
return SyncResponse()
..duration = json['duration'] as String
..events = (json['events'] as List)
?.map((e) => e == null
? null
: Event.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList();
..duration = json['duration'] as String?
..events = (json['events'] as List<dynamic>?)
?.map((e) => Event.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList();
}
QueryChannelsResponse _$QueryChannelsResponseFromJson(Map json) {
return QueryChannelsResponse()
..duration = json['duration'] as String
..channels = (json['channels'] as List)
?.map((e) => e == null ? null : ChannelState.fromJson(e as Map))
?.toList();
..duration = json['duration'] as String?
..channels = (json['channels'] as List<dynamic>?)
?.map((e) => ChannelState.fromJson(e as Map))
.toList();
}
TranslateMessageResponse _$TranslateMessageResponseFromJson(Map json) {
return TranslateMessageResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..message = json['message'] == null
? null
: TranslatedMessage.fromJson((json['message'] as Map)?.map(
: TranslatedMessage.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
QueryMembersResponse _$QueryMembersResponseFromJson(Map json) {
return QueryMembersResponse()
..duration = json['duration'] as String
..members = (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList();
..duration = json['duration'] as String?
..members = (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList();
}
QueryUsersResponse _$QueryUsersResponseFromJson(Map json) {
return QueryUsersResponse()
..duration = json['duration'] as String
..users = (json['users'] as List)
?.map((e) => e == null
? null
: User.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList();
..duration = json['duration'] as String?
..users = (json['users'] as List<dynamic>?)
?.map((e) => User.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList();
}
QueryReactionsResponse _$QueryReactionsResponseFromJson(Map json) {
return QueryReactionsResponse()
..duration = json['duration'] as String
..reactions = (json['reactions'] as List)
?.map((e) => e == null
? null
: Reaction.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList();
..duration = json['duration'] as String?
..reactions = (json['reactions'] as List<dynamic>?)
?.map((e) => Reaction.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList();
}
QueryRepliesResponse _$QueryRepliesResponseFromJson(Map json) {
return QueryRepliesResponse()
..duration = json['duration'] as String
..messages = (json['messages'] as List)
?.map((e) => e == null
? null
: Message.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList();
..duration = json['duration'] as String?
..messages = (json['messages'] as List<dynamic>?)
?.map((e) => Message.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList();
}
ListDevicesResponse _$ListDevicesResponseFromJson(Map json) {
return ListDevicesResponse()
..duration = json['duration'] as String
..devices = (json['devices'] as List)
?.map((e) => e == null
? null
: Device.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList();
..duration = json['duration'] as String?
..devices = (json['devices'] as List<dynamic>?)
?.map((e) => Device.fromJson(Map<String, dynamic>.from(e as Map)))
.toList();
}
SendFileResponse _$SendFileResponseFromJson(Map json) {
return SendFileResponse()
..duration = json['duration'] as String
..file = json['file'] as String;
..duration = json['duration'] as String?
..file = json['file'] as String?;
}
SendImageResponse _$SendImageResponseFromJson(Map json) {
return SendImageResponse()
..duration = json['duration'] as String
..file = json['file'] as String;
..duration = json['duration'] as String?
..file = json['file'] as String?;
}
SendReactionResponse _$SendReactionResponseFromJson(Map json) {
return SendReactionResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..reaction = json['reaction'] == null
? null
: Reaction.fromJson((json['reaction'] as Map)?.map(
: Reaction.fromJson((json['reaction'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
ConnectGuestUserResponse _$ConnectGuestUserResponseFromJson(Map json) {
return ConnectGuestUserResponse()
..duration = json['duration'] as String
..accessToken = json['access_token'] as String
..duration = json['duration'] as String?
..accessToken = json['access_token'] as String?
..user = json['user'] == null
? null
: User.fromJson((json['user'] as Map)?.map(
: User.fromJson((json['user'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
UpdateUsersResponse _$UpdateUsersResponseFromJson(Map json) {
return UpdateUsersResponse()
..duration = json['duration'] as String
..users = (json['users'] as Map)?.map(
..duration = json['duration'] as String?
..users = (json['users'] as Map?)?.map(
(k, e) => MapEntry(
k as String,
e == null
? null
: User.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
))),
User.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))),
);
}
UpdateMessageResponse _$UpdateMessageResponseFromJson(Map json) {
return UpdateMessageResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
SendMessageResponse _$SendMessageResponseFromJson(Map json) {
return SendMessageResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
GetMessageResponse _$GetMessageResponseFromJson(Map json) {
return GetMessageResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..channel = json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
SearchMessagesResponse _$SearchMessagesResponseFromJson(Map json) {
return SearchMessagesResponse()
..duration = json['duration'] as String
..results = (json['results'] as List)
?.map((e) => e == null ? null : GetMessageResponse.fromJson(e as Map))
?.toList();
..duration = json['duration'] as String?
..results = (json['results'] as List<dynamic>?)
?.map((e) => GetMessageResponse.fromJson(e as Map))
.toList();
}
GetMessagesByIdResponse _$GetMessagesByIdResponseFromJson(Map json) {
return GetMessagesByIdResponse()
..duration = json['duration'] as String
..messages = (json['messages'] as List)
?.map((e) => e == null
? null
: Message.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList();
..duration = json['duration'] as String?
..messages = (json['messages'] as List<dynamic>?)
?.map((e) => Message.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList();
}
UpdateChannelResponse _$UpdateChannelResponseFromJson(Map json) {
return UpdateChannelResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..channel = json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..members = (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList()
..members = (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList()
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
PartialUpdateChannelResponse _$PartialUpdateChannelResponseFromJson(Map json) {
return PartialUpdateChannelResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..channel = json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..members = (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList();
..members = (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList();
}
InviteMembersResponse _$InviteMembersResponseFromJson(Map json) {
return InviteMembersResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..channel = json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..members = (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList()
..members = (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList()
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
RemoveMembersResponse _$RemoveMembersResponseFromJson(Map json) {
return RemoveMembersResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..channel = json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..members = (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList()
..members = (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList()
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
SendActionResponse _$SendActionResponseFromJson(Map json) {
return SendActionResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
AddMembersResponse _$AddMembersResponseFromJson(Map json) {
return AddMembersResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..channel = json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..members = (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList()
..members = (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList()
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
AcceptInviteResponse _$AcceptInviteResponseFromJson(Map json) {
return AcceptInviteResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..channel = json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..members = (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList()
..members = (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList()
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
RejectInviteResponse _$RejectInviteResponseFromJson(Map json) {
return RejectInviteResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..channel = json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..members = (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList()
..members = (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList()
..message = json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
));
}
EmptyResponse _$EmptyResponseFromJson(Map json) {
return EmptyResponse()..duration = json['duration'] as String;
return EmptyResponse()..duration = json['duration'] as String?;
}
ChannelStateResponse _$ChannelStateResponseFromJson(Map json) {
return ChannelStateResponse()
..duration = json['duration'] as String
..duration = json['duration'] as String?
..channel = json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
))
..messages = (json['messages'] as List)
?.map((e) => e == null
? null
: Message.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList()
..members = (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList()
..watcherCount = json['watcher_count'] as int
..read = (json['read'] as List)
?.map((e) => e == null
? null
: Read.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList();
..messages = (json['messages'] as List<dynamic>?)
?.map((e) => Message.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList()
..members = (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList()
..watcherCount = json['watcher_count'] as int?
..read = (json['read'] as List<dynamic>?)
?.map((e) => Read.fromJson(Map<String, dynamic>.from(e as Map)))
.toList();
}
@@ -8,11 +8,11 @@ part of 'action.dart';
Action _$ActionFromJson(Map json) {
return Action(
name: json['name'] as String,
style: json['style'] as String,
text: json['text'] as String,
type: json['type'] as String,
value: json['value'] as String,
name: json['name'] as String?,
style: json['style'] as String?,
text: json['text'] as String?,
type: json['type'] as String?,
value: json['value'] as String?,
);
}
@@ -8,44 +8,38 @@ part of 'attachment.dart';
Attachment _$AttachmentFromJson(Map json) {
return Attachment(
id: json['id'] as String,
type: json['type'] as String,
titleLink: json['title_link'] as String,
title: json['title'] as String,
thumbUrl: json['thumb_url'] as String,
text: json['text'] as String,
pretext: json['pretext'] as String,
ogScrapeUrl: json['og_scrape_url'] as String,
imageUrl: json['image_url'] as String,
footerIcon: json['footer_icon'] as String,
footer: json['footer'] as String,
id: json['id'] as String?,
type: json['type'] as String?,
titleLink: json['title_link'] as String?,
title: json['title'] as String?,
thumbUrl: json['thumb_url'] as String?,
text: json['text'] as String?,
pretext: json['pretext'] as String?,
ogScrapeUrl: json['og_scrape_url'] as String?,
imageUrl: json['image_url'] as String?,
footerIcon: json['footer_icon'] as String?,
footer: json['footer'] as String?,
fields: json['fields'],
fallback: json['fallback'] as String,
color: json['color'] as String,
authorName: json['author_name'] as String,
authorLink: json['author_link'] as String,
authorIcon: json['author_icon'] as String,
assetUrl: json['asset_url'] as String,
actions: (json['actions'] as List)
?.map((e) => e == null
? null
: Action.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
extraData: (json['extra_data'] as Map)?.map(
fallback: json['fallback'] as String?,
color: json['color'] as String?,
authorName: json['author_name'] as String?,
authorLink: json['author_link'] as String?,
authorIcon: json['author_icon'] as String?,
assetUrl: json['asset_url'] as String?,
actions: (json['actions'] as List<dynamic>?)
?.map((e) => Action.fromJson(Map<String, dynamic>.from(e as Map)))
.toList(),
extraData: (json['extra_data'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
),
file: json['file'] == null
? null
: AttachmentFile.fromJson((json['file'] as Map)?.map(
(k, e) => MapEntry(k as String, e),
)),
: AttachmentFile.fromJson(
Map<String, dynamic>.from(json['file'] as Map)),
uploadState: json['upload_state'] == null
? null
: UploadState.fromJson((json['upload_state'] as Map)?.map(
(k, e) => MapEntry(k as String, e),
)),
: UploadState.fromJson(
Map<String, dynamic>.from(json['upload_state'] as Map)),
);
}
@@ -75,10 +69,10 @@ Map<String, dynamic> _$AttachmentToJson(Attachment instance) {
writeNotNull('author_link', instance.authorLink);
writeNotNull('author_icon', instance.authorIcon);
writeNotNull('asset_url', instance.assetUrl);
writeNotNull('actions', instance.actions?.map((e) => e?.toJson())?.toList());
writeNotNull('actions', instance.actions?.map((e) => e.toJson()).toList());
writeNotNull('file', instance.file?.toJson());
writeNotNull('upload_state', instance.uploadState?.toJson());
writeNotNull('extra_data', instance.extraData);
writeNotNull('id', instance.id);
val['id'] = instance.id;
return val;
}
@@ -4,16 +4,18 @@ import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:meta/meta.dart';
part 'attachment_file.freezed.dart';
part 'attachment_file.g.dart';
/// Union class to hold various [UploadState] of a attachment.
@freezed
abstract class UploadState with _$UploadState {
class UploadState with _$UploadState {
/// Preparing state of the union
const factory UploadState.preparing() = Preparing;
/// InProgress state of the union
const factory UploadState.inProgress({int uploaded, int total}) = InProgress;
const factory UploadState.inProgress(
{required int uploaded, required int total}) = InProgress;
/// Success state of the union
const factory UploadState.success() = Success;
@@ -41,9 +43,15 @@ extension UploadStateX on UploadState? {
bool get isFailed => this is Failed;
}
Uint8List _fromString(String bytes) => Uint8List.fromList(bytes.codeUnits);
Uint8List? _fromString(String? bytes) {
if (bytes == null) return null;
return Uint8List.fromList(bytes.codeUnits);
}
String _toString(Uint8List bytes) => String.fromCharCodes(bytes);
String? _toString(Uint8List? bytes) {
if (bytes == null) return null;
return String.fromCharCodes(bytes);
}
/// The class that contains the information about an attachment file
@JsonSerializable()
@@ -1,5 +1,5 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: 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
// 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
part of 'attachment_file.dart';
@@ -8,6 +8,10 @@ part of 'attachment_file.dart';
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
switch (json['runtimeType'] as String) {
case 'preparing':
@@ -28,74 +32,72 @@ UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
class _$UploadStateTearOff {
const _$UploadStateTearOff();
// ignore: unused_element
Preparing preparing() {
return const Preparing();
}
// ignore: unused_element
InProgress inProgress({int uploaded, int total}) {
InProgress inProgress({required int uploaded, required int total}) {
return InProgress(
uploaded: uploaded,
total: total,
);
}
// ignore: unused_element
Success success() {
return const Success();
}
// ignore: unused_element
Failed failed({@required String error}) {
Failed failed({required String error}) {
return Failed(
error: error,
);
}
// ignore: unused_element
UploadState fromJson(Map<String, Object> json) {
return UploadState.fromJson(json);
}
}
/// @nodoc
// ignore: unused_element
const $UploadState = _$UploadStateTearOff();
/// @nodoc
mixin _$UploadState {
@optionalTypeArgs
TResult when<TResult extends Object>({
@required TResult preparing(),
@required TResult inProgress(int uploaded, int total),
@required TResult success(),
@required TResult failed(String error),
});
TResult when<TResult extends Object?>({
required TResult Function() preparing,
required TResult Function(int uploaded, int total) inProgress,
required TResult Function() success,
required TResult Function(String error) failed,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object>({
TResult preparing(),
TResult inProgress(int uploaded, int total),
TResult success(),
TResult failed(String error),
@required TResult orElse(),
});
TResult maybeWhen<TResult extends Object?>({
TResult Function()? preparing,
TResult Function(int uploaded, int total)? inProgress,
TResult Function()? success,
TResult Function(String error)? failed,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object>({
@required TResult preparing(Preparing value),
@required TResult inProgress(InProgress value),
@required TResult success(Success value),
@required TResult failed(Failed value),
});
TResult map<TResult extends Object?>({
required TResult Function(Preparing value) preparing,
required TResult Function(InProgress value) inProgress,
required TResult Function(Success value) success,
required TResult Function(Failed value) failed,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object>({
TResult preparing(Preparing value),
TResult inProgress(InProgress value),
TResult success(Success value),
TResult failed(Failed value),
@required TResult orElse(),
});
Map<String, dynamic> toJson();
TResult maybeMap<TResult extends Object?>({
TResult Function(Preparing value)? preparing,
TResult Function(InProgress value)? inProgress,
TResult Function(Success value)? success,
TResult Function(Failed value)? failed,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
}
/// @nodoc
@@ -154,29 +156,24 @@ class _$Preparing implements Preparing {
@override
@optionalTypeArgs
TResult when<TResult extends Object>({
@required TResult preparing(),
@required TResult inProgress(int uploaded, int total),
@required TResult success(),
@required TResult failed(String error),
TResult when<TResult extends Object?>({
required TResult Function() preparing,
required TResult Function(int uploaded, int total) inProgress,
required TResult Function() success,
required TResult Function(String error) failed,
}) {
assert(preparing != null);
assert(inProgress != null);
assert(success != null);
assert(failed != null);
return preparing();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object>({
TResult preparing(),
TResult inProgress(int uploaded, int total),
TResult success(),
TResult failed(String error),
@required TResult orElse(),
TResult maybeWhen<TResult extends Object?>({
TResult Function()? preparing,
TResult Function(int uploaded, int total)? inProgress,
TResult Function()? success,
TResult Function(String error)? failed,
required TResult orElse(),
}) {
assert(orElse != null);
if (preparing != null) {
return preparing();
}
@@ -185,29 +182,24 @@ class _$Preparing implements Preparing {
@override
@optionalTypeArgs
TResult map<TResult extends Object>({
@required TResult preparing(Preparing value),
@required TResult inProgress(InProgress value),
@required TResult success(Success value),
@required TResult failed(Failed value),
TResult map<TResult extends Object?>({
required TResult Function(Preparing value) preparing,
required TResult Function(InProgress value) inProgress,
required TResult Function(Success value) success,
required TResult Function(Failed value) failed,
}) {
assert(preparing != null);
assert(inProgress != null);
assert(success != null);
assert(failed != null);
return preparing(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object>({
TResult preparing(Preparing value),
TResult inProgress(InProgress value),
TResult success(Success value),
TResult failed(Failed value),
@required TResult orElse(),
TResult maybeMap<TResult extends Object?>({
TResult Function(Preparing value)? preparing,
TResult Function(InProgress value)? inProgress,
TResult Function(Success value)? success,
TResult Function(Failed value)? failed,
required TResult orElse(),
}) {
assert(orElse != null);
if (preparing != null) {
return preparing(this);
}
@@ -245,12 +237,18 @@ class _$InProgressCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
@override
$Res call({
Object uploaded = freezed,
Object total = freezed,
Object? uploaded = freezed,
Object? total = freezed,
}) {
return _then(InProgress(
uploaded: uploaded == freezed ? _value.uploaded : uploaded as int,
total: total == freezed ? _value.total : total as int,
uploaded: uploaded == freezed
? _value.uploaded
: uploaded // ignore: cast_nullable_to_non_nullable
as int,
total: total == freezed
? _value.total
: total // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
@@ -259,7 +257,7 @@ class _$InProgressCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
/// @nodoc
class _$InProgress implements InProgress {
const _$InProgress({this.uploaded, this.total});
const _$InProgress({required this.uploaded, required this.total});
factory _$InProgress.fromJson(Map<String, dynamic> json) =>
_$_$InProgressFromJson(json);
@@ -298,29 +296,24 @@ class _$InProgress implements InProgress {
@override
@optionalTypeArgs
TResult when<TResult extends Object>({
@required TResult preparing(),
@required TResult inProgress(int uploaded, int total),
@required TResult success(),
@required TResult failed(String error),
TResult when<TResult extends Object?>({
required TResult Function() preparing,
required TResult Function(int uploaded, int total) inProgress,
required TResult Function() success,
required TResult Function(String error) failed,
}) {
assert(preparing != null);
assert(inProgress != null);
assert(success != null);
assert(failed != null);
return inProgress(uploaded, total);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object>({
TResult preparing(),
TResult inProgress(int uploaded, int total),
TResult success(),
TResult failed(String error),
@required TResult orElse(),
TResult maybeWhen<TResult extends Object?>({
TResult Function()? preparing,
TResult Function(int uploaded, int total)? inProgress,
TResult Function()? success,
TResult Function(String error)? failed,
required TResult orElse(),
}) {
assert(orElse != null);
if (inProgress != null) {
return inProgress(uploaded, total);
}
@@ -329,29 +322,24 @@ class _$InProgress implements InProgress {
@override
@optionalTypeArgs
TResult map<TResult extends Object>({
@required TResult preparing(Preparing value),
@required TResult inProgress(InProgress value),
@required TResult success(Success value),
@required TResult failed(Failed value),
TResult map<TResult extends Object?>({
required TResult Function(Preparing value) preparing,
required TResult Function(InProgress value) inProgress,
required TResult Function(Success value) success,
required TResult Function(Failed value) failed,
}) {
assert(preparing != null);
assert(inProgress != null);
assert(success != null);
assert(failed != null);
return inProgress(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object>({
TResult preparing(Preparing value),
TResult inProgress(InProgress value),
TResult success(Success value),
TResult failed(Failed value),
@required TResult orElse(),
TResult maybeMap<TResult extends Object?>({
TResult Function(Preparing value)? preparing,
TResult Function(InProgress value)? inProgress,
TResult Function(Success value)? success,
TResult Function(Failed value)? failed,
required TResult orElse(),
}) {
assert(orElse != null);
if (inProgress != null) {
return inProgress(this);
}
@@ -365,15 +353,17 @@ class _$InProgress implements InProgress {
}
abstract class InProgress implements UploadState {
const factory InProgress({int uploaded, int total}) = _$InProgress;
const factory InProgress({required int uploaded, required int total}) =
_$InProgress;
factory InProgress.fromJson(Map<String, dynamic> json) =
_$InProgress.fromJson;
int get uploaded;
int get total;
int get uploaded => throw _privateConstructorUsedError;
int get total => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$InProgressCopyWith<InProgress> get copyWith;
$InProgressCopyWith<InProgress> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
@@ -416,29 +406,24 @@ class _$Success implements Success {
@override
@optionalTypeArgs
TResult when<TResult extends Object>({
@required TResult preparing(),
@required TResult inProgress(int uploaded, int total),
@required TResult success(),
@required TResult failed(String error),
TResult when<TResult extends Object?>({
required TResult Function() preparing,
required TResult Function(int uploaded, int total) inProgress,
required TResult Function() success,
required TResult Function(String error) failed,
}) {
assert(preparing != null);
assert(inProgress != null);
assert(success != null);
assert(failed != null);
return success();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object>({
TResult preparing(),
TResult inProgress(int uploaded, int total),
TResult success(),
TResult failed(String error),
@required TResult orElse(),
TResult maybeWhen<TResult extends Object?>({
TResult Function()? preparing,
TResult Function(int uploaded, int total)? inProgress,
TResult Function()? success,
TResult Function(String error)? failed,
required TResult orElse(),
}) {
assert(orElse != null);
if (success != null) {
return success();
}
@@ -447,29 +432,24 @@ class _$Success implements Success {
@override
@optionalTypeArgs
TResult map<TResult extends Object>({
@required TResult preparing(Preparing value),
@required TResult inProgress(InProgress value),
@required TResult success(Success value),
@required TResult failed(Failed value),
TResult map<TResult extends Object?>({
required TResult Function(Preparing value) preparing,
required TResult Function(InProgress value) inProgress,
required TResult Function(Success value) success,
required TResult Function(Failed value) failed,
}) {
assert(preparing != null);
assert(inProgress != null);
assert(success != null);
assert(failed != null);
return success(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object>({
TResult preparing(Preparing value),
TResult inProgress(InProgress value),
TResult success(Success value),
TResult failed(Failed value),
@required TResult orElse(),
TResult maybeMap<TResult extends Object?>({
TResult Function(Preparing value)? preparing,
TResult Function(InProgress value)? inProgress,
TResult Function(Success value)? success,
TResult Function(Failed value)? failed,
required TResult orElse(),
}) {
assert(orElse != null);
if (success != null) {
return success(this);
}
@@ -506,10 +486,13 @@ class _$FailedCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
@override
$Res call({
Object error = freezed,
Object? error = freezed,
}) {
return _then(Failed(
error: error == freezed ? _value.error : error as String,
error: error == freezed
? _value.error
: error // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -518,7 +501,7 @@ class _$FailedCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
/// @nodoc
class _$Failed implements Failed {
const _$Failed({@required this.error}) : assert(error != null);
const _$Failed({required this.error});
factory _$Failed.fromJson(Map<String, dynamic> json) =>
_$_$FailedFromJson(json);
@@ -550,29 +533,24 @@ class _$Failed implements Failed {
@override
@optionalTypeArgs
TResult when<TResult extends Object>({
@required TResult preparing(),
@required TResult inProgress(int uploaded, int total),
@required TResult success(),
@required TResult failed(String error),
TResult when<TResult extends Object?>({
required TResult Function() preparing,
required TResult Function(int uploaded, int total) inProgress,
required TResult Function() success,
required TResult Function(String error) failed,
}) {
assert(preparing != null);
assert(inProgress != null);
assert(success != null);
assert(failed != null);
return failed(error);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object>({
TResult preparing(),
TResult inProgress(int uploaded, int total),
TResult success(),
TResult failed(String error),
@required TResult orElse(),
TResult maybeWhen<TResult extends Object?>({
TResult Function()? preparing,
TResult Function(int uploaded, int total)? inProgress,
TResult Function()? success,
TResult Function(String error)? failed,
required TResult orElse(),
}) {
assert(orElse != null);
if (failed != null) {
return failed(error);
}
@@ -581,29 +559,24 @@ class _$Failed implements Failed {
@override
@optionalTypeArgs
TResult map<TResult extends Object>({
@required TResult preparing(Preparing value),
@required TResult inProgress(InProgress value),
@required TResult success(Success value),
@required TResult failed(Failed value),
TResult map<TResult extends Object?>({
required TResult Function(Preparing value) preparing,
required TResult Function(InProgress value) inProgress,
required TResult Function(Success value) success,
required TResult Function(Failed value) failed,
}) {
assert(preparing != null);
assert(inProgress != null);
assert(success != null);
assert(failed != null);
return failed(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object>({
TResult preparing(Preparing value),
TResult inProgress(InProgress value),
TResult success(Success value),
TResult failed(Failed value),
@required TResult orElse(),
TResult maybeMap<TResult extends Object?>({
TResult Function(Preparing value)? preparing,
TResult Function(InProgress value)? inProgress,
TResult Function(Success value)? success,
TResult Function(Failed value)? failed,
required TResult orElse(),
}) {
assert(orElse != null);
if (failed != null) {
return failed(this);
}
@@ -617,11 +590,11 @@ class _$Failed implements Failed {
}
abstract class Failed implements UploadState {
const factory Failed({@required String error}) = _$Failed;
const factory Failed({required String error}) = _$Failed;
factory Failed.fromJson(Map<String, dynamic> json) = _$Failed.fromJson;
String get error;
String get error => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$FailedCopyWith<Failed> get copyWith;
$FailedCopyWith<Failed> get copyWith => throw _privateConstructorUsedError;
}
@@ -8,10 +8,10 @@ part of 'attachment_file.dart';
AttachmentFile _$AttachmentFileFromJson(Map json) {
return AttachmentFile(
path: json['path'] as String,
name: json['name'] as String,
bytes: _fromString(json['bytes'] as String),
size: json['size'] as int,
path: json['path'] as String?,
name: json['name'] as String?,
bytes: _fromString(json['bytes'] as String?),
size: json['size'] as int?,
);
}
@@ -8,39 +8,35 @@ part of 'channel_config.dart';
ChannelConfig _$ChannelConfigFromJson(Map json) {
return ChannelConfig(
automod: json['automod'] as String,
commands: (json['commands'] as List)
?.map((e) => e == null
? null
: Command.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
connectEvents: json['connect_events'] as bool,
automod: json['automod'] as String?,
commands: (json['commands'] as List<dynamic>?)
?.map((e) => Command.fromJson(Map<String, dynamic>.from(e as Map)))
.toList(),
connectEvents: json['connect_events'] as bool?,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
updatedAt: json['updated_at'] == null
? null
: DateTime.parse(json['updated_at'] as String),
maxMessageLength: json['max_message_length'] as int,
messageRetention: json['message_retention'] as String,
mutes: json['mutes'] as bool,
name: json['name'] as String,
reactions: json['reactions'] as bool,
readEvents: json['read_events'] as bool,
replies: json['replies'] as bool,
search: json['search'] as bool,
typingEvents: json['typing_events'] as bool,
uploads: json['uploads'] as bool,
urlEnrichment: json['url_enrichment'] as bool,
maxMessageLength: json['max_message_length'] as int?,
messageRetention: json['message_retention'] as String?,
mutes: json['mutes'] as bool?,
name: json['name'] as String?,
reactions: json['reactions'] as bool?,
readEvents: json['read_events'] as bool?,
replies: json['replies'] as bool?,
search: json['search'] as bool?,
typingEvents: json['typing_events'] as bool?,
uploads: json['uploads'] as bool?,
urlEnrichment: json['url_enrichment'] as bool?,
);
}
Map<String, dynamic> _$ChannelConfigToJson(ChannelConfig instance) =>
<String, dynamic>{
'automod': instance.automod,
'commands': instance.commands?.map((e) => e?.toJson())?.toList(),
'commands': instance.commands?.map((e) => e.toJson()).toList(),
'connect_events': instance.connectEvents,
'created_at': instance.createdAt?.toIso8601String(),
'updated_at': instance.updatedAt?.toIso8601String(),
@@ -8,20 +8,19 @@ part of 'channel_model.dart';
ChannelModel _$ChannelModelFromJson(Map json) {
return ChannelModel(
id: json['id'] as String,
type: json['type'] as String,
cid: json['cid'] as String,
id: json['id'] as String?,
type: json['type'] as String?,
cid: json['cid'] as String?,
config: json['config'] == null
? null
: ChannelConfig.fromJson((json['config'] as Map)?.map(
(k, e) => MapEntry(k as String, e),
)),
: ChannelConfig.fromJson(
Map<String, dynamic>.from(json['config'] as Map)),
createdBy: json['created_by'] == null
? null
: User.fromJson((json['created_by'] as Map)?.map(
: User.fromJson((json['created_by'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
frozen: json['frozen'] as bool,
frozen: json['frozen'] as bool?,
lastMessageAt: json['last_message_at'] == null
? null
: DateTime.parse(json['last_message_at'] as String),
@@ -34,11 +33,11 @@ ChannelModel _$ChannelModelFromJson(Map json) {
deletedAt: json['deleted_at'] == null
? null
: DateTime.parse(json['deleted_at'] as String),
memberCount: json['member_count'] as int,
extraData: (json['extra_data'] as Map)?.map(
memberCount: json['member_count'] as int?,
extraData: (json['extra_data'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
),
team: json['team'] as String,
team: json['team'] as String?,
);
}
@@ -10,56 +10,44 @@ ChannelState _$ChannelStateFromJson(Map json) {
return ChannelState(
channel: json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
messages: (json['messages'] as List)
messages: (json['messages'] as List<dynamic>?)
?.map((e) => Message.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList(),
members: (json['members'] as List<dynamic>?)
?.map((e) => e == null
? null
: Message.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
members: (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
pinnedMessages: (json['pinned_messages'] as List)
?.map((e) => e == null
? null
: Message.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
watcherCount: json['watcher_count'] as int,
watchers: (json['watchers'] as List)
?.map((e) => e == null
? null
: User.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
read: (json['read'] as List)
?.map((e) => e == null
? null
: Read.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
: Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList(),
pinnedMessages: (json['pinned_messages'] as List<dynamic>?)
?.map((e) => Message.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList(),
watcherCount: json['watcher_count'] as int?,
watchers: (json['watchers'] as List<dynamic>?)
?.map((e) => User.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList(),
read: (json['read'] as List<dynamic>?)
?.map((e) => Read.fromJson(Map<String, dynamic>.from(e as Map)))
.toList(),
);
}
Map<String, dynamic> _$ChannelStateToJson(ChannelState instance) =>
<String, dynamic>{
'channel': instance.channel?.toJson(),
'messages': instance.messages?.map((e) => e?.toJson())?.toList(),
'members': instance.members?.map((e) => e?.toJson())?.toList(),
'messages': instance.messages?.map((e) => e.toJson()).toList(),
'members': instance.members?.map((e) => e?.toJson()).toList(),
'pinned_messages':
instance.pinnedMessages?.map((e) => e?.toJson())?.toList(),
instance.pinnedMessages?.map((e) => e.toJson()).toList(),
'watcher_count': instance.watcherCount,
'watchers': instance.watchers?.map((e) => e?.toJson())?.toList(),
'read': instance.read?.map((e) => e?.toJson())?.toList(),
'watchers': instance.watchers?.map((e) => e.toJson()).toList(),
'read': instance.read?.map((e) => e.toJson()).toList(),
};
@@ -8,9 +8,9 @@ part of 'command.dart';
Command _$CommandFromJson(Map json) {
return Command(
name: json['name'] as String,
description: json['description'] as String,
args: json['args'] as String,
name: json['name'] as String?,
description: json['description'] as String?,
args: json['args'] as String?,
);
}
@@ -8,8 +8,8 @@ part of 'device.dart';
Device _$DeviceFromJson(Map json) {
return Device(
id: json['id'] as String,
pushProvider: json['push_provider'] as String,
id: json['id'] as String?,
pushProvider: json['push_provider'] as String?,
);
}
@@ -8,52 +8,50 @@ part of 'event.dart';
Event _$EventFromJson(Map json) {
return Event(
type: json['type'] as String,
cid: json['cid'] as String,
connectionId: json['connection_id'] as String,
type: json['type'] as String?,
cid: json['cid'] as String?,
connectionId: json['connection_id'] as String?,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
me: json['me'] == null
? null
: OwnUser.fromJson((json['me'] as Map)?.map(
: OwnUser.fromJson((json['me'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
user: json['user'] == null
? null
: User.fromJson((json['user'] as Map)?.map(
: User.fromJson((json['user'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
message: json['message'] == null
? null
: Message.fromJson((json['message'] as Map)?.map(
: Message.fromJson((json['message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
totalUnreadCount: json['total_unread_count'] as int,
unreadChannels: json['unread_channels'] as int,
totalUnreadCount: json['total_unread_count'] as int?,
unreadChannels: json['unread_channels'] as int?,
reaction: json['reaction'] == null
? null
: Reaction.fromJson((json['reaction'] as Map)?.map(
: Reaction.fromJson((json['reaction'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
online: json['online'] as bool,
online: json['online'] as bool?,
channel: json['channel'] == null
? null
: EventChannel.fromJson((json['channel'] as Map)?.map(
: EventChannel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
member: json['member'] == null
? null
: Member.fromJson((json['member'] as Map)?.map(
(k, e) => MapEntry(k as String, e),
)),
channelId: json['channel_id'] as String,
channelType: json['channel_type'] as String,
parentId: json['parent_id'] as String,
extraData: (json['extra_data'] as Map)?.map(
: Member.fromJson(Map<String, dynamic>.from(json['member'] as Map)),
channelId: json['channel_id'] as String?,
channelType: json['channel_type'] as String?,
parentId: json['parent_id'] as String?,
extraData: (json['extra_data'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
),
)..isLocal = json['is_local'] as bool;
)..isLocal = json['is_local'] as bool?;
}
Map<String, dynamic> _$EventToJson(Event instance) {
@@ -89,27 +87,22 @@ Map<String, dynamic> _$EventToJson(Event instance) {
EventChannel _$EventChannelFromJson(Map json) {
return EventChannel(
members: (json['members'] as List)
?.map((e) => e == null
? null
: Member.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
id: json['id'] as String,
type: json['type'] as String,
cid: json['cid'] as String,
members: (json['members'] as List<dynamic>?)
?.map((e) => Member.fromJson(Map<String, dynamic>.from(e as Map)))
.toList(),
id: json['id'] as String?,
type: json['type'] as String?,
cid: json['cid'] as String?,
config: json['config'] == null
? null
: ChannelConfig.fromJson((json['config'] as Map)?.map(
(k, e) => MapEntry(k as String, e),
)),
: ChannelConfig.fromJson(
Map<String, dynamic>.from(json['config'] as Map)),
createdBy: json['created_by'] == null
? null
: User.fromJson((json['created_by'] as Map)?.map(
: User.fromJson((json['created_by'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
frozen: json['frozen'] as bool,
frozen: json['frozen'] as bool?,
lastMessageAt: json['last_message_at'] == null
? null
: DateTime.parse(json['last_message_at'] as String),
@@ -122,8 +115,8 @@ EventChannel _$EventChannelFromJson(Map json) {
deletedAt: json['deleted_at'] == null
? null
: DateTime.parse(json['deleted_at'] as String),
memberCount: json['member_count'] as int,
extraData: (json['extra_data'] as Map)?.map(
memberCount: json['member_count'] as int?,
extraData: (json['extra_data'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
),
);
@@ -151,6 +144,6 @@ Map<String, dynamic> _$EventChannelToJson(EventChannel instance) {
writeNotNull('deleted_at', readonly(instance.deletedAt));
writeNotNull('member_count', readonly(instance.memberCount));
writeNotNull('extra_data', instance.extraData);
val['members'] = instance.members?.map((e) => e?.toJson())?.toList();
val['members'] = instance.members?.map((e) => e.toJson()).toList();
return val;
}
@@ -10,7 +10,7 @@ Member _$MemberFromJson(Map json) {
return Member(
user: json['user'] == null
? null
: User.fromJson((json['user'] as Map)?.map(
: User.fromJson((json['user'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
inviteAcceptedAt: json['invite_accepted_at'] == null
@@ -19,18 +19,18 @@ Member _$MemberFromJson(Map json) {
inviteRejectedAt: json['invite_rejected_at'] == null
? null
: DateTime.parse(json['invite_rejected_at'] as String),
invited: json['invited'] as bool,
role: json['role'] as String,
userId: json['user_id'] as String,
isModerator: json['is_moderator'] as bool,
invited: json['invited'] as bool?,
role: json['role'] as String?,
userId: json['user_id'] as String?,
isModerator: json['is_moderator'] as bool?,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
updatedAt: json['updated_at'] == null
? null
: DateTime.parse(json['updated_at'] as String),
banned: json['banned'] as bool,
shadowBanned: json['shadow_banned'] as bool,
banned: json['banned'] as bool?,
shadowBanned: json['shadow_banned'] as bool?,
);
}
@@ -106,11 +106,11 @@ class Message {
/// A map describing the count of number of every reaction
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly)
final Map<String?, int>? reactionCounts;
final Map<String, int>? reactionCounts;
/// A map describing the count of score of every reaction
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly)
final Map<String?, int>? reactionScores;
final Map<String, int>? reactionScores;
/// The latest reactions to the message created by any user.
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly)
@@ -8,62 +8,50 @@ part of 'message.dart';
Message _$MessageFromJson(Map json) {
return Message(
id: json['id'] as String,
text: json['text'] as String,
type: json['type'] as String,
attachments: (json['attachments'] as List)
?.map((e) => e == null
? null
: Attachment.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
mentionedUsers: (json['mentioned_users'] as List)
?.map((e) => e == null
? null
: User.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
silent: json['silent'] as bool,
shadowed: json['shadowed'] as bool,
reactionCounts: (json['reaction_counts'] as Map)?.map(
id: json['id'] as String?,
text: json['text'] as String?,
type: json['type'] as String?,
attachments: (json['attachments'] as List<dynamic>?)
?.map((e) => Attachment.fromJson(Map<String, dynamic>.from(e as Map)))
.toList(),
mentionedUsers: (json['mentioned_users'] as List<dynamic>?)
?.map((e) => User.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList(),
silent: json['silent'] as bool?,
shadowed: json['shadowed'] as bool?,
reactionCounts: (json['reaction_counts'] as Map?)?.map(
(k, e) => MapEntry(k as String, e as int),
),
reactionScores: (json['reaction_scores'] as Map)?.map(
reactionScores: (json['reaction_scores'] as Map?)?.map(
(k, e) => MapEntry(k as String, e as int),
),
latestReactions: (json['latest_reactions'] as List)
?.map((e) => e == null
? null
: Reaction.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
ownReactions: (json['own_reactions'] as List)
?.map((e) => e == null
? null
: Reaction.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
parentId: json['parent_id'] as String,
latestReactions: (json['latest_reactions'] as List<dynamic>?)
?.map((e) => Reaction.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList(),
ownReactions: (json['own_reactions'] as List<dynamic>?)
?.map((e) => Reaction.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList(),
parentId: json['parent_id'] as String?,
quotedMessage: json['quoted_message'] == null
? null
: Message.fromJson((json['quoted_message'] as Map)?.map(
: Message.fromJson((json['quoted_message'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
quotedMessageId: json['quoted_message_id'] as String,
replyCount: json['reply_count'] as int,
threadParticipants: (json['thread_participants'] as List)
?.map((e) => e == null
? null
: User.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
showInChannel: json['show_in_channel'] as bool,
command: json['command'] as String,
quotedMessageId: json['quoted_message_id'] as String?,
replyCount: json['reply_count'] as int?,
threadParticipants: (json['thread_participants'] as List<dynamic>?)
?.map((e) => User.fromJson((e as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)))
.toList(),
showInChannel: json['show_in_channel'] as bool?,
command: json['command'] as String?,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
@@ -72,10 +60,10 @@ Message _$MessageFromJson(Map json) {
: DateTime.parse(json['updated_at'] as String),
user: json['user'] == null
? null
: User.fromJson((json['user'] as Map)?.map(
: User.fromJson((json['user'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
pinned: json['pinned'] as bool,
pinned: json['pinned'] as bool?,
pinnedAt: json['pinned_at'] == null
? null
: DateTime.parse(json['pinned_at'] as String),
@@ -84,16 +72,16 @@ Message _$MessageFromJson(Map json) {
: DateTime.parse(json['pin_expires'] as String),
pinnedBy: json['pinned_by'] == null
? null
: User.fromJson((json['pinned_by'] as Map)?.map(
: User.fromJson((json['pinned_by'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
extraData: (json['extra_data'] as Map)?.map(
extraData: (json['extra_data'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
),
deletedAt: json['deleted_at'] == null
? null
: DateTime.parse(json['deleted_at'] as String),
skipPush: json['skip_push'] as bool,
skipPush: json['skip_push'] as bool?,
);
}
@@ -111,7 +99,7 @@ Map<String, dynamic> _$MessageToJson(Message instance) {
writeNotNull('type', readonly(instance.type));
writeNotNull(
'attachments', instance.attachments?.map((e) => e?.toJson())?.toList());
'attachments', instance.attachments?.map((e) => e.toJson()).toList());
val['mentioned_users'] = Serialization.userIds(instance.mentionedUsers);
writeNotNull('reaction_counts', readonly(instance.reactionCounts));
writeNotNull('reaction_scores', readonly(instance.reactionScores));
@@ -141,7 +129,7 @@ Map<String, dynamic> _$MessageToJson(Message instance) {
TranslatedMessage _$TranslatedMessageFromJson(Map json) {
return TranslatedMessage(
(json['i18n'] as Map)?.map(
(json['i18n'] as Map?)?.map(
(k, e) => MapEntry(k as String, e as String),
),
);
@@ -10,12 +10,12 @@ Mute _$MuteFromJson(Map json) {
return Mute(
user: json['user'] == null
? null
: User.fromJson((json['user'] as Map)?.map(
: User.fromJson((json['user'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
channel: json['channel'] == null
? null
: ChannelModel.fromJson((json['channel'] as Map)?.map(
: ChannelModel.fromJson((json['channel'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
createdAt: json['created_at'] == null
@@ -8,31 +8,19 @@ part of 'own_user.dart';
OwnUser _$OwnUserFromJson(Map json) {
return OwnUser(
devices: (json['devices'] as List)
?.map((e) => e == null
? null
: Device.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
mutes: (json['mutes'] as List)
?.map((e) => e == null
? null
: Mute.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
totalUnreadCount: json['total_unread_count'] as int,
unreadChannels: json['unread_channels'] as int,
channelMutes: (json['channel_mutes'] as List)
?.map((e) => e == null
? null
: Mute.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
id: json['id'] as String,
role: json['role'] as String,
devices: (json['devices'] as List<dynamic>?)
?.map((e) => Device.fromJson(Map<String, dynamic>.from(e as Map)))
.toList(),
mutes: (json['mutes'] as List<dynamic>?)
?.map((e) => Mute.fromJson(Map<String, dynamic>.from(e as Map)))
.toList(),
totalUnreadCount: json['total_unread_count'] as int?,
unreadChannels: json['unread_channels'] as int?,
channelMutes: (json['channel_mutes'] as List<dynamic>?)
?.map((e) => Mute.fromJson(Map<String, dynamic>.from(e as Map)))
.toList(),
id: json['id'] as String?,
role: json['role'] as String?,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
@@ -42,11 +30,11 @@ OwnUser _$OwnUserFromJson(Map json) {
lastActive: json['last_active'] == null
? null
: DateTime.parse(json['last_active'] as String),
online: json['online'] as bool,
extraData: (json['extra_data'] as Map)?.map(
online: json['online'] as bool?,
extraData: (json['extra_data'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
),
banned: json['banned'] as bool,
banned: json['banned'] as bool?,
);
}
@@ -8,19 +8,19 @@ part of 'reaction.dart';
Reaction _$ReactionFromJson(Map json) {
return Reaction(
messageId: json['message_id'] as String,
messageId: json['message_id'] as String?,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
type: json['type'] as String,
type: json['type'] as String?,
user: json['user'] == null
? null
: User.fromJson((json['user'] as Map)?.map(
: User.fromJson((json['user'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
userId: json['user_id'] as String,
score: json['score'] as int,
extraData: (json['extra_data'] as Map)?.map(
userId: json['user_id'] as String?,
score: json['score'] as int?,
extraData: (json['extra_data'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
),
);
@@ -13,10 +13,10 @@ Read _$ReadFromJson(Map json) {
: DateTime.parse(json['last_read'] as String),
user: json['user'] == null
? null
: User.fromJson((json['user'] as Map)?.map(
: User.fromJson((json['user'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
)),
unreadMessages: json['unread_messages'] as int,
unreadMessages: json['unread_messages'] as int?,
);
}
@@ -8,8 +8,8 @@ part of 'user.dart';
User _$UserFromJson(Map json) {
return User(
id: json['id'] as String,
role: json['role'] as String,
id: json['id'] as String?,
role: json['role'] as String?,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
@@ -19,12 +19,12 @@ User _$UserFromJson(Map json) {
lastActive: json['last_active'] == null
? null
: DateTime.parse(json['last_active'] as String),
online: json['online'] as bool,
extraData: (json['extra_data'] as Map)?.map(
online: json['online'] as bool?,
extraData: (json['extra_data'] as Map?)?.map(
(k, e) => MapEntry(k as String, e),
),
banned: json['banned'] as bool,
teams: (json['teams'] as List)?.map((e) => e as String)?.toList(),
banned: json['banned'] as bool?,
teams: (json['teams'] as List<dynamic>?)?.map((e) => e as String).toList(),
);
}