360 lines
11 KiB
Dart
360 lines
11 KiB
Dart
// coverage:ignore-file
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// 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 'chat.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
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 information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
|
|
/// @nodoc
|
|
mixin _$Chat {
|
|
String get id => throw _privateConstructorUsedError;
|
|
String get type => throw _privateConstructorUsedError;
|
|
String get title => throw _privateConstructorUsedError;
|
|
String? get avatarUrl => throw _privateConstructorUsedError;
|
|
List<User>? get participants => throw _privateConstructorUsedError;
|
|
Message? get lastMessage => throw _privateConstructorUsedError;
|
|
DateTime? get lastMessageTime => throw _privateConstructorUsedError;
|
|
int get unreadCount => throw _privateConstructorUsedError;
|
|
bool get isMuted => throw _privateConstructorUsedError;
|
|
bool get isPinned => throw _privateConstructorUsedError;
|
|
|
|
@JsonKey(ignore: true)
|
|
$ChatCopyWith<Chat> get copyWith => throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $ChatCopyWith<$Res> {
|
|
factory $ChatCopyWith(Chat value, $Res Function(Chat) then) =
|
|
_$ChatCopyWithImpl<$Res, Chat>;
|
|
@useResult
|
|
$Res call(
|
|
{String id,
|
|
String type,
|
|
String title,
|
|
String? avatarUrl,
|
|
List<User>? participants,
|
|
Message? lastMessage,
|
|
DateTime? lastMessageTime,
|
|
int unreadCount,
|
|
bool isMuted,
|
|
bool isPinned});
|
|
|
|
$MessageCopyWith<$Res>? get lastMessage;
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$ChatCopyWithImpl<$Res, $Val extends Chat>
|
|
implements $ChatCopyWith<$Res> {
|
|
_$ChatCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? type = null,
|
|
Object? title = null,
|
|
Object? avatarUrl = freezed,
|
|
Object? participants = freezed,
|
|
Object? lastMessage = freezed,
|
|
Object? lastMessageTime = freezed,
|
|
Object? unreadCount = null,
|
|
Object? isMuted = null,
|
|
Object? isPinned = null,
|
|
}) {
|
|
return _then(_value.copyWith(
|
|
id: null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
type: null == type
|
|
? _value.type
|
|
: type // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
title: null == title
|
|
? _value.title
|
|
: title // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
avatarUrl: freezed == avatarUrl
|
|
? _value.avatarUrl
|
|
: avatarUrl // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
participants: freezed == participants
|
|
? _value.participants
|
|
: participants // ignore: cast_nullable_to_non_nullable
|
|
as List<User>?,
|
|
lastMessage: freezed == lastMessage
|
|
? _value.lastMessage
|
|
: lastMessage // ignore: cast_nullable_to_non_nullable
|
|
as Message?,
|
|
lastMessageTime: freezed == lastMessageTime
|
|
? _value.lastMessageTime
|
|
: lastMessageTime // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
unreadCount: null == unreadCount
|
|
? _value.unreadCount
|
|
: unreadCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
isMuted: null == isMuted
|
|
? _value.isMuted
|
|
: isMuted // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
isPinned: null == isPinned
|
|
? _value.isPinned
|
|
: isPinned // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
) as $Val);
|
|
}
|
|
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$MessageCopyWith<$Res>? get lastMessage {
|
|
if (_value.lastMessage == null) {
|
|
return null;
|
|
}
|
|
|
|
return $MessageCopyWith<$Res>(_value.lastMessage!, (value) {
|
|
return _then(_value.copyWith(lastMessage: value) as $Val);
|
|
});
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$ChatImplCopyWith<$Res> implements $ChatCopyWith<$Res> {
|
|
factory _$$ChatImplCopyWith(
|
|
_$ChatImpl value, $Res Function(_$ChatImpl) then) =
|
|
__$$ChatImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call(
|
|
{String id,
|
|
String type,
|
|
String title,
|
|
String? avatarUrl,
|
|
List<User>? participants,
|
|
Message? lastMessage,
|
|
DateTime? lastMessageTime,
|
|
int unreadCount,
|
|
bool isMuted,
|
|
bool isPinned});
|
|
|
|
@override
|
|
$MessageCopyWith<$Res>? get lastMessage;
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$ChatImplCopyWithImpl<$Res>
|
|
extends _$ChatCopyWithImpl<$Res, _$ChatImpl>
|
|
implements _$$ChatImplCopyWith<$Res> {
|
|
__$$ChatImplCopyWithImpl(_$ChatImpl _value, $Res Function(_$ChatImpl) _then)
|
|
: super(_value, _then);
|
|
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? type = null,
|
|
Object? title = null,
|
|
Object? avatarUrl = freezed,
|
|
Object? participants = freezed,
|
|
Object? lastMessage = freezed,
|
|
Object? lastMessageTime = freezed,
|
|
Object? unreadCount = null,
|
|
Object? isMuted = null,
|
|
Object? isPinned = null,
|
|
}) {
|
|
return _then(_$ChatImpl(
|
|
id: null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
type: null == type
|
|
? _value.type
|
|
: type // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
title: null == title
|
|
? _value.title
|
|
: title // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
avatarUrl: freezed == avatarUrl
|
|
? _value.avatarUrl
|
|
: avatarUrl // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
participants: freezed == participants
|
|
? _value._participants
|
|
: participants // ignore: cast_nullable_to_non_nullable
|
|
as List<User>?,
|
|
lastMessage: freezed == lastMessage
|
|
? _value.lastMessage
|
|
: lastMessage // ignore: cast_nullable_to_non_nullable
|
|
as Message?,
|
|
lastMessageTime: freezed == lastMessageTime
|
|
? _value.lastMessageTime
|
|
: lastMessageTime // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
unreadCount: null == unreadCount
|
|
? _value.unreadCount
|
|
: unreadCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
isMuted: null == isMuted
|
|
? _value.isMuted
|
|
: isMuted // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
isPinned: null == isPinned
|
|
? _value.isPinned
|
|
: isPinned // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
));
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _$ChatImpl implements _Chat {
|
|
const _$ChatImpl(
|
|
{required this.id,
|
|
required this.type,
|
|
required this.title,
|
|
this.avatarUrl,
|
|
final List<User>? participants,
|
|
this.lastMessage = null,
|
|
this.lastMessageTime,
|
|
this.unreadCount = 0,
|
|
this.isMuted = false,
|
|
this.isPinned = false})
|
|
: _participants = participants;
|
|
|
|
@override
|
|
final String id;
|
|
@override
|
|
final String type;
|
|
@override
|
|
final String title;
|
|
@override
|
|
final String? avatarUrl;
|
|
final List<User>? _participants;
|
|
@override
|
|
List<User>? get participants {
|
|
final value = _participants;
|
|
if (value == null) return null;
|
|
if (_participants is EqualUnmodifiableListView) return _participants;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableListView(value);
|
|
}
|
|
|
|
@override
|
|
@JsonKey()
|
|
final Message? lastMessage;
|
|
@override
|
|
final DateTime? lastMessageTime;
|
|
@override
|
|
@JsonKey()
|
|
final int unreadCount;
|
|
@override
|
|
@JsonKey()
|
|
final bool isMuted;
|
|
@override
|
|
@JsonKey()
|
|
final bool isPinned;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'Chat(id: $id, type: $type, title: $title, avatarUrl: $avatarUrl, participants: $participants, lastMessage: $lastMessage, lastMessageTime: $lastMessageTime, unreadCount: $unreadCount, isMuted: $isMuted, isPinned: $isPinned)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$ChatImpl &&
|
|
(identical(other.id, id) || other.id == id) &&
|
|
(identical(other.type, type) || other.type == type) &&
|
|
(identical(other.title, title) || other.title == title) &&
|
|
(identical(other.avatarUrl, avatarUrl) ||
|
|
other.avatarUrl == avatarUrl) &&
|
|
const DeepCollectionEquality()
|
|
.equals(other._participants, _participants) &&
|
|
(identical(other.lastMessage, lastMessage) ||
|
|
other.lastMessage == lastMessage) &&
|
|
(identical(other.lastMessageTime, lastMessageTime) ||
|
|
other.lastMessageTime == lastMessageTime) &&
|
|
(identical(other.unreadCount, unreadCount) ||
|
|
other.unreadCount == unreadCount) &&
|
|
(identical(other.isMuted, isMuted) || other.isMuted == isMuted) &&
|
|
(identical(other.isPinned, isPinned) ||
|
|
other.isPinned == isPinned));
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
runtimeType,
|
|
id,
|
|
type,
|
|
title,
|
|
avatarUrl,
|
|
const DeepCollectionEquality().hash(_participants),
|
|
lastMessage,
|
|
lastMessageTime,
|
|
unreadCount,
|
|
isMuted,
|
|
isPinned);
|
|
|
|
@JsonKey(ignore: true)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$ChatImplCopyWith<_$ChatImpl> get copyWith =>
|
|
__$$ChatImplCopyWithImpl<_$ChatImpl>(this, _$identity);
|
|
}
|
|
|
|
abstract class _Chat implements Chat {
|
|
const factory _Chat(
|
|
{required final String id,
|
|
required final String type,
|
|
required final String title,
|
|
final String? avatarUrl,
|
|
final List<User>? participants,
|
|
final Message? lastMessage,
|
|
final DateTime? lastMessageTime,
|
|
final int unreadCount,
|
|
final bool isMuted,
|
|
final bool isPinned}) = _$ChatImpl;
|
|
|
|
@override
|
|
String get id;
|
|
@override
|
|
String get type;
|
|
@override
|
|
String get title;
|
|
@override
|
|
String? get avatarUrl;
|
|
@override
|
|
List<User>? get participants;
|
|
@override
|
|
Message? get lastMessage;
|
|
@override
|
|
DateTime? get lastMessageTime;
|
|
@override
|
|
int get unreadCount;
|
|
@override
|
|
bool get isMuted;
|
|
@override
|
|
bool get isPinned;
|
|
@override
|
|
@JsonKey(ignore: true)
|
|
_$$ChatImplCopyWith<_$ChatImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|