forked from eatvio/eatvio_app
1280 lines
40 KiB
Dart
1280 lines
40 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_room_pagination_model.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',
|
|
);
|
|
|
|
ChatRoomPaginationModel _$ChatRoomPaginationModelFromJson(
|
|
Map<String, dynamic> json,
|
|
) {
|
|
return _ChatRoomPreviewModel.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$ChatRoomPaginationModel {
|
|
@JsonKey(name: "chatRooms")
|
|
ChatRooms get chatRooms => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "number_of_unread_chat_rooms")
|
|
int get unreadChatsCount => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this ChatRoomPaginationModel to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of ChatRoomPaginationModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$ChatRoomPaginationModelCopyWith<ChatRoomPaginationModel> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $ChatRoomPaginationModelCopyWith<$Res> {
|
|
factory $ChatRoomPaginationModelCopyWith(
|
|
ChatRoomPaginationModel value,
|
|
$Res Function(ChatRoomPaginationModel) then,
|
|
) = _$ChatRoomPaginationModelCopyWithImpl<$Res, ChatRoomPaginationModel>;
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "chatRooms") ChatRooms chatRooms,
|
|
@JsonKey(name: "number_of_unread_chat_rooms") int unreadChatsCount,
|
|
});
|
|
|
|
$ChatRoomsCopyWith<$Res> get chatRooms;
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$ChatRoomPaginationModelCopyWithImpl<
|
|
$Res,
|
|
$Val extends ChatRoomPaginationModel
|
|
>
|
|
implements $ChatRoomPaginationModelCopyWith<$Res> {
|
|
_$ChatRoomPaginationModelCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of ChatRoomPaginationModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({Object? chatRooms = null, Object? unreadChatsCount = null}) {
|
|
return _then(
|
|
_value.copyWith(
|
|
chatRooms:
|
|
null == chatRooms
|
|
? _value.chatRooms
|
|
: chatRooms // ignore: cast_nullable_to_non_nullable
|
|
as ChatRooms,
|
|
unreadChatsCount:
|
|
null == unreadChatsCount
|
|
? _value.unreadChatsCount
|
|
: unreadChatsCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
)
|
|
as $Val,
|
|
);
|
|
}
|
|
|
|
/// Create a copy of ChatRoomPaginationModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$ChatRoomsCopyWith<$Res> get chatRooms {
|
|
return $ChatRoomsCopyWith<$Res>(_value.chatRooms, (value) {
|
|
return _then(_value.copyWith(chatRooms: value) as $Val);
|
|
});
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$ChatRoomPreviewModelImplCopyWith<$Res>
|
|
implements $ChatRoomPaginationModelCopyWith<$Res> {
|
|
factory _$$ChatRoomPreviewModelImplCopyWith(
|
|
_$ChatRoomPreviewModelImpl value,
|
|
$Res Function(_$ChatRoomPreviewModelImpl) then,
|
|
) = __$$ChatRoomPreviewModelImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "chatRooms") ChatRooms chatRooms,
|
|
@JsonKey(name: "number_of_unread_chat_rooms") int unreadChatsCount,
|
|
});
|
|
|
|
@override
|
|
$ChatRoomsCopyWith<$Res> get chatRooms;
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res>
|
|
extends
|
|
_$ChatRoomPaginationModelCopyWithImpl<$Res, _$ChatRoomPreviewModelImpl>
|
|
implements _$$ChatRoomPreviewModelImplCopyWith<$Res> {
|
|
__$$ChatRoomPreviewModelImplCopyWithImpl(
|
|
_$ChatRoomPreviewModelImpl _value,
|
|
$Res Function(_$ChatRoomPreviewModelImpl) _then,
|
|
) : super(_value, _then);
|
|
|
|
/// Create a copy of ChatRoomPaginationModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({Object? chatRooms = null, Object? unreadChatsCount = null}) {
|
|
return _then(
|
|
_$ChatRoomPreviewModelImpl(
|
|
chatRooms:
|
|
null == chatRooms
|
|
? _value.chatRooms
|
|
: chatRooms // ignore: cast_nullable_to_non_nullable
|
|
as ChatRooms,
|
|
unreadChatsCount:
|
|
null == unreadChatsCount
|
|
? _value.unreadChatsCount
|
|
: unreadChatsCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel {
|
|
const _$ChatRoomPreviewModelImpl({
|
|
@JsonKey(name: "chatRooms") required this.chatRooms,
|
|
@JsonKey(name: "number_of_unread_chat_rooms")
|
|
required this.unreadChatsCount,
|
|
});
|
|
|
|
factory _$ChatRoomPreviewModelImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$ChatRoomPreviewModelImplFromJson(json);
|
|
|
|
@override
|
|
@JsonKey(name: "chatRooms")
|
|
final ChatRooms chatRooms;
|
|
@override
|
|
@JsonKey(name: "number_of_unread_chat_rooms")
|
|
final int unreadChatsCount;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ChatRoomPaginationModel(chatRooms: $chatRooms, unreadChatsCount: $unreadChatsCount)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$ChatRoomPreviewModelImpl &&
|
|
(identical(other.chatRooms, chatRooms) ||
|
|
other.chatRooms == chatRooms) &&
|
|
(identical(other.unreadChatsCount, unreadChatsCount) ||
|
|
other.unreadChatsCount == unreadChatsCount));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType, chatRooms, unreadChatsCount);
|
|
|
|
/// Create a copy of ChatRoomPaginationModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl>
|
|
get copyWith =>
|
|
__$$ChatRoomPreviewModelImplCopyWithImpl<_$ChatRoomPreviewModelImpl>(
|
|
this,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$ChatRoomPreviewModelImplToJson(this);
|
|
}
|
|
}
|
|
|
|
abstract class _ChatRoomPreviewModel implements ChatRoomPaginationModel {
|
|
const factory _ChatRoomPreviewModel({
|
|
@JsonKey(name: "chatRooms") required final ChatRooms chatRooms,
|
|
@JsonKey(name: "number_of_unread_chat_rooms")
|
|
required final int unreadChatsCount,
|
|
}) = _$ChatRoomPreviewModelImpl;
|
|
|
|
factory _ChatRoomPreviewModel.fromJson(Map<String, dynamic> json) =
|
|
_$ChatRoomPreviewModelImpl.fromJson;
|
|
|
|
@override
|
|
@JsonKey(name: "chatRooms")
|
|
ChatRooms get chatRooms;
|
|
@override
|
|
@JsonKey(name: "number_of_unread_chat_rooms")
|
|
int get unreadChatsCount;
|
|
|
|
/// Create a copy of ChatRoomPaginationModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl>
|
|
get copyWith => throw _privateConstructorUsedError;
|
|
}
|
|
|
|
ChatRooms _$ChatRoomsFromJson(Map<String, dynamic> json) {
|
|
return _ChatRooms.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$ChatRooms {
|
|
@JsonKey(name: "data")
|
|
List<ChatRoom> get data => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "last_page")
|
|
int get lastPage => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "current_page")
|
|
int get currentPage => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this ChatRooms to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of ChatRooms
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$ChatRoomsCopyWith<ChatRooms> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $ChatRoomsCopyWith<$Res> {
|
|
factory $ChatRoomsCopyWith(ChatRooms value, $Res Function(ChatRooms) then) =
|
|
_$ChatRoomsCopyWithImpl<$Res, ChatRooms>;
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "data") List<ChatRoom> data,
|
|
@JsonKey(name: "last_page") int lastPage,
|
|
@JsonKey(name: "current_page") int currentPage,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$ChatRoomsCopyWithImpl<$Res, $Val extends ChatRooms>
|
|
implements $ChatRoomsCopyWith<$Res> {
|
|
_$ChatRoomsCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of ChatRooms
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? data = null,
|
|
Object? lastPage = null,
|
|
Object? currentPage = null,
|
|
}) {
|
|
return _then(
|
|
_value.copyWith(
|
|
data:
|
|
null == data
|
|
? _value.data
|
|
: data // ignore: cast_nullable_to_non_nullable
|
|
as List<ChatRoom>,
|
|
lastPage:
|
|
null == lastPage
|
|
? _value.lastPage
|
|
: lastPage // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
currentPage:
|
|
null == currentPage
|
|
? _value.currentPage
|
|
: currentPage // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
)
|
|
as $Val,
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$ChatRoomsImplCopyWith<$Res>
|
|
implements $ChatRoomsCopyWith<$Res> {
|
|
factory _$$ChatRoomsImplCopyWith(
|
|
_$ChatRoomsImpl value,
|
|
$Res Function(_$ChatRoomsImpl) then,
|
|
) = __$$ChatRoomsImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "data") List<ChatRoom> data,
|
|
@JsonKey(name: "last_page") int lastPage,
|
|
@JsonKey(name: "current_page") int currentPage,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$ChatRoomsImplCopyWithImpl<$Res>
|
|
extends _$ChatRoomsCopyWithImpl<$Res, _$ChatRoomsImpl>
|
|
implements _$$ChatRoomsImplCopyWith<$Res> {
|
|
__$$ChatRoomsImplCopyWithImpl(
|
|
_$ChatRoomsImpl _value,
|
|
$Res Function(_$ChatRoomsImpl) _then,
|
|
) : super(_value, _then);
|
|
|
|
/// Create a copy of ChatRooms
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? data = null,
|
|
Object? lastPage = null,
|
|
Object? currentPage = null,
|
|
}) {
|
|
return _then(
|
|
_$ChatRoomsImpl(
|
|
data:
|
|
null == data
|
|
? _value._data
|
|
: data // ignore: cast_nullable_to_non_nullable
|
|
as List<ChatRoom>,
|
|
lastPage:
|
|
null == lastPage
|
|
? _value.lastPage
|
|
: lastPage // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
currentPage:
|
|
null == currentPage
|
|
? _value.currentPage
|
|
: currentPage // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$ChatRoomsImpl implements _ChatRooms {
|
|
const _$ChatRoomsImpl({
|
|
@JsonKey(name: "data") required final List<ChatRoom> data,
|
|
@JsonKey(name: "last_page") required this.lastPage,
|
|
@JsonKey(name: "current_page") required this.currentPage,
|
|
}) : _data = data;
|
|
|
|
factory _$ChatRoomsImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$ChatRoomsImplFromJson(json);
|
|
|
|
final List<ChatRoom> _data;
|
|
@override
|
|
@JsonKey(name: "data")
|
|
List<ChatRoom> get data {
|
|
if (_data is EqualUnmodifiableListView) return _data;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableListView(_data);
|
|
}
|
|
|
|
@override
|
|
@JsonKey(name: "last_page")
|
|
final int lastPage;
|
|
@override
|
|
@JsonKey(name: "current_page")
|
|
final int currentPage;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ChatRooms(data: $data, lastPage: $lastPage, currentPage: $currentPage)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$ChatRoomsImpl &&
|
|
const DeepCollectionEquality().equals(other._data, _data) &&
|
|
(identical(other.lastPage, lastPage) ||
|
|
other.lastPage == lastPage) &&
|
|
(identical(other.currentPage, currentPage) ||
|
|
other.currentPage == currentPage));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
runtimeType,
|
|
const DeepCollectionEquality().hash(_data),
|
|
lastPage,
|
|
currentPage,
|
|
);
|
|
|
|
/// Create a copy of ChatRooms
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$ChatRoomsImplCopyWith<_$ChatRoomsImpl> get copyWith =>
|
|
__$$ChatRoomsImplCopyWithImpl<_$ChatRoomsImpl>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$ChatRoomsImplToJson(this);
|
|
}
|
|
}
|
|
|
|
abstract class _ChatRooms implements ChatRooms {
|
|
const factory _ChatRooms({
|
|
@JsonKey(name: "data") required final List<ChatRoom> data,
|
|
@JsonKey(name: "last_page") required final int lastPage,
|
|
@JsonKey(name: "current_page") required final int currentPage,
|
|
}) = _$ChatRoomsImpl;
|
|
|
|
factory _ChatRooms.fromJson(Map<String, dynamic> json) =
|
|
_$ChatRoomsImpl.fromJson;
|
|
|
|
@override
|
|
@JsonKey(name: "data")
|
|
List<ChatRoom> get data;
|
|
@override
|
|
@JsonKey(name: "last_page")
|
|
int get lastPage;
|
|
@override
|
|
@JsonKey(name: "current_page")
|
|
int get currentPage;
|
|
|
|
/// Create a copy of ChatRooms
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$ChatRoomsImplCopyWith<_$ChatRoomsImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
ChatRoom _$ChatRoomFromJson(Map<String, dynamic> json) {
|
|
return _ChatRoom.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$ChatRoom {
|
|
@JsonKey(name: "id")
|
|
String get id => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "room_name")
|
|
String get roomName => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "last_message", fromJson: parseLastMessage)
|
|
ChatMessageModel? get lastMessage => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "users")
|
|
Users get users => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "unread_messages_count")
|
|
int get unreadMessagesCount => throw _privateConstructorUsedError;
|
|
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
|
ChosenPlanModel? get chosenPlan => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this ChatRoom to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of ChatRoom
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$ChatRoomCopyWith<ChatRoom> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $ChatRoomCopyWith<$Res> {
|
|
factory $ChatRoomCopyWith(ChatRoom value, $Res Function(ChatRoom) then) =
|
|
_$ChatRoomCopyWithImpl<$Res, ChatRoom>;
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "id") String id,
|
|
@JsonKey(name: "room_name") String roomName,
|
|
@JsonKey(name: "last_message", fromJson: parseLastMessage)
|
|
ChatMessageModel? lastMessage,
|
|
@JsonKey(name: "users") Users users,
|
|
@JsonKey(name: "unread_messages_count") int unreadMessagesCount,
|
|
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
|
ChosenPlanModel? chosenPlan,
|
|
});
|
|
|
|
$ChatMessageModelCopyWith<$Res>? get lastMessage;
|
|
$UsersCopyWith<$Res> get users;
|
|
$ChosenPlanModelCopyWith<$Res>? get chosenPlan;
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom>
|
|
implements $ChatRoomCopyWith<$Res> {
|
|
_$ChatRoomCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of ChatRoom
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? roomName = null,
|
|
Object? lastMessage = freezed,
|
|
Object? users = null,
|
|
Object? unreadMessagesCount = null,
|
|
Object? chosenPlan = freezed,
|
|
}) {
|
|
return _then(
|
|
_value.copyWith(
|
|
id:
|
|
null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
roomName:
|
|
null == roomName
|
|
? _value.roomName
|
|
: roomName // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
lastMessage:
|
|
freezed == lastMessage
|
|
? _value.lastMessage
|
|
: lastMessage // ignore: cast_nullable_to_non_nullable
|
|
as ChatMessageModel?,
|
|
users:
|
|
null == users
|
|
? _value.users
|
|
: users // ignore: cast_nullable_to_non_nullable
|
|
as Users,
|
|
unreadMessagesCount:
|
|
null == unreadMessagesCount
|
|
? _value.unreadMessagesCount
|
|
: unreadMessagesCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
chosenPlan:
|
|
freezed == chosenPlan
|
|
? _value.chosenPlan
|
|
: chosenPlan // ignore: cast_nullable_to_non_nullable
|
|
as ChosenPlanModel?,
|
|
)
|
|
as $Val,
|
|
);
|
|
}
|
|
|
|
/// Create a copy of ChatRoom
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$ChatMessageModelCopyWith<$Res>? get lastMessage {
|
|
if (_value.lastMessage == null) {
|
|
return null;
|
|
}
|
|
|
|
return $ChatMessageModelCopyWith<$Res>(_value.lastMessage!, (value) {
|
|
return _then(_value.copyWith(lastMessage: value) as $Val);
|
|
});
|
|
}
|
|
|
|
/// Create a copy of ChatRoom
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$UsersCopyWith<$Res> get users {
|
|
return $UsersCopyWith<$Res>(_value.users, (value) {
|
|
return _then(_value.copyWith(users: value) as $Val);
|
|
});
|
|
}
|
|
|
|
/// Create a copy of ChatRoom
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$ChosenPlanModelCopyWith<$Res>? get chosenPlan {
|
|
if (_value.chosenPlan == null) {
|
|
return null;
|
|
}
|
|
|
|
return $ChosenPlanModelCopyWith<$Res>(_value.chosenPlan!, (value) {
|
|
return _then(_value.copyWith(chosenPlan: value) as $Val);
|
|
});
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$ChatRoomImplCopyWith<$Res>
|
|
implements $ChatRoomCopyWith<$Res> {
|
|
factory _$$ChatRoomImplCopyWith(
|
|
_$ChatRoomImpl value,
|
|
$Res Function(_$ChatRoomImpl) then,
|
|
) = __$$ChatRoomImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "id") String id,
|
|
@JsonKey(name: "room_name") String roomName,
|
|
@JsonKey(name: "last_message", fromJson: parseLastMessage)
|
|
ChatMessageModel? lastMessage,
|
|
@JsonKey(name: "users") Users users,
|
|
@JsonKey(name: "unread_messages_count") int unreadMessagesCount,
|
|
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
|
ChosenPlanModel? chosenPlan,
|
|
});
|
|
|
|
@override
|
|
$ChatMessageModelCopyWith<$Res>? get lastMessage;
|
|
@override
|
|
$UsersCopyWith<$Res> get users;
|
|
@override
|
|
$ChosenPlanModelCopyWith<$Res>? get chosenPlan;
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$ChatRoomImplCopyWithImpl<$Res>
|
|
extends _$ChatRoomCopyWithImpl<$Res, _$ChatRoomImpl>
|
|
implements _$$ChatRoomImplCopyWith<$Res> {
|
|
__$$ChatRoomImplCopyWithImpl(
|
|
_$ChatRoomImpl _value,
|
|
$Res Function(_$ChatRoomImpl) _then,
|
|
) : super(_value, _then);
|
|
|
|
/// Create a copy of ChatRoom
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? roomName = null,
|
|
Object? lastMessage = freezed,
|
|
Object? users = null,
|
|
Object? unreadMessagesCount = null,
|
|
Object? chosenPlan = freezed,
|
|
}) {
|
|
return _then(
|
|
_$ChatRoomImpl(
|
|
id:
|
|
null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
roomName:
|
|
null == roomName
|
|
? _value.roomName
|
|
: roomName // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
lastMessage:
|
|
freezed == lastMessage
|
|
? _value.lastMessage
|
|
: lastMessage // ignore: cast_nullable_to_non_nullable
|
|
as ChatMessageModel?,
|
|
users:
|
|
null == users
|
|
? _value.users
|
|
: users // ignore: cast_nullable_to_non_nullable
|
|
as Users,
|
|
unreadMessagesCount:
|
|
null == unreadMessagesCount
|
|
? _value.unreadMessagesCount
|
|
: unreadMessagesCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
chosenPlan:
|
|
freezed == chosenPlan
|
|
? _value.chosenPlan
|
|
: chosenPlan // ignore: cast_nullable_to_non_nullable
|
|
as ChosenPlanModel?,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$ChatRoomImpl implements _ChatRoom {
|
|
const _$ChatRoomImpl({
|
|
@JsonKey(name: "id") required this.id,
|
|
@JsonKey(name: "room_name") required this.roomName,
|
|
@JsonKey(name: "last_message", fromJson: parseLastMessage)
|
|
required this.lastMessage,
|
|
@JsonKey(name: "users") required this.users,
|
|
@JsonKey(name: "unread_messages_count") required this.unreadMessagesCount,
|
|
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
|
required this.chosenPlan,
|
|
});
|
|
|
|
factory _$ChatRoomImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$ChatRoomImplFromJson(json);
|
|
|
|
@override
|
|
@JsonKey(name: "id")
|
|
final String id;
|
|
@override
|
|
@JsonKey(name: "room_name")
|
|
final String roomName;
|
|
@override
|
|
@JsonKey(name: "last_message", fromJson: parseLastMessage)
|
|
final ChatMessageModel? lastMessage;
|
|
@override
|
|
@JsonKey(name: "users")
|
|
final Users users;
|
|
@override
|
|
@JsonKey(name: "unread_messages_count")
|
|
final int unreadMessagesCount;
|
|
@override
|
|
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
|
final ChosenPlanModel? chosenPlan;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ChatRoom(id: $id, roomName: $roomName, lastMessage: $lastMessage, users: $users, unreadMessagesCount: $unreadMessagesCount, chosenPlan: $chosenPlan)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$ChatRoomImpl &&
|
|
(identical(other.id, id) || other.id == id) &&
|
|
(identical(other.roomName, roomName) ||
|
|
other.roomName == roomName) &&
|
|
(identical(other.lastMessage, lastMessage) ||
|
|
other.lastMessage == lastMessage) &&
|
|
(identical(other.users, users) || other.users == users) &&
|
|
(identical(other.unreadMessagesCount, unreadMessagesCount) ||
|
|
other.unreadMessagesCount == unreadMessagesCount) &&
|
|
(identical(other.chosenPlan, chosenPlan) ||
|
|
other.chosenPlan == chosenPlan));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
runtimeType,
|
|
id,
|
|
roomName,
|
|
lastMessage,
|
|
users,
|
|
unreadMessagesCount,
|
|
chosenPlan,
|
|
);
|
|
|
|
/// Create a copy of ChatRoom
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith =>
|
|
__$$ChatRoomImplCopyWithImpl<_$ChatRoomImpl>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$ChatRoomImplToJson(this);
|
|
}
|
|
}
|
|
|
|
abstract class _ChatRoom implements ChatRoom {
|
|
const factory _ChatRoom({
|
|
@JsonKey(name: "id") required final String id,
|
|
@JsonKey(name: "room_name") required final String roomName,
|
|
@JsonKey(name: "last_message", fromJson: parseLastMessage)
|
|
required final ChatMessageModel? lastMessage,
|
|
@JsonKey(name: "users") required final Users users,
|
|
@JsonKey(name: "unread_messages_count")
|
|
required final int unreadMessagesCount,
|
|
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
|
required final ChosenPlanModel? chosenPlan,
|
|
}) = _$ChatRoomImpl;
|
|
|
|
factory _ChatRoom.fromJson(Map<String, dynamic> json) =
|
|
_$ChatRoomImpl.fromJson;
|
|
|
|
@override
|
|
@JsonKey(name: "id")
|
|
String get id;
|
|
@override
|
|
@JsonKey(name: "room_name")
|
|
String get roomName;
|
|
@override
|
|
@JsonKey(name: "last_message", fromJson: parseLastMessage)
|
|
ChatMessageModel? get lastMessage;
|
|
@override
|
|
@JsonKey(name: "users")
|
|
Users get users;
|
|
@override
|
|
@JsonKey(name: "unread_messages_count")
|
|
int get unreadMessagesCount;
|
|
@override
|
|
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
|
ChosenPlanModel? get chosenPlan;
|
|
|
|
/// Create a copy of ChatRoom
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
Users _$UsersFromJson(Map<String, dynamic> json) {
|
|
return _Users.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$Users {
|
|
@JsonKey(name: "from_chat_user")
|
|
ChatUser get fromChatUser => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "to_chat_user")
|
|
ChatUser get toChatUser => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this Users to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of Users
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$UsersCopyWith<Users> get copyWith => throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $UsersCopyWith<$Res> {
|
|
factory $UsersCopyWith(Users value, $Res Function(Users) then) =
|
|
_$UsersCopyWithImpl<$Res, Users>;
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "from_chat_user") ChatUser fromChatUser,
|
|
@JsonKey(name: "to_chat_user") ChatUser toChatUser,
|
|
});
|
|
|
|
$ChatUserCopyWith<$Res> get fromChatUser;
|
|
$ChatUserCopyWith<$Res> get toChatUser;
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$UsersCopyWithImpl<$Res, $Val extends Users>
|
|
implements $UsersCopyWith<$Res> {
|
|
_$UsersCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of Users
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({Object? fromChatUser = null, Object? toChatUser = null}) {
|
|
return _then(
|
|
_value.copyWith(
|
|
fromChatUser:
|
|
null == fromChatUser
|
|
? _value.fromChatUser
|
|
: fromChatUser // ignore: cast_nullable_to_non_nullable
|
|
as ChatUser,
|
|
toChatUser:
|
|
null == toChatUser
|
|
? _value.toChatUser
|
|
: toChatUser // ignore: cast_nullable_to_non_nullable
|
|
as ChatUser,
|
|
)
|
|
as $Val,
|
|
);
|
|
}
|
|
|
|
/// Create a copy of Users
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$ChatUserCopyWith<$Res> get fromChatUser {
|
|
return $ChatUserCopyWith<$Res>(_value.fromChatUser, (value) {
|
|
return _then(_value.copyWith(fromChatUser: value) as $Val);
|
|
});
|
|
}
|
|
|
|
/// Create a copy of Users
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$ChatUserCopyWith<$Res> get toChatUser {
|
|
return $ChatUserCopyWith<$Res>(_value.toChatUser, (value) {
|
|
return _then(_value.copyWith(toChatUser: value) as $Val);
|
|
});
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$UsersImplCopyWith<$Res> implements $UsersCopyWith<$Res> {
|
|
factory _$$UsersImplCopyWith(
|
|
_$UsersImpl value,
|
|
$Res Function(_$UsersImpl) then,
|
|
) = __$$UsersImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "from_chat_user") ChatUser fromChatUser,
|
|
@JsonKey(name: "to_chat_user") ChatUser toChatUser,
|
|
});
|
|
|
|
@override
|
|
$ChatUserCopyWith<$Res> get fromChatUser;
|
|
@override
|
|
$ChatUserCopyWith<$Res> get toChatUser;
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$UsersImplCopyWithImpl<$Res>
|
|
extends _$UsersCopyWithImpl<$Res, _$UsersImpl>
|
|
implements _$$UsersImplCopyWith<$Res> {
|
|
__$$UsersImplCopyWithImpl(
|
|
_$UsersImpl _value,
|
|
$Res Function(_$UsersImpl) _then,
|
|
) : super(_value, _then);
|
|
|
|
/// Create a copy of Users
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({Object? fromChatUser = null, Object? toChatUser = null}) {
|
|
return _then(
|
|
_$UsersImpl(
|
|
fromChatUser:
|
|
null == fromChatUser
|
|
? _value.fromChatUser
|
|
: fromChatUser // ignore: cast_nullable_to_non_nullable
|
|
as ChatUser,
|
|
toChatUser:
|
|
null == toChatUser
|
|
? _value.toChatUser
|
|
: toChatUser // ignore: cast_nullable_to_non_nullable
|
|
as ChatUser,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$UsersImpl implements _Users {
|
|
const _$UsersImpl({
|
|
@JsonKey(name: "from_chat_user") required this.fromChatUser,
|
|
@JsonKey(name: "to_chat_user") required this.toChatUser,
|
|
});
|
|
|
|
factory _$UsersImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$UsersImplFromJson(json);
|
|
|
|
@override
|
|
@JsonKey(name: "from_chat_user")
|
|
final ChatUser fromChatUser;
|
|
@override
|
|
@JsonKey(name: "to_chat_user")
|
|
final ChatUser toChatUser;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'Users(fromChatUser: $fromChatUser, toChatUser: $toChatUser)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$UsersImpl &&
|
|
(identical(other.fromChatUser, fromChatUser) ||
|
|
other.fromChatUser == fromChatUser) &&
|
|
(identical(other.toChatUser, toChatUser) ||
|
|
other.toChatUser == toChatUser));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType, fromChatUser, toChatUser);
|
|
|
|
/// Create a copy of Users
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$UsersImplCopyWith<_$UsersImpl> get copyWith =>
|
|
__$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$UsersImplToJson(this);
|
|
}
|
|
}
|
|
|
|
abstract class _Users implements Users {
|
|
const factory _Users({
|
|
@JsonKey(name: "from_chat_user") required final ChatUser fromChatUser,
|
|
@JsonKey(name: "to_chat_user") required final ChatUser toChatUser,
|
|
}) = _$UsersImpl;
|
|
|
|
factory _Users.fromJson(Map<String, dynamic> json) = _$UsersImpl.fromJson;
|
|
|
|
@override
|
|
@JsonKey(name: "from_chat_user")
|
|
ChatUser get fromChatUser;
|
|
@override
|
|
@JsonKey(name: "to_chat_user")
|
|
ChatUser get toChatUser;
|
|
|
|
/// Create a copy of Users
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$UsersImplCopyWith<_$UsersImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
ChatUser _$ChatUserFromJson(Map<String, dynamic> json) {
|
|
return _ChatUser.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$ChatUser {
|
|
@JsonKey(name: "id")
|
|
int get id => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "name")
|
|
String get name => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "profile_photo_path")
|
|
String? get profilePhotoPath => throw _privateConstructorUsedError;
|
|
@JsonKey(name: "profile_photo_url")
|
|
String get profilePhotoUrl => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this ChatUser to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of ChatUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$ChatUserCopyWith<ChatUser> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $ChatUserCopyWith<$Res> {
|
|
factory $ChatUserCopyWith(ChatUser value, $Res Function(ChatUser) then) =
|
|
_$ChatUserCopyWithImpl<$Res, ChatUser>;
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "id") int id,
|
|
@JsonKey(name: "name") String name,
|
|
@JsonKey(name: "profile_photo_path") String? profilePhotoPath,
|
|
@JsonKey(name: "profile_photo_url") String profilePhotoUrl,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser>
|
|
implements $ChatUserCopyWith<$Res> {
|
|
_$ChatUserCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of ChatUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? name = null,
|
|
Object? profilePhotoPath = freezed,
|
|
Object? profilePhotoUrl = null,
|
|
}) {
|
|
return _then(
|
|
_value.copyWith(
|
|
id:
|
|
null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
name:
|
|
null == name
|
|
? _value.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
profilePhotoPath:
|
|
freezed == profilePhotoPath
|
|
? _value.profilePhotoPath
|
|
: profilePhotoPath // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
profilePhotoUrl:
|
|
null == profilePhotoUrl
|
|
? _value.profilePhotoUrl
|
|
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
)
|
|
as $Val,
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$ChatUserImplCopyWith<$Res>
|
|
implements $ChatUserCopyWith<$Res> {
|
|
factory _$$ChatUserImplCopyWith(
|
|
_$ChatUserImpl value,
|
|
$Res Function(_$ChatUserImpl) then,
|
|
) = __$$ChatUserImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
@JsonKey(name: "id") int id,
|
|
@JsonKey(name: "name") String name,
|
|
@JsonKey(name: "profile_photo_path") String? profilePhotoPath,
|
|
@JsonKey(name: "profile_photo_url") String profilePhotoUrl,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$ChatUserImplCopyWithImpl<$Res>
|
|
extends _$ChatUserCopyWithImpl<$Res, _$ChatUserImpl>
|
|
implements _$$ChatUserImplCopyWith<$Res> {
|
|
__$$ChatUserImplCopyWithImpl(
|
|
_$ChatUserImpl _value,
|
|
$Res Function(_$ChatUserImpl) _then,
|
|
) : super(_value, _then);
|
|
|
|
/// Create a copy of ChatUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? name = null,
|
|
Object? profilePhotoPath = freezed,
|
|
Object? profilePhotoUrl = null,
|
|
}) {
|
|
return _then(
|
|
_$ChatUserImpl(
|
|
id:
|
|
null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
name:
|
|
null == name
|
|
? _value.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
profilePhotoPath:
|
|
freezed == profilePhotoPath
|
|
? _value.profilePhotoPath
|
|
: profilePhotoPath // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
profilePhotoUrl:
|
|
null == profilePhotoUrl
|
|
? _value.profilePhotoUrl
|
|
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$ChatUserImpl implements _ChatUser {
|
|
const _$ChatUserImpl({
|
|
@JsonKey(name: "id") required this.id,
|
|
@JsonKey(name: "name") required this.name,
|
|
@JsonKey(name: "profile_photo_path") required this.profilePhotoPath,
|
|
@JsonKey(name: "profile_photo_url") required this.profilePhotoUrl,
|
|
});
|
|
|
|
factory _$ChatUserImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$ChatUserImplFromJson(json);
|
|
|
|
@override
|
|
@JsonKey(name: "id")
|
|
final int id;
|
|
@override
|
|
@JsonKey(name: "name")
|
|
final String name;
|
|
@override
|
|
@JsonKey(name: "profile_photo_path")
|
|
final String? profilePhotoPath;
|
|
@override
|
|
@JsonKey(name: "profile_photo_url")
|
|
final String profilePhotoUrl;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ChatUser(id: $id, name: $name, profilePhotoPath: $profilePhotoPath, profilePhotoUrl: $profilePhotoUrl)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$ChatUserImpl &&
|
|
(identical(other.id, id) || other.id == id) &&
|
|
(identical(other.name, name) || other.name == name) &&
|
|
(identical(other.profilePhotoPath, profilePhotoPath) ||
|
|
other.profilePhotoPath == profilePhotoPath) &&
|
|
(identical(other.profilePhotoUrl, profilePhotoUrl) ||
|
|
other.profilePhotoUrl == profilePhotoUrl));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl);
|
|
|
|
/// Create a copy of ChatUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith =>
|
|
__$$ChatUserImplCopyWithImpl<_$ChatUserImpl>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$ChatUserImplToJson(this);
|
|
}
|
|
}
|
|
|
|
abstract class _ChatUser implements ChatUser {
|
|
const factory _ChatUser({
|
|
@JsonKey(name: "id") required final int id,
|
|
@JsonKey(name: "name") required final String name,
|
|
@JsonKey(name: "profile_photo_path")
|
|
required final String? profilePhotoPath,
|
|
@JsonKey(name: "profile_photo_url") required final String profilePhotoUrl,
|
|
}) = _$ChatUserImpl;
|
|
|
|
factory _ChatUser.fromJson(Map<String, dynamic> json) =
|
|
_$ChatUserImpl.fromJson;
|
|
|
|
@override
|
|
@JsonKey(name: "id")
|
|
int get id;
|
|
@override
|
|
@JsonKey(name: "name")
|
|
String get name;
|
|
@override
|
|
@JsonKey(name: "profile_photo_path")
|
|
String? get profilePhotoPath;
|
|
@override
|
|
@JsonKey(name: "profile_photo_url")
|
|
String get profilePhotoUrl;
|
|
|
|
/// Create a copy of ChatUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|