Merge pull request 'Исправления и улучшения' (#400) from mso7nueh/eatvio_app:main into main

Reviewed-on: eatvio/eatvio_app#400
This commit is contained in:
mso7nueh
2025-04-28 10:21:57 +00:00
39 changed files with 367 additions and 3633 deletions

View File

@@ -1,5 +1,5 @@
// String baseUrl = 'https://eatvio.ru';
String baseUrl = 'https://dev2.eatvio.com';
String baseUrl = 'https://eatvio.ru';
// String baseUrl = 'https://dev2.eatvio.com';
const List<int> durationValues = [7, 14, 21];

View File

@@ -104,8 +104,10 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
height: 1.2,
),
decoration: InputDecoration(
isDense: false, // убираем true, чтобы padding учитывался корректно
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), // вертикальный паддинг увеличен
isDense: false,
// убираем true, чтобы padding учитывался корректно
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
// вертикальный паддинг увеличен
hintText: 'Комментарий',
hintStyle: const TextStyle(
fontSize: 16,
@@ -209,7 +211,13 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
CircleAvatar(radius: 16, backgroundImage: NetworkImage(widget.blogPost.author.authorProfileIcon)),
CircleAvatar(
radius: 16,
foregroundImage: NetworkImage(
widget.blogPost.author.authorProfileIcon,
),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,

View File

@@ -81,7 +81,8 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
BottomNavigationBarItem(
label: '',
icon: CircleAvatar(
backgroundImage: NetworkImage(widget.profileModel.profilePhotoUrl),
foregroundImage: NetworkImage(widget.profileModel.profilePhotoUrl),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
radius: 16,
),
),

View File

@@ -1,82 +0,0 @@
// 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 'cancel_plan_state.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 _$CancelPlanState {}
/// @nodoc
abstract class $CancelPlanStateCopyWith<$Res> {
factory $CancelPlanStateCopyWith(
CancelPlanState value, $Res Function(CancelPlanState) then) =
_$CancelPlanStateCopyWithImpl<$Res, CancelPlanState>;
}
/// @nodoc
class _$CancelPlanStateCopyWithImpl<$Res, $Val extends CancelPlanState>
implements $CancelPlanStateCopyWith<$Res> {
_$CancelPlanStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of CancelPlanState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
abstract class _$$CancelPlanStateImplCopyWith<$Res> {
factory _$$CancelPlanStateImplCopyWith(_$CancelPlanStateImpl value,
$Res Function(_$CancelPlanStateImpl) then) =
__$$CancelPlanStateImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$CancelPlanStateImplCopyWithImpl<$Res>
extends _$CancelPlanStateCopyWithImpl<$Res, _$CancelPlanStateImpl>
implements _$$CancelPlanStateImplCopyWith<$Res> {
__$$CancelPlanStateImplCopyWithImpl(
_$CancelPlanStateImpl _value, $Res Function(_$CancelPlanStateImpl) _then)
: super(_value, _then);
/// Create a copy of CancelPlanState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
class _$CancelPlanStateImpl implements _CancelPlanState {
_$CancelPlanStateImpl();
@override
String toString() {
return 'CancelPlanState()';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType && other is _$CancelPlanStateImpl);
}
@override
int get hashCode => runtimeType.hashCode;
}
abstract class _CancelPlanState implements CancelPlanState {
factory _CancelPlanState() = _$CancelPlanStateImpl;
}

View File

@@ -1,184 +0,0 @@
// 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 'cancelation_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');
CancelationModel _$CancelationModelFromJson(Map<String, dynamic> json) {
return _CancelationModel.fromJson(json);
}
/// @nodoc
mixin _$CancelationModel {
String get description => throw _privateConstructorUsedError;
int get price => throw _privateConstructorUsedError;
/// Serializes this CancelationModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of CancelationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$CancelationModelCopyWith<CancelationModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $CancelationModelCopyWith<$Res> {
factory $CancelationModelCopyWith(
CancelationModel value, $Res Function(CancelationModel) then) =
_$CancelationModelCopyWithImpl<$Res, CancelationModel>;
@useResult
$Res call({String description, int price});
}
/// @nodoc
class _$CancelationModelCopyWithImpl<$Res, $Val extends CancelationModel>
implements $CancelationModelCopyWith<$Res> {
_$CancelationModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of CancelationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? description = null,
Object? price = null,
}) {
return _then(_value.copyWith(
description: null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
price: null == price
? _value.price
: price // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @nodoc
abstract class _$$CancelationModelImplCopyWith<$Res>
implements $CancelationModelCopyWith<$Res> {
factory _$$CancelationModelImplCopyWith(_$CancelationModelImpl value,
$Res Function(_$CancelationModelImpl) then) =
__$$CancelationModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String description, int price});
}
/// @nodoc
class __$$CancelationModelImplCopyWithImpl<$Res>
extends _$CancelationModelCopyWithImpl<$Res, _$CancelationModelImpl>
implements _$$CancelationModelImplCopyWith<$Res> {
__$$CancelationModelImplCopyWithImpl(_$CancelationModelImpl _value,
$Res Function(_$CancelationModelImpl) _then)
: super(_value, _then);
/// Create a copy of CancelationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? description = null,
Object? price = null,
}) {
return _then(_$CancelationModelImpl(
description: null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
price: null == price
? _value.price
: price // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
@JsonSerializable()
class _$CancelationModelImpl implements _CancelationModel {
_$CancelationModelImpl({required this.description, required this.price});
factory _$CancelationModelImpl.fromJson(Map<String, dynamic> json) =>
_$$CancelationModelImplFromJson(json);
@override
final String description;
@override
final int price;
@override
String toString() {
return 'CancelationModel(description: $description, price: $price)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$CancelationModelImpl &&
(identical(other.description, description) ||
other.description == description) &&
(identical(other.price, price) || other.price == price));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, description, price);
/// Create a copy of CancelationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$CancelationModelImplCopyWith<_$CancelationModelImpl> get copyWith =>
__$$CancelationModelImplCopyWithImpl<_$CancelationModelImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$CancelationModelImplToJson(
this,
);
}
}
abstract class _CancelationModel implements CancelationModel {
factory _CancelationModel(
{required final String description,
required final int price}) = _$CancelationModelImpl;
factory _CancelationModel.fromJson(Map<String, dynamic> json) =
_$CancelationModelImpl.fromJson;
@override
String get description;
@override
int get price;
/// Create a copy of CancelationModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$CancelationModelImplCopyWith<_$CancelationModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,21 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'cancelation_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$CancelationModelImpl _$$CancelationModelImplFromJson(
Map<String, dynamic> json) =>
_$CancelationModelImpl(
description: json['description'] as String,
price: (json['price'] as num).toInt(),
);
Map<String, dynamic> _$$CancelationModelImplToJson(
_$CancelationModelImpl instance) =>
<String, dynamic>{
'description': instance.description,
'price': instance.price,
};

View File

@@ -1,69 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'cancel_plan_service.dart';
// **************************************************************************
// RetrofitGenerator
// **************************************************************************
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
class _CancelPlanService implements CancelPlanService {
_CancelPlanService(this._dio, {this.baseUrl, this.errorLogger});
final Dio _dio;
String? baseUrl;
final ParseErrorLogger? errorLogger;
@override
Future<void> cancelChosenPlan({
required int id,
CancelationModel? body,
}) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
queryParameters.removeWhere((k, v) => v == null);
final _headers = <String, dynamic>{};
final _data = body;
final _options = _setStreamType<void>(
Options(method: 'POST', headers: _headers, extra: _extra)
.compose(
_dio.options,
'/api/chosen_plans/${id}/cancel',
queryParameters: queryParameters,
data: _data,
)
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
);
await _dio.fetch<void>(_options);
}
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes ||
requestOptions.responseType == ResponseType.stream)) {
if (T == String) {
requestOptions.responseType = ResponseType.plain;
} else {
requestOptions.responseType = ResponseType.json;
}
}
return requestOptions;
}
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
if (baseUrl == null || baseUrl.trim().isEmpty) {
return dioBaseUrl;
}
final url = Uri.parse(baseUrl);
if (url.isAbsolute) {
return url.toString();
}
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
}
}

View File

@@ -128,6 +128,7 @@ class _ChatScreenState extends State<ChatScreen> {
CircleAvatar(
radius: 20,
foregroundImage: NetworkImage(state.chatRoom.users.receiver.profilePhotoUrl!),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
),
if (state.chatRoom.users.receiver.profilePhotoUrl == null)
Container(

View File

@@ -40,9 +40,10 @@ class _ChatEntryWidgetState extends State<ChatEntryWidget> {
children: [
CircleAvatar(
radius: 24,
backgroundImage: NetworkImage(
foregroundImage: NetworkImage(
widget.chatRoom.users.toChatUser.profilePhotoUrl,
),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
backgroundColor: Colors.white,
),
const SizedBox(width: 12),

View File

@@ -1,799 +0,0 @@
// 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 'consultation_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');
ConsultationModel _$ConsultationModelFromJson(Map<String, dynamic> json) {
return _ConsultationModel.fromJson(json);
}
/// @nodoc
mixin _$ConsultationModel {
int get id => throw _privateConstructorUsedError;
@JsonKey(name: 'last_state')
ChosenPlanStateEnum get chosenPlanState => throw _privateConstructorUsedError;
String get planTitle => throw _privateConstructorUsedError;
String get userName => throw _privateConstructorUsedError;
String get userSlug => throw _privateConstructorUsedError;
double get consultantPayment => throw _privateConstructorUsedError;
int get duration => throw _privateConstructorUsedError;
int get currentDiaryDay => throw _privateConstructorUsedError;
@JsonKey(name: 'start_date', fromJson: parseDate)
DateTime get startDate => throw _privateConstructorUsedError;
@JsonKey(name: 'end_date', fromJson: parseDate)
DateTime get endDate => throw _privateConstructorUsedError;
@JsonKey(name: 'consultant_id')
int get consultantId => throw _privateConstructorUsedError;
List<DiaryModel> get diaries => throw _privateConstructorUsedError;
/// Serializes this ConsultationModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ConsultationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ConsultationModelCopyWith<ConsultationModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ConsultationModelCopyWith<$Res> {
factory $ConsultationModelCopyWith(
ConsultationModel value, $Res Function(ConsultationModel) then) =
_$ConsultationModelCopyWithImpl<$Res, ConsultationModel>;
@useResult
$Res call(
{int id,
@JsonKey(name: 'last_state') ChosenPlanStateEnum chosenPlanState,
String planTitle,
String userName,
String userSlug,
double consultantPayment,
int duration,
int currentDiaryDay,
@JsonKey(name: 'start_date', fromJson: parseDate) DateTime startDate,
@JsonKey(name: 'end_date', fromJson: parseDate) DateTime endDate,
@JsonKey(name: 'consultant_id') int consultantId,
List<DiaryModel> diaries});
}
/// @nodoc
class _$ConsultationModelCopyWithImpl<$Res, $Val extends ConsultationModel>
implements $ConsultationModelCopyWith<$Res> {
_$ConsultationModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ConsultationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? chosenPlanState = null,
Object? planTitle = null,
Object? userName = null,
Object? userSlug = null,
Object? consultantPayment = null,
Object? duration = null,
Object? currentDiaryDay = null,
Object? startDate = null,
Object? endDate = null,
Object? consultantId = null,
Object? diaries = null,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
chosenPlanState: null == chosenPlanState
? _value.chosenPlanState
: chosenPlanState // ignore: cast_nullable_to_non_nullable
as ChosenPlanStateEnum,
planTitle: null == planTitle
? _value.planTitle
: planTitle // ignore: cast_nullable_to_non_nullable
as String,
userName: null == userName
? _value.userName
: userName // ignore: cast_nullable_to_non_nullable
as String,
userSlug: null == userSlug
? _value.userSlug
: userSlug // ignore: cast_nullable_to_non_nullable
as String,
consultantPayment: null == consultantPayment
? _value.consultantPayment
: consultantPayment // ignore: cast_nullable_to_non_nullable
as double,
duration: null == duration
? _value.duration
: duration // ignore: cast_nullable_to_non_nullable
as int,
currentDiaryDay: null == currentDiaryDay
? _value.currentDiaryDay
: currentDiaryDay // ignore: cast_nullable_to_non_nullable
as int,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
endDate: null == endDate
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as DateTime,
consultantId: null == consultantId
? _value.consultantId
: consultantId // ignore: cast_nullable_to_non_nullable
as int,
diaries: null == diaries
? _value.diaries
: diaries // ignore: cast_nullable_to_non_nullable
as List<DiaryModel>,
) as $Val);
}
}
/// @nodoc
abstract class _$$ConsultationModelImplCopyWith<$Res>
implements $ConsultationModelCopyWith<$Res> {
factory _$$ConsultationModelImplCopyWith(_$ConsultationModelImpl value,
$Res Function(_$ConsultationModelImpl) then) =
__$$ConsultationModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{int id,
@JsonKey(name: 'last_state') ChosenPlanStateEnum chosenPlanState,
String planTitle,
String userName,
String userSlug,
double consultantPayment,
int duration,
int currentDiaryDay,
@JsonKey(name: 'start_date', fromJson: parseDate) DateTime startDate,
@JsonKey(name: 'end_date', fromJson: parseDate) DateTime endDate,
@JsonKey(name: 'consultant_id') int consultantId,
List<DiaryModel> diaries});
}
/// @nodoc
class __$$ConsultationModelImplCopyWithImpl<$Res>
extends _$ConsultationModelCopyWithImpl<$Res, _$ConsultationModelImpl>
implements _$$ConsultationModelImplCopyWith<$Res> {
__$$ConsultationModelImplCopyWithImpl(_$ConsultationModelImpl _value,
$Res Function(_$ConsultationModelImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? chosenPlanState = null,
Object? planTitle = null,
Object? userName = null,
Object? userSlug = null,
Object? consultantPayment = null,
Object? duration = null,
Object? currentDiaryDay = null,
Object? startDate = null,
Object? endDate = null,
Object? consultantId = null,
Object? diaries = null,
}) {
return _then(_$ConsultationModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
chosenPlanState: null == chosenPlanState
? _value.chosenPlanState
: chosenPlanState // ignore: cast_nullable_to_non_nullable
as ChosenPlanStateEnum,
planTitle: null == planTitle
? _value.planTitle
: planTitle // ignore: cast_nullable_to_non_nullable
as String,
userName: null == userName
? _value.userName
: userName // ignore: cast_nullable_to_non_nullable
as String,
userSlug: null == userSlug
? _value.userSlug
: userSlug // ignore: cast_nullable_to_non_nullable
as String,
consultantPayment: null == consultantPayment
? _value.consultantPayment
: consultantPayment // ignore: cast_nullable_to_non_nullable
as double,
duration: null == duration
? _value.duration
: duration // ignore: cast_nullable_to_non_nullable
as int,
currentDiaryDay: null == currentDiaryDay
? _value.currentDiaryDay
: currentDiaryDay // ignore: cast_nullable_to_non_nullable
as int,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
endDate: null == endDate
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as DateTime,
consultantId: null == consultantId
? _value.consultantId
: consultantId // ignore: cast_nullable_to_non_nullable
as int,
diaries: null == diaries
? _value._diaries
: diaries // ignore: cast_nullable_to_non_nullable
as List<DiaryModel>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ConsultationModelImpl implements _ConsultationModel {
_$ConsultationModelImpl(
{required this.id,
@JsonKey(name: 'last_state') required this.chosenPlanState,
required this.planTitle,
required this.userName,
required this.userSlug,
required this.consultantPayment,
required this.duration,
required this.currentDiaryDay,
@JsonKey(name: 'start_date', fromJson: parseDate) required this.startDate,
@JsonKey(name: 'end_date', fromJson: parseDate) required this.endDate,
@JsonKey(name: 'consultant_id') required this.consultantId,
required final List<DiaryModel> diaries})
: _diaries = diaries;
factory _$ConsultationModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ConsultationModelImplFromJson(json);
@override
final int id;
@override
@JsonKey(name: 'last_state')
final ChosenPlanStateEnum chosenPlanState;
@override
final String planTitle;
@override
final String userName;
@override
final String userSlug;
@override
final double consultantPayment;
@override
final int duration;
@override
final int currentDiaryDay;
@override
@JsonKey(name: 'start_date', fromJson: parseDate)
final DateTime startDate;
@override
@JsonKey(name: 'end_date', fromJson: parseDate)
final DateTime endDate;
@override
@JsonKey(name: 'consultant_id')
final int consultantId;
final List<DiaryModel> _diaries;
@override
List<DiaryModel> get diaries {
if (_diaries is EqualUnmodifiableListView) return _diaries;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_diaries);
}
@override
String toString() {
return 'ConsultationModel(id: $id, chosenPlanState: $chosenPlanState, planTitle: $planTitle, userName: $userName, userSlug: $userSlug, consultantPayment: $consultantPayment, duration: $duration, currentDiaryDay: $currentDiaryDay, startDate: $startDate, endDate: $endDate, consultantId: $consultantId, diaries: $diaries)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ConsultationModelImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.chosenPlanState, chosenPlanState) ||
other.chosenPlanState == chosenPlanState) &&
(identical(other.planTitle, planTitle) ||
other.planTitle == planTitle) &&
(identical(other.userName, userName) ||
other.userName == userName) &&
(identical(other.userSlug, userSlug) ||
other.userSlug == userSlug) &&
(identical(other.consultantPayment, consultantPayment) ||
other.consultantPayment == consultantPayment) &&
(identical(other.duration, duration) ||
other.duration == duration) &&
(identical(other.currentDiaryDay, currentDiaryDay) ||
other.currentDiaryDay == currentDiaryDay) &&
(identical(other.startDate, startDate) ||
other.startDate == startDate) &&
(identical(other.endDate, endDate) || other.endDate == endDate) &&
(identical(other.consultantId, consultantId) ||
other.consultantId == consultantId) &&
const DeepCollectionEquality().equals(other._diaries, _diaries));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
chosenPlanState,
planTitle,
userName,
userSlug,
consultantPayment,
duration,
currentDiaryDay,
startDate,
endDate,
consultantId,
const DeepCollectionEquality().hash(_diaries));
/// Create a copy of ConsultationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ConsultationModelImplCopyWith<_$ConsultationModelImpl> get copyWith =>
__$$ConsultationModelImplCopyWithImpl<_$ConsultationModelImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ConsultationModelImplToJson(
this,
);
}
}
abstract class _ConsultationModel implements ConsultationModel {
factory _ConsultationModel(
{required final int id,
@JsonKey(name: 'last_state')
required final ChosenPlanStateEnum chosenPlanState,
required final String planTitle,
required final String userName,
required final String userSlug,
required final double consultantPayment,
required final int duration,
required final int currentDiaryDay,
@JsonKey(name: 'start_date', fromJson: parseDate)
required final DateTime startDate,
@JsonKey(name: 'end_date', fromJson: parseDate)
required final DateTime endDate,
@JsonKey(name: 'consultant_id') required final int consultantId,
required final List<DiaryModel> diaries}) = _$ConsultationModelImpl;
factory _ConsultationModel.fromJson(Map<String, dynamic> json) =
_$ConsultationModelImpl.fromJson;
@override
int get id;
@override
@JsonKey(name: 'last_state')
ChosenPlanStateEnum get chosenPlanState;
@override
String get planTitle;
@override
String get userName;
@override
String get userSlug;
@override
double get consultantPayment;
@override
int get duration;
@override
int get currentDiaryDay;
@override
@JsonKey(name: 'start_date', fromJson: parseDate)
DateTime get startDate;
@override
@JsonKey(name: 'end_date', fromJson: parseDate)
DateTime get endDate;
@override
@JsonKey(name: 'consultant_id')
int get consultantId;
@override
List<DiaryModel> get diaries;
/// Create a copy of ConsultationModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ConsultationModelImplCopyWith<_$ConsultationModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
DiaryModel _$DiaryModelFromJson(Map<String, dynamic> json) {
return _DiaryModel.fromJson(json);
}
/// @nodoc
mixin _$DiaryModel {
int get id => throw _privateConstructorUsedError;
DiaryStateEnum get state => throw _privateConstructorUsedError;
@JsonKey(fromJson: parseUnformattedDate)
DateTime get date => throw _privateConstructorUsedError;
/// Serializes this DiaryModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$DiaryModelCopyWith<DiaryModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $DiaryModelCopyWith<$Res> {
factory $DiaryModelCopyWith(
DiaryModel value, $Res Function(DiaryModel) then) =
_$DiaryModelCopyWithImpl<$Res, DiaryModel>;
@useResult
$Res call(
{int id,
DiaryStateEnum state,
@JsonKey(fromJson: parseUnformattedDate) DateTime date});
}
/// @nodoc
class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel>
implements $DiaryModelCopyWith<$Res> {
_$DiaryModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? state = null,
Object? date = null,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as DiaryStateEnum,
date: null == date
? _value.date
: date // ignore: cast_nullable_to_non_nullable
as DateTime,
) as $Val);
}
}
/// @nodoc
abstract class _$$DiaryModelImplCopyWith<$Res>
implements $DiaryModelCopyWith<$Res> {
factory _$$DiaryModelImplCopyWith(
_$DiaryModelImpl value, $Res Function(_$DiaryModelImpl) then) =
__$$DiaryModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{int id,
DiaryStateEnum state,
@JsonKey(fromJson: parseUnformattedDate) DateTime date});
}
/// @nodoc
class __$$DiaryModelImplCopyWithImpl<$Res>
extends _$DiaryModelCopyWithImpl<$Res, _$DiaryModelImpl>
implements _$$DiaryModelImplCopyWith<$Res> {
__$$DiaryModelImplCopyWithImpl(
_$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then)
: super(_value, _then);
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? state = null,
Object? date = null,
}) {
return _then(_$DiaryModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as DiaryStateEnum,
date: null == date
? _value.date
: date // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
}
/// @nodoc
@JsonSerializable()
class _$DiaryModelImpl implements _DiaryModel {
_$DiaryModelImpl(
{required this.id,
required this.state,
@JsonKey(fromJson: parseUnformattedDate) required this.date});
factory _$DiaryModelImpl.fromJson(Map<String, dynamic> json) =>
_$$DiaryModelImplFromJson(json);
@override
final int id;
@override
final DiaryStateEnum state;
@override
@JsonKey(fromJson: parseUnformattedDate)
final DateTime date;
@override
String toString() {
return 'DiaryModel(id: $id, state: $state, date: $date)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$DiaryModelImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.state, state) || other.state == state) &&
(identical(other.date, date) || other.date == date));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, state, date);
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith =>
__$$DiaryModelImplCopyWithImpl<_$DiaryModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$DiaryModelImplToJson(
this,
);
}
}
abstract class _DiaryModel implements DiaryModel {
factory _DiaryModel(
{required final int id,
required final DiaryStateEnum state,
@JsonKey(fromJson: parseUnformattedDate)
required final DateTime date}) = _$DiaryModelImpl;
factory _DiaryModel.fromJson(Map<String, dynamic> json) =
_$DiaryModelImpl.fromJson;
@override
int get id;
@override
DiaryStateEnum get state;
@override
@JsonKey(fromJson: parseUnformattedDate)
DateTime get date;
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
ConsultationPaginationModel _$ConsultationPaginationModelFromJson(
Map<String, dynamic> json) {
return _ConsultationPaginationModel.fromJson(json);
}
/// @nodoc
mixin _$ConsultationPaginationModel {
List<ConsultationModel> get data => throw _privateConstructorUsedError;
/// Serializes this ConsultationPaginationModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ConsultationPaginationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ConsultationPaginationModelCopyWith<ConsultationPaginationModel>
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ConsultationPaginationModelCopyWith<$Res> {
factory $ConsultationPaginationModelCopyWith(
ConsultationPaginationModel value,
$Res Function(ConsultationPaginationModel) then) =
_$ConsultationPaginationModelCopyWithImpl<$Res,
ConsultationPaginationModel>;
@useResult
$Res call({List<ConsultationModel> data});
}
/// @nodoc
class _$ConsultationPaginationModelCopyWithImpl<$Res,
$Val extends ConsultationPaginationModel>
implements $ConsultationPaginationModelCopyWith<$Res> {
_$ConsultationPaginationModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ConsultationPaginationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? data = null,
}) {
return _then(_value.copyWith(
data: null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as List<ConsultationModel>,
) as $Val);
}
}
/// @nodoc
abstract class _$$ConsultationPaginationModelImplCopyWith<$Res>
implements $ConsultationPaginationModelCopyWith<$Res> {
factory _$$ConsultationPaginationModelImplCopyWith(
_$ConsultationPaginationModelImpl value,
$Res Function(_$ConsultationPaginationModelImpl) then) =
__$$ConsultationPaginationModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({List<ConsultationModel> data});
}
/// @nodoc
class __$$ConsultationPaginationModelImplCopyWithImpl<$Res>
extends _$ConsultationPaginationModelCopyWithImpl<$Res,
_$ConsultationPaginationModelImpl>
implements _$$ConsultationPaginationModelImplCopyWith<$Res> {
__$$ConsultationPaginationModelImplCopyWithImpl(
_$ConsultationPaginationModelImpl _value,
$Res Function(_$ConsultationPaginationModelImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultationPaginationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? data = null,
}) {
return _then(_$ConsultationPaginationModelImpl(
data: null == data
? _value._data
: data // ignore: cast_nullable_to_non_nullable
as List<ConsultationModel>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ConsultationPaginationModelImpl
implements _ConsultationPaginationModel {
_$ConsultationPaginationModelImpl(
{required final List<ConsultationModel> data})
: _data = data;
factory _$ConsultationPaginationModelImpl.fromJson(
Map<String, dynamic> json) =>
_$$ConsultationPaginationModelImplFromJson(json);
final List<ConsultationModel> _data;
@override
List<ConsultationModel> get data {
if (_data is EqualUnmodifiableListView) return _data;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_data);
}
@override
String toString() {
return 'ConsultationPaginationModel(data: $data)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ConsultationPaginationModelImpl &&
const DeepCollectionEquality().equals(other._data, _data));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(_data));
/// Create a copy of ConsultationPaginationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ConsultationPaginationModelImplCopyWith<_$ConsultationPaginationModelImpl>
get copyWith => __$$ConsultationPaginationModelImplCopyWithImpl<
_$ConsultationPaginationModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ConsultationPaginationModelImplToJson(
this,
);
}
}
abstract class _ConsultationPaginationModel
implements ConsultationPaginationModel {
factory _ConsultationPaginationModel(
{required final List<ConsultationModel> data}) =
_$ConsultationPaginationModelImpl;
factory _ConsultationPaginationModel.fromJson(Map<String, dynamic> json) =
_$ConsultationPaginationModelImpl.fromJson;
@override
List<ConsultationModel> get data;
/// Create a copy of ConsultationPaginationModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ConsultationPaginationModelImplCopyWith<_$ConsultationPaginationModelImpl>
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -1,100 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'consultation_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$ConsultationModelImpl _$$ConsultationModelImplFromJson(
Map<String, dynamic> json) =>
_$ConsultationModelImpl(
id: (json['id'] as num).toInt(),
chosenPlanState:
$enumDecode(_$ChosenPlanStateEnumEnumMap, json['last_state']),
planTitle: json['planTitle'] as String,
userName: json['userName'] as String,
userSlug: json['userSlug'] as String,
consultantPayment: (json['consultantPayment'] as num).toDouble(),
duration: (json['duration'] as num).toInt(),
currentDiaryDay: (json['currentDiaryDay'] as num).toInt(),
startDate: parseDate(json['start_date'] as String),
endDate: parseDate(json['end_date'] as String),
consultantId: (json['consultant_id'] as num).toInt(),
diaries: (json['diaries'] as List<dynamic>)
.map((e) => DiaryModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$ConsultationModelImplToJson(
_$ConsultationModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
'last_state': _$ChosenPlanStateEnumEnumMap[instance.chosenPlanState]!,
'planTitle': instance.planTitle,
'userName': instance.userName,
'userSlug': instance.userSlug,
'consultantPayment': instance.consultantPayment,
'duration': instance.duration,
'currentDiaryDay': instance.currentDiaryDay,
'start_date': instance.startDate.toIso8601String(),
'end_date': instance.endDate.toIso8601String(),
'consultant_id': instance.consultantId,
'diaries': instance.diaries,
};
const _$ChosenPlanStateEnumEnumMap = {
ChosenPlanStateEnum.stateInited: 'initied',
ChosenPlanStateEnum.stateStartDateHasBeenSet: 'start_date_has_been_set',
ChosenPlanStateEnum.stateInCoordination: 'in_coordination',
ChosenPlanStateEnum.stateStarted: 'started',
ChosenPlanStateEnum.stateInProgress: 'in_progress',
ChosenPlanStateEnum.statePendingPayment: 'pending_payment',
ChosenPlanStateEnum.stateConfirmedByConsultant: 'confirmed_by_consultant',
ChosenPlanStateEnum.statePaid: 'paid',
ChosenPlanStateEnum.stateCanceledByTheInitiator: 'canceled_by_the_initiator',
ChosenPlanStateEnum.stateLastDayStarted: 'last_day_started',
ChosenPlanStateEnum.stateLastDayFinished: 'last_day_finished',
ChosenPlanStateEnum.stateComplained: 'complained',
ChosenPlanStateEnum.stateDone: 'done',
ChosenPlanStateEnum.stateChargeWasCollected: 'charge_was_collected',
};
_$DiaryModelImpl _$$DiaryModelImplFromJson(Map<String, dynamic> json) =>
_$DiaryModelImpl(
id: (json['id'] as num).toInt(),
state: $enumDecode(_$DiaryStateEnumEnumMap, json['state']),
date: parseUnformattedDate(json['date'] as String),
);
Map<String, dynamic> _$$DiaryModelImplToJson(_$DiaryModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
'state': _$DiaryStateEnumEnumMap[instance.state]!,
'date': instance.date.toIso8601String(),
};
const _$DiaryStateEnumEnumMap = {
DiaryStateEnum.init: 'init',
DiaryStateEnum.started: 'started',
DiaryStateEnum.finished: 'finished',
DiaryStateEnum.commented: 'commented',
DiaryStateEnum.reviewedByUser: 'reviewed_by_user',
DiaryStateEnum.lastDayStarted: 'last_day_started',
DiaryStateEnum.lastDayFinished: 'last_day_finished',
DiaryStateEnum.lastDayCommented: 'last_day_commented',
};
_$ConsultationPaginationModelImpl _$$ConsultationPaginationModelImplFromJson(
Map<String, dynamic> json) =>
_$ConsultationPaginationModelImpl(
data: (json['data'] as List<dynamic>)
.map((e) => ConsultationModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$ConsultationPaginationModelImplToJson(
_$ConsultationPaginationModelImpl instance) =>
<String, dynamic>{
'data': instance.data,
};

View File

@@ -1,175 +0,0 @@
// 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 'consultations_state.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 _$ConsultationsState {
BaseState get state => throw _privateConstructorUsedError;
List<ConsultationModel> get consultations =>
throw _privateConstructorUsedError;
/// Create a copy of ConsultationsState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ConsultationsStateCopyWith<ConsultationsState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ConsultationsStateCopyWith<$Res> {
factory $ConsultationsStateCopyWith(
ConsultationsState value, $Res Function(ConsultationsState) then) =
_$ConsultationsStateCopyWithImpl<$Res, ConsultationsState>;
@useResult
$Res call({BaseState state, List<ConsultationModel> consultations});
}
/// @nodoc
class _$ConsultationsStateCopyWithImpl<$Res, $Val extends ConsultationsState>
implements $ConsultationsStateCopyWith<$Res> {
_$ConsultationsStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ConsultationsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? state = null,
Object? consultations = null,
}) {
return _then(_value.copyWith(
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as BaseState,
consultations: null == consultations
? _value.consultations
: consultations // ignore: cast_nullable_to_non_nullable
as List<ConsultationModel>,
) as $Val);
}
}
/// @nodoc
abstract class _$$ConsultationsStateImplCopyWith<$Res>
implements $ConsultationsStateCopyWith<$Res> {
factory _$$ConsultationsStateImplCopyWith(_$ConsultationsStateImpl value,
$Res Function(_$ConsultationsStateImpl) then) =
__$$ConsultationsStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({BaseState state, List<ConsultationModel> consultations});
}
/// @nodoc
class __$$ConsultationsStateImplCopyWithImpl<$Res>
extends _$ConsultationsStateCopyWithImpl<$Res, _$ConsultationsStateImpl>
implements _$$ConsultationsStateImplCopyWith<$Res> {
__$$ConsultationsStateImplCopyWithImpl(_$ConsultationsStateImpl _value,
$Res Function(_$ConsultationsStateImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultationsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? state = null,
Object? consultations = null,
}) {
return _then(_$ConsultationsStateImpl(
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as BaseState,
consultations: null == consultations
? _value._consultations
: consultations // ignore: cast_nullable_to_non_nullable
as List<ConsultationModel>,
));
}
}
/// @nodoc
class _$ConsultationsStateImpl implements _ConsultationsState {
_$ConsultationsStateImpl(
{this.state = BaseState.initial,
final List<ConsultationModel> consultations = const []})
: _consultations = consultations;
@override
@JsonKey()
final BaseState state;
final List<ConsultationModel> _consultations;
@override
@JsonKey()
List<ConsultationModel> get consultations {
if (_consultations is EqualUnmodifiableListView) return _consultations;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_consultations);
}
@override
String toString() {
return 'ConsultationsState(state: $state, consultations: $consultations)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ConsultationsStateImpl &&
(identical(other.state, state) || other.state == state) &&
const DeepCollectionEquality()
.equals(other._consultations, _consultations));
}
@override
int get hashCode => Object.hash(
runtimeType, state, const DeepCollectionEquality().hash(_consultations));
/// Create a copy of ConsultationsState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ConsultationsStateImplCopyWith<_$ConsultationsStateImpl> get copyWith =>
__$$ConsultationsStateImplCopyWithImpl<_$ConsultationsStateImpl>(
this, _$identity);
}
abstract class _ConsultationsState implements ConsultationsState {
factory _ConsultationsState(
{final BaseState state,
final List<ConsultationModel> consultations}) = _$ConsultationsStateImpl;
@override
BaseState get state;
@override
List<ConsultationModel> get consultations;
/// Create a copy of ConsultationsState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ConsultationsStateImplCopyWith<_$ConsultationsStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,73 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'consultation_service.dart';
// **************************************************************************
// RetrofitGenerator
// **************************************************************************
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
class _ConsultationService implements ConsultationService {
_ConsultationService(this._dio, {this.baseUrl, this.errorLogger});
final Dio _dio;
String? baseUrl;
final ParseErrorLogger? errorLogger;
@override
Future<ConsultationPaginationModel> getConsultations() async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
const Map<String, dynamic>? _data = null;
final _options = _setStreamType<ConsultationPaginationModel>(
Options(method: 'GET', headers: _headers, extra: _extra)
.compose(
_dio.options,
'/api/consultations',
queryParameters: queryParameters,
data: _data,
)
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
);
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
late ConsultationPaginationModel _value;
try {
_value = ConsultationPaginationModel.fromJson(_result.data!);
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
}
return _value;
}
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes ||
requestOptions.responseType == ResponseType.stream)) {
if (T == String) {
requestOptions.responseType = ResponseType.plain;
} else {
requestOptions.responseType = ResponseType.json;
}
}
return requestOptions;
}
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
if (baseUrl == null || baseUrl.trim().isEmpty) {
return dioBaseUrl;
}
final url = Uri.parse(baseUrl);
if (url.isAbsolute) {
return url.toString();
}
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
}
}

View File

@@ -1,581 +0,0 @@
// 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 'consultant_comment_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');
ConsultantCommentModel _$ConsultantCommentModelFromJson(
Map<String, dynamic> json) {
return _ConsultantCommentModel.fromJson(json);
}
/// @nodoc
mixin _$ConsultantCommentModel {
String? get comment => throw _privateConstructorUsedError;
@JsonKey(name: 'meals')
Map<String, MealCommentModel> get mealsComments =>
throw _privateConstructorUsedError;
List<PortionCommentModel> get portions => throw _privateConstructorUsedError;
/// Serializes this ConsultantCommentModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ConsultantCommentModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ConsultantCommentModelCopyWith<ConsultantCommentModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ConsultantCommentModelCopyWith<$Res> {
factory $ConsultantCommentModelCopyWith(ConsultantCommentModel value,
$Res Function(ConsultantCommentModel) then) =
_$ConsultantCommentModelCopyWithImpl<$Res, ConsultantCommentModel>;
@useResult
$Res call(
{String? comment,
@JsonKey(name: 'meals') Map<String, MealCommentModel> mealsComments,
List<PortionCommentModel> portions});
}
/// @nodoc
class _$ConsultantCommentModelCopyWithImpl<$Res,
$Val extends ConsultantCommentModel>
implements $ConsultantCommentModelCopyWith<$Res> {
_$ConsultantCommentModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ConsultantCommentModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? comment = freezed,
Object? mealsComments = null,
Object? portions = null,
}) {
return _then(_value.copyWith(
comment: freezed == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String?,
mealsComments: null == mealsComments
? _value.mealsComments
: mealsComments // ignore: cast_nullable_to_non_nullable
as Map<String, MealCommentModel>,
portions: null == portions
? _value.portions
: portions // ignore: cast_nullable_to_non_nullable
as List<PortionCommentModel>,
) as $Val);
}
}
/// @nodoc
abstract class _$$ConsultantCommentModelImplCopyWith<$Res>
implements $ConsultantCommentModelCopyWith<$Res> {
factory _$$ConsultantCommentModelImplCopyWith(
_$ConsultantCommentModelImpl value,
$Res Function(_$ConsultantCommentModelImpl) then) =
__$$ConsultantCommentModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{String? comment,
@JsonKey(name: 'meals') Map<String, MealCommentModel> mealsComments,
List<PortionCommentModel> portions});
}
/// @nodoc
class __$$ConsultantCommentModelImplCopyWithImpl<$Res>
extends _$ConsultantCommentModelCopyWithImpl<$Res,
_$ConsultantCommentModelImpl>
implements _$$ConsultantCommentModelImplCopyWith<$Res> {
__$$ConsultantCommentModelImplCopyWithImpl(
_$ConsultantCommentModelImpl _value,
$Res Function(_$ConsultantCommentModelImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultantCommentModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? comment = freezed,
Object? mealsComments = null,
Object? portions = null,
}) {
return _then(_$ConsultantCommentModelImpl(
comment: freezed == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String?,
mealsComments: null == mealsComments
? _value._mealsComments
: mealsComments // ignore: cast_nullable_to_non_nullable
as Map<String, MealCommentModel>,
portions: null == portions
? _value._portions
: portions // ignore: cast_nullable_to_non_nullable
as List<PortionCommentModel>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ConsultantCommentModelImpl implements _ConsultantCommentModel {
_$ConsultantCommentModelImpl(
{this.comment,
@JsonKey(name: 'meals')
final Map<String, MealCommentModel> mealsComments = const {},
final List<PortionCommentModel> portions = const []})
: _mealsComments = mealsComments,
_portions = portions;
factory _$ConsultantCommentModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ConsultantCommentModelImplFromJson(json);
@override
final String? comment;
final Map<String, MealCommentModel> _mealsComments;
@override
@JsonKey(name: 'meals')
Map<String, MealCommentModel> get mealsComments {
if (_mealsComments is EqualUnmodifiableMapView) return _mealsComments;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(_mealsComments);
}
final List<PortionCommentModel> _portions;
@override
@JsonKey()
List<PortionCommentModel> get portions {
if (_portions is EqualUnmodifiableListView) return _portions;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_portions);
}
@override
String toString() {
return 'ConsultantCommentModel(comment: $comment, mealsComments: $mealsComments, portions: $portions)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ConsultantCommentModelImpl &&
(identical(other.comment, comment) || other.comment == comment) &&
const DeepCollectionEquality()
.equals(other._mealsComments, _mealsComments) &&
const DeepCollectionEquality().equals(other._portions, _portions));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
comment,
const DeepCollectionEquality().hash(_mealsComments),
const DeepCollectionEquality().hash(_portions));
/// Create a copy of ConsultantCommentModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ConsultantCommentModelImplCopyWith<_$ConsultantCommentModelImpl>
get copyWith => __$$ConsultantCommentModelImplCopyWithImpl<
_$ConsultantCommentModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ConsultantCommentModelImplToJson(
this,
);
}
}
abstract class _ConsultantCommentModel implements ConsultantCommentModel {
factory _ConsultantCommentModel(
{final String? comment,
@JsonKey(name: 'meals') final Map<String, MealCommentModel> mealsComments,
final List<PortionCommentModel> portions}) = _$ConsultantCommentModelImpl;
factory _ConsultantCommentModel.fromJson(Map<String, dynamic> json) =
_$ConsultantCommentModelImpl.fromJson;
@override
String? get comment;
@override
@JsonKey(name: 'meals')
Map<String, MealCommentModel> get mealsComments;
@override
List<PortionCommentModel> get portions;
/// Create a copy of ConsultantCommentModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ConsultantCommentModelImplCopyWith<_$ConsultantCommentModelImpl>
get copyWith => throw _privateConstructorUsedError;
}
PortionCommentModel _$PortionCommentModelFromJson(Map<String, dynamic> json) {
return _PortionCommentModel.fromJson(json);
}
/// @nodoc
mixin _$PortionCommentModel {
String get comment => throw _privateConstructorUsedError;
int get id => throw _privateConstructorUsedError;
/// Serializes this PortionCommentModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of PortionCommentModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PortionCommentModelCopyWith<PortionCommentModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PortionCommentModelCopyWith<$Res> {
factory $PortionCommentModelCopyWith(
PortionCommentModel value, $Res Function(PortionCommentModel) then) =
_$PortionCommentModelCopyWithImpl<$Res, PortionCommentModel>;
@useResult
$Res call({String comment, int id});
}
/// @nodoc
class _$PortionCommentModelCopyWithImpl<$Res, $Val extends PortionCommentModel>
implements $PortionCommentModelCopyWith<$Res> {
_$PortionCommentModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PortionCommentModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? comment = null,
Object? id = null,
}) {
return _then(_value.copyWith(
comment: null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @nodoc
abstract class _$$PortionCommentModelImplCopyWith<$Res>
implements $PortionCommentModelCopyWith<$Res> {
factory _$$PortionCommentModelImplCopyWith(_$PortionCommentModelImpl value,
$Res Function(_$PortionCommentModelImpl) then) =
__$$PortionCommentModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String comment, int id});
}
/// @nodoc
class __$$PortionCommentModelImplCopyWithImpl<$Res>
extends _$PortionCommentModelCopyWithImpl<$Res, _$PortionCommentModelImpl>
implements _$$PortionCommentModelImplCopyWith<$Res> {
__$$PortionCommentModelImplCopyWithImpl(_$PortionCommentModelImpl _value,
$Res Function(_$PortionCommentModelImpl) _then)
: super(_value, _then);
/// Create a copy of PortionCommentModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? comment = null,
Object? id = null,
}) {
return _then(_$PortionCommentModelImpl(
comment: null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
@JsonSerializable()
class _$PortionCommentModelImpl implements _PortionCommentModel {
_$PortionCommentModelImpl({required this.comment, required this.id});
factory _$PortionCommentModelImpl.fromJson(Map<String, dynamic> json) =>
_$$PortionCommentModelImplFromJson(json);
@override
final String comment;
@override
final int id;
@override
String toString() {
return 'PortionCommentModel(comment: $comment, id: $id)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PortionCommentModelImpl &&
(identical(other.comment, comment) || other.comment == comment) &&
(identical(other.id, id) || other.id == id));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, comment, id);
/// Create a copy of PortionCommentModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PortionCommentModelImplCopyWith<_$PortionCommentModelImpl> get copyWith =>
__$$PortionCommentModelImplCopyWithImpl<_$PortionCommentModelImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$PortionCommentModelImplToJson(
this,
);
}
}
abstract class _PortionCommentModel implements PortionCommentModel {
factory _PortionCommentModel(
{required final String comment,
required final int id}) = _$PortionCommentModelImpl;
factory _PortionCommentModel.fromJson(Map<String, dynamic> json) =
_$PortionCommentModelImpl.fromJson;
@override
String get comment;
@override
int get id;
/// Create a copy of PortionCommentModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PortionCommentModelImplCopyWith<_$PortionCommentModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
MealCommentModel _$MealCommentModelFromJson(Map<String, dynamic> json) {
return _MealCommentModel.fromJson(json);
}
/// @nodoc
mixin _$MealCommentModel {
String get comment => throw _privateConstructorUsedError;
@JsonKey(name: 'type_no')
int get typeNumber => throw _privateConstructorUsedError;
/// Serializes this MealCommentModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of MealCommentModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$MealCommentModelCopyWith<MealCommentModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $MealCommentModelCopyWith<$Res> {
factory $MealCommentModelCopyWith(
MealCommentModel value, $Res Function(MealCommentModel) then) =
_$MealCommentModelCopyWithImpl<$Res, MealCommentModel>;
@useResult
$Res call({String comment, @JsonKey(name: 'type_no') int typeNumber});
}
/// @nodoc
class _$MealCommentModelCopyWithImpl<$Res, $Val extends MealCommentModel>
implements $MealCommentModelCopyWith<$Res> {
_$MealCommentModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of MealCommentModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? comment = null,
Object? typeNumber = null,
}) {
return _then(_value.copyWith(
comment: null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String,
typeNumber: null == typeNumber
? _value.typeNumber
: typeNumber // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @nodoc
abstract class _$$MealCommentModelImplCopyWith<$Res>
implements $MealCommentModelCopyWith<$Res> {
factory _$$MealCommentModelImplCopyWith(_$MealCommentModelImpl value,
$Res Function(_$MealCommentModelImpl) then) =
__$$MealCommentModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String comment, @JsonKey(name: 'type_no') int typeNumber});
}
/// @nodoc
class __$$MealCommentModelImplCopyWithImpl<$Res>
extends _$MealCommentModelCopyWithImpl<$Res, _$MealCommentModelImpl>
implements _$$MealCommentModelImplCopyWith<$Res> {
__$$MealCommentModelImplCopyWithImpl(_$MealCommentModelImpl _value,
$Res Function(_$MealCommentModelImpl) _then)
: super(_value, _then);
/// Create a copy of MealCommentModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? comment = null,
Object? typeNumber = null,
}) {
return _then(_$MealCommentModelImpl(
comment: null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String,
typeNumber: null == typeNumber
? _value.typeNumber
: typeNumber // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
@JsonSerializable()
class _$MealCommentModelImpl implements _MealCommentModel {
_$MealCommentModelImpl(
{required this.comment,
@JsonKey(name: 'type_no') required this.typeNumber});
factory _$MealCommentModelImpl.fromJson(Map<String, dynamic> json) =>
_$$MealCommentModelImplFromJson(json);
@override
final String comment;
@override
@JsonKey(name: 'type_no')
final int typeNumber;
@override
String toString() {
return 'MealCommentModel(comment: $comment, typeNumber: $typeNumber)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$MealCommentModelImpl &&
(identical(other.comment, comment) || other.comment == comment) &&
(identical(other.typeNumber, typeNumber) ||
other.typeNumber == typeNumber));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, comment, typeNumber);
/// Create a copy of MealCommentModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$MealCommentModelImplCopyWith<_$MealCommentModelImpl> get copyWith =>
__$$MealCommentModelImplCopyWithImpl<_$MealCommentModelImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$MealCommentModelImplToJson(
this,
);
}
}
abstract class _MealCommentModel implements MealCommentModel {
factory _MealCommentModel(
{required final String comment,
@JsonKey(name: 'type_no') required final int typeNumber}) =
_$MealCommentModelImpl;
factory _MealCommentModel.fromJson(Map<String, dynamic> json) =
_$MealCommentModelImpl.fromJson;
@override
String get comment;
@override
@JsonKey(name: 'type_no')
int get typeNumber;
/// Create a copy of MealCommentModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$MealCommentModelImplCopyWith<_$MealCommentModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,59 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'consultant_comment_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$ConsultantCommentModelImpl _$$ConsultantCommentModelImplFromJson(
Map<String, dynamic> json) =>
_$ConsultantCommentModelImpl(
comment: json['comment'] as String?,
mealsComments: (json['meals'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(
k, MealCommentModel.fromJson(e as Map<String, dynamic>)),
) ??
const {},
portions: (json['portions'] as List<dynamic>?)
?.map((e) =>
PortionCommentModel.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
);
Map<String, dynamic> _$$ConsultantCommentModelImplToJson(
_$ConsultantCommentModelImpl instance) =>
<String, dynamic>{
'comment': instance.comment,
'meals': instance.mealsComments,
'portions': instance.portions,
};
_$PortionCommentModelImpl _$$PortionCommentModelImplFromJson(
Map<String, dynamic> json) =>
_$PortionCommentModelImpl(
comment: json['comment'] as String,
id: (json['id'] as num).toInt(),
);
Map<String, dynamic> _$$PortionCommentModelImplToJson(
_$PortionCommentModelImpl instance) =>
<String, dynamic>{
'comment': instance.comment,
'id': instance.id,
};
_$MealCommentModelImpl _$$MealCommentModelImplFromJson(
Map<String, dynamic> json) =>
_$MealCommentModelImpl(
comment: json['comment'] as String,
typeNumber: (json['type_no'] as num).toInt(),
);
Map<String, dynamic> _$$MealCommentModelImplToJson(
_$MealCommentModelImpl instance) =>
<String, dynamic>{
'comment': instance.comment,
'type_no': instance.typeNumber,
};

View File

@@ -1,796 +0,0 @@
// 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 'consultant_review_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');
ConsultantReviewModel _$ConsultantReviewModelFromJson(
Map<String, dynamic> json) {
return _ConsultantReviewModel.fromJson(json);
}
/// @nodoc
mixin _$ConsultantReviewModel {
String get planName => throw _privateConstructorUsedError;
int get planDuration => throw _privateConstructorUsedError;
int get currentPlanDay => throw _privateConstructorUsedError;
ConsultantComments get consultantComments =>
throw _privateConstructorUsedError;
/// Serializes this ConsultantReviewModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ConsultantReviewModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ConsultantReviewModelCopyWith<ConsultantReviewModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ConsultantReviewModelCopyWith<$Res> {
factory $ConsultantReviewModelCopyWith(ConsultantReviewModel value,
$Res Function(ConsultantReviewModel) then) =
_$ConsultantReviewModelCopyWithImpl<$Res, ConsultantReviewModel>;
@useResult
$Res call(
{String planName,
int planDuration,
int currentPlanDay,
ConsultantComments consultantComments});
$ConsultantCommentsCopyWith<$Res> get consultantComments;
}
/// @nodoc
class _$ConsultantReviewModelCopyWithImpl<$Res,
$Val extends ConsultantReviewModel>
implements $ConsultantReviewModelCopyWith<$Res> {
_$ConsultantReviewModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ConsultantReviewModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? planName = null,
Object? planDuration = null,
Object? currentPlanDay = null,
Object? consultantComments = null,
}) {
return _then(_value.copyWith(
planName: null == planName
? _value.planName
: planName // ignore: cast_nullable_to_non_nullable
as String,
planDuration: null == planDuration
? _value.planDuration
: planDuration // ignore: cast_nullable_to_non_nullable
as int,
currentPlanDay: null == currentPlanDay
? _value.currentPlanDay
: currentPlanDay // ignore: cast_nullable_to_non_nullable
as int,
consultantComments: null == consultantComments
? _value.consultantComments
: consultantComments // ignore: cast_nullable_to_non_nullable
as ConsultantComments,
) as $Val);
}
/// Create a copy of ConsultantReviewModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ConsultantCommentsCopyWith<$Res> get consultantComments {
return $ConsultantCommentsCopyWith<$Res>(_value.consultantComments,
(value) {
return _then(_value.copyWith(consultantComments: value) as $Val);
});
}
}
/// @nodoc
abstract class _$$ConsultantReviewModelImplCopyWith<$Res>
implements $ConsultantReviewModelCopyWith<$Res> {
factory _$$ConsultantReviewModelImplCopyWith(
_$ConsultantReviewModelImpl value,
$Res Function(_$ConsultantReviewModelImpl) then) =
__$$ConsultantReviewModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{String planName,
int planDuration,
int currentPlanDay,
ConsultantComments consultantComments});
@override
$ConsultantCommentsCopyWith<$Res> get consultantComments;
}
/// @nodoc
class __$$ConsultantReviewModelImplCopyWithImpl<$Res>
extends _$ConsultantReviewModelCopyWithImpl<$Res,
_$ConsultantReviewModelImpl>
implements _$$ConsultantReviewModelImplCopyWith<$Res> {
__$$ConsultantReviewModelImplCopyWithImpl(_$ConsultantReviewModelImpl _value,
$Res Function(_$ConsultantReviewModelImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultantReviewModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? planName = null,
Object? planDuration = null,
Object? currentPlanDay = null,
Object? consultantComments = null,
}) {
return _then(_$ConsultantReviewModelImpl(
planName: null == planName
? _value.planName
: planName // ignore: cast_nullable_to_non_nullable
as String,
planDuration: null == planDuration
? _value.planDuration
: planDuration // ignore: cast_nullable_to_non_nullable
as int,
currentPlanDay: null == currentPlanDay
? _value.currentPlanDay
: currentPlanDay // ignore: cast_nullable_to_non_nullable
as int,
consultantComments: null == consultantComments
? _value.consultantComments
: consultantComments // ignore: cast_nullable_to_non_nullable
as ConsultantComments,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ConsultantReviewModelImpl implements _ConsultantReviewModel {
_$ConsultantReviewModelImpl(
{required this.planName,
required this.planDuration,
required this.currentPlanDay,
required this.consultantComments});
factory _$ConsultantReviewModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ConsultantReviewModelImplFromJson(json);
@override
final String planName;
@override
final int planDuration;
@override
final int currentPlanDay;
@override
final ConsultantComments consultantComments;
@override
String toString() {
return 'ConsultantReviewModel(planName: $planName, planDuration: $planDuration, currentPlanDay: $currentPlanDay, consultantComments: $consultantComments)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ConsultantReviewModelImpl &&
(identical(other.planName, planName) ||
other.planName == planName) &&
(identical(other.planDuration, planDuration) ||
other.planDuration == planDuration) &&
(identical(other.currentPlanDay, currentPlanDay) ||
other.currentPlanDay == currentPlanDay) &&
(identical(other.consultantComments, consultantComments) ||
other.consultantComments == consultantComments));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, planName, planDuration, currentPlanDay, consultantComments);
/// Create a copy of ConsultantReviewModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ConsultantReviewModelImplCopyWith<_$ConsultantReviewModelImpl>
get copyWith => __$$ConsultantReviewModelImplCopyWithImpl<
_$ConsultantReviewModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ConsultantReviewModelImplToJson(
this,
);
}
}
abstract class _ConsultantReviewModel implements ConsultantReviewModel {
factory _ConsultantReviewModel(
{required final String planName,
required final int planDuration,
required final int currentPlanDay,
required final ConsultantComments consultantComments}) =
_$ConsultantReviewModelImpl;
factory _ConsultantReviewModel.fromJson(Map<String, dynamic> json) =
_$ConsultantReviewModelImpl.fromJson;
@override
String get planName;
@override
int get planDuration;
@override
int get currentPlanDay;
@override
ConsultantComments get consultantComments;
/// Create a copy of ConsultantReviewModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ConsultantReviewModelImplCopyWith<_$ConsultantReviewModelImpl>
get copyWith => throw _privateConstructorUsedError;
}
ConsultantComments _$ConsultantCommentsFromJson(Map<String, dynamic> json) {
return _ConsultantComments.fromJson(json);
}
/// @nodoc
mixin _$ConsultantComments {
String? get dayComment => throw _privateConstructorUsedError;
List<MealComment> get mealsComments => throw _privateConstructorUsedError;
List<PortionComment> get portionsComments =>
throw _privateConstructorUsedError;
/// Serializes this ConsultantComments to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ConsultantComments
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ConsultantCommentsCopyWith<ConsultantComments> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ConsultantCommentsCopyWith<$Res> {
factory $ConsultantCommentsCopyWith(
ConsultantComments value, $Res Function(ConsultantComments) then) =
_$ConsultantCommentsCopyWithImpl<$Res, ConsultantComments>;
@useResult
$Res call(
{String? dayComment,
List<MealComment> mealsComments,
List<PortionComment> portionsComments});
}
/// @nodoc
class _$ConsultantCommentsCopyWithImpl<$Res, $Val extends ConsultantComments>
implements $ConsultantCommentsCopyWith<$Res> {
_$ConsultantCommentsCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ConsultantComments
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? dayComment = freezed,
Object? mealsComments = null,
Object? portionsComments = null,
}) {
return _then(_value.copyWith(
dayComment: freezed == dayComment
? _value.dayComment
: dayComment // ignore: cast_nullable_to_non_nullable
as String?,
mealsComments: null == mealsComments
? _value.mealsComments
: mealsComments // ignore: cast_nullable_to_non_nullable
as List<MealComment>,
portionsComments: null == portionsComments
? _value.portionsComments
: portionsComments // ignore: cast_nullable_to_non_nullable
as List<PortionComment>,
) as $Val);
}
}
/// @nodoc
abstract class _$$ConsultantCommentsImplCopyWith<$Res>
implements $ConsultantCommentsCopyWith<$Res> {
factory _$$ConsultantCommentsImplCopyWith(_$ConsultantCommentsImpl value,
$Res Function(_$ConsultantCommentsImpl) then) =
__$$ConsultantCommentsImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{String? dayComment,
List<MealComment> mealsComments,
List<PortionComment> portionsComments});
}
/// @nodoc
class __$$ConsultantCommentsImplCopyWithImpl<$Res>
extends _$ConsultantCommentsCopyWithImpl<$Res, _$ConsultantCommentsImpl>
implements _$$ConsultantCommentsImplCopyWith<$Res> {
__$$ConsultantCommentsImplCopyWithImpl(_$ConsultantCommentsImpl _value,
$Res Function(_$ConsultantCommentsImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultantComments
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? dayComment = freezed,
Object? mealsComments = null,
Object? portionsComments = null,
}) {
return _then(_$ConsultantCommentsImpl(
dayComment: freezed == dayComment
? _value.dayComment
: dayComment // ignore: cast_nullable_to_non_nullable
as String?,
mealsComments: null == mealsComments
? _value._mealsComments
: mealsComments // ignore: cast_nullable_to_non_nullable
as List<MealComment>,
portionsComments: null == portionsComments
? _value._portionsComments
: portionsComments // ignore: cast_nullable_to_non_nullable
as List<PortionComment>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ConsultantCommentsImpl implements _ConsultantComments {
_$ConsultantCommentsImpl(
{required this.dayComment,
required final List<MealComment> mealsComments,
required final List<PortionComment> portionsComments})
: _mealsComments = mealsComments,
_portionsComments = portionsComments;
factory _$ConsultantCommentsImpl.fromJson(Map<String, dynamic> json) =>
_$$ConsultantCommentsImplFromJson(json);
@override
final String? dayComment;
final List<MealComment> _mealsComments;
@override
List<MealComment> get mealsComments {
if (_mealsComments is EqualUnmodifiableListView) return _mealsComments;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_mealsComments);
}
final List<PortionComment> _portionsComments;
@override
List<PortionComment> get portionsComments {
if (_portionsComments is EqualUnmodifiableListView)
return _portionsComments;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_portionsComments);
}
@override
String toString() {
return 'ConsultantComments(dayComment: $dayComment, mealsComments: $mealsComments, portionsComments: $portionsComments)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ConsultantCommentsImpl &&
(identical(other.dayComment, dayComment) ||
other.dayComment == dayComment) &&
const DeepCollectionEquality()
.equals(other._mealsComments, _mealsComments) &&
const DeepCollectionEquality()
.equals(other._portionsComments, _portionsComments));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
dayComment,
const DeepCollectionEquality().hash(_mealsComments),
const DeepCollectionEquality().hash(_portionsComments));
/// Create a copy of ConsultantComments
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ConsultantCommentsImplCopyWith<_$ConsultantCommentsImpl> get copyWith =>
__$$ConsultantCommentsImplCopyWithImpl<_$ConsultantCommentsImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ConsultantCommentsImplToJson(
this,
);
}
}
abstract class _ConsultantComments implements ConsultantComments {
factory _ConsultantComments(
{required final String? dayComment,
required final List<MealComment> mealsComments,
required final List<PortionComment> portionsComments}) =
_$ConsultantCommentsImpl;
factory _ConsultantComments.fromJson(Map<String, dynamic> json) =
_$ConsultantCommentsImpl.fromJson;
@override
String? get dayComment;
@override
List<MealComment> get mealsComments;
@override
List<PortionComment> get portionsComments;
/// Create a copy of ConsultantComments
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ConsultantCommentsImplCopyWith<_$ConsultantCommentsImpl> get copyWith =>
throw _privateConstructorUsedError;
}
MealComment _$MealCommentFromJson(Map<String, dynamic> json) {
return _MealComment.fromJson(json);
}
/// @nodoc
mixin _$MealComment {
String get comment => throw _privateConstructorUsedError;
/// Serializes this MealComment to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of MealComment
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$MealCommentCopyWith<MealComment> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $MealCommentCopyWith<$Res> {
factory $MealCommentCopyWith(
MealComment value, $Res Function(MealComment) then) =
_$MealCommentCopyWithImpl<$Res, MealComment>;
@useResult
$Res call({String comment});
}
/// @nodoc
class _$MealCommentCopyWithImpl<$Res, $Val extends MealComment>
implements $MealCommentCopyWith<$Res> {
_$MealCommentCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of MealComment
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? comment = null,
}) {
return _then(_value.copyWith(
comment: null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$MealCommentImplCopyWith<$Res>
implements $MealCommentCopyWith<$Res> {
factory _$$MealCommentImplCopyWith(
_$MealCommentImpl value, $Res Function(_$MealCommentImpl) then) =
__$$MealCommentImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String comment});
}
/// @nodoc
class __$$MealCommentImplCopyWithImpl<$Res>
extends _$MealCommentCopyWithImpl<$Res, _$MealCommentImpl>
implements _$$MealCommentImplCopyWith<$Res> {
__$$MealCommentImplCopyWithImpl(
_$MealCommentImpl _value, $Res Function(_$MealCommentImpl) _then)
: super(_value, _then);
/// Create a copy of MealComment
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? comment = null,
}) {
return _then(_$MealCommentImpl(
comment: null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _$MealCommentImpl implements _MealComment {
_$MealCommentImpl({required this.comment});
factory _$MealCommentImpl.fromJson(Map<String, dynamic> json) =>
_$$MealCommentImplFromJson(json);
@override
final String comment;
@override
String toString() {
return 'MealComment(comment: $comment)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$MealCommentImpl &&
(identical(other.comment, comment) || other.comment == comment));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, comment);
/// Create a copy of MealComment
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$MealCommentImplCopyWith<_$MealCommentImpl> get copyWith =>
__$$MealCommentImplCopyWithImpl<_$MealCommentImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$MealCommentImplToJson(
this,
);
}
}
abstract class _MealComment implements MealComment {
factory _MealComment({required final String comment}) = _$MealCommentImpl;
factory _MealComment.fromJson(Map<String, dynamic> json) =
_$MealCommentImpl.fromJson;
@override
String get comment;
/// Create a copy of MealComment
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$MealCommentImplCopyWith<_$MealCommentImpl> get copyWith =>
throw _privateConstructorUsedError;
}
PortionComment _$PortionCommentFromJson(Map<String, dynamic> json) {
return _PortionComment.fromJson(json);
}
/// @nodoc
mixin _$PortionComment {
@JsonKey(name: 'commentable_id')
int get portionId => throw _privateConstructorUsedError;
String get comment => throw _privateConstructorUsedError;
/// Serializes this PortionComment to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of PortionComment
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PortionCommentCopyWith<PortionComment> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PortionCommentCopyWith<$Res> {
factory $PortionCommentCopyWith(
PortionComment value, $Res Function(PortionComment) then) =
_$PortionCommentCopyWithImpl<$Res, PortionComment>;
@useResult
$Res call({@JsonKey(name: 'commentable_id') int portionId, String comment});
}
/// @nodoc
class _$PortionCommentCopyWithImpl<$Res, $Val extends PortionComment>
implements $PortionCommentCopyWith<$Res> {
_$PortionCommentCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PortionComment
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? portionId = null,
Object? comment = null,
}) {
return _then(_value.copyWith(
portionId: null == portionId
? _value.portionId
: portionId // ignore: cast_nullable_to_non_nullable
as int,
comment: null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$PortionCommentImplCopyWith<$Res>
implements $PortionCommentCopyWith<$Res> {
factory _$$PortionCommentImplCopyWith(_$PortionCommentImpl value,
$Res Function(_$PortionCommentImpl) then) =
__$$PortionCommentImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({@JsonKey(name: 'commentable_id') int portionId, String comment});
}
/// @nodoc
class __$$PortionCommentImplCopyWithImpl<$Res>
extends _$PortionCommentCopyWithImpl<$Res, _$PortionCommentImpl>
implements _$$PortionCommentImplCopyWith<$Res> {
__$$PortionCommentImplCopyWithImpl(
_$PortionCommentImpl _value, $Res Function(_$PortionCommentImpl) _then)
: super(_value, _then);
/// Create a copy of PortionComment
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? portionId = null,
Object? comment = null,
}) {
return _then(_$PortionCommentImpl(
portionId: null == portionId
? _value.portionId
: portionId // ignore: cast_nullable_to_non_nullable
as int,
comment: null == comment
? _value.comment
: comment // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _$PortionCommentImpl implements _PortionComment {
_$PortionCommentImpl(
{@JsonKey(name: 'commentable_id') required this.portionId,
required this.comment});
factory _$PortionCommentImpl.fromJson(Map<String, dynamic> json) =>
_$$PortionCommentImplFromJson(json);
@override
@JsonKey(name: 'commentable_id')
final int portionId;
@override
final String comment;
@override
String toString() {
return 'PortionComment(portionId: $portionId, comment: $comment)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PortionCommentImpl &&
(identical(other.portionId, portionId) ||
other.portionId == portionId) &&
(identical(other.comment, comment) || other.comment == comment));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, portionId, comment);
/// Create a copy of PortionComment
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PortionCommentImplCopyWith<_$PortionCommentImpl> get copyWith =>
__$$PortionCommentImplCopyWithImpl<_$PortionCommentImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$PortionCommentImplToJson(
this,
);
}
}
abstract class _PortionComment implements PortionComment {
factory _PortionComment(
{@JsonKey(name: 'commentable_id') required final int portionId,
required final String comment}) = _$PortionCommentImpl;
factory _PortionComment.fromJson(Map<String, dynamic> json) =
_$PortionCommentImpl.fromJson;
@override
@JsonKey(name: 'commentable_id')
int get portionId;
@override
String get comment;
/// Create a copy of PortionComment
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PortionCommentImplCopyWith<_$PortionCommentImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,69 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'consultant_review_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$ConsultantReviewModelImpl _$$ConsultantReviewModelImplFromJson(
Map<String, dynamic> json) =>
_$ConsultantReviewModelImpl(
planName: json['planName'] as String,
planDuration: (json['planDuration'] as num).toInt(),
currentPlanDay: (json['currentPlanDay'] as num).toInt(),
consultantComments: ConsultantComments.fromJson(
json['consultantComments'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$ConsultantReviewModelImplToJson(
_$ConsultantReviewModelImpl instance) =>
<String, dynamic>{
'planName': instance.planName,
'planDuration': instance.planDuration,
'currentPlanDay': instance.currentPlanDay,
'consultantComments': instance.consultantComments,
};
_$ConsultantCommentsImpl _$$ConsultantCommentsImplFromJson(
Map<String, dynamic> json) =>
_$ConsultantCommentsImpl(
dayComment: json['dayComment'] as String?,
mealsComments: (json['mealsComments'] as List<dynamic>)
.map((e) => MealComment.fromJson(e as Map<String, dynamic>))
.toList(),
portionsComments: (json['portionsComments'] as List<dynamic>)
.map((e) => PortionComment.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$ConsultantCommentsImplToJson(
_$ConsultantCommentsImpl instance) =>
<String, dynamic>{
'dayComment': instance.dayComment,
'mealsComments': instance.mealsComments,
'portionsComments': instance.portionsComments,
};
_$MealCommentImpl _$$MealCommentImplFromJson(Map<String, dynamic> json) =>
_$MealCommentImpl(
comment: json['comment'] as String,
);
Map<String, dynamic> _$$MealCommentImplToJson(_$MealCommentImpl instance) =>
<String, dynamic>{
'comment': instance.comment,
};
_$PortionCommentImpl _$$PortionCommentImplFromJson(Map<String, dynamic> json) =>
_$PortionCommentImpl(
portionId: (json['commentable_id'] as num).toInt(),
comment: json['comment'] as String,
);
Map<String, dynamic> _$$PortionCommentImplToJson(
_$PortionCommentImpl instance) =>
<String, dynamic>{
'commentable_id': instance.portionId,
'comment': instance.comment,
};

View File

@@ -1,190 +0,0 @@
// 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 'consultant_comments_state.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 _$ConsultantCommentsState {
ConsultantCommentModel get commentsModel =>
throw _privateConstructorUsedError;
bool get dayCommentNeedsToBeFilled => throw _privateConstructorUsedError;
/// Create a copy of ConsultantCommentsState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ConsultantCommentsStateCopyWith<ConsultantCommentsState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ConsultantCommentsStateCopyWith<$Res> {
factory $ConsultantCommentsStateCopyWith(ConsultantCommentsState value,
$Res Function(ConsultantCommentsState) then) =
_$ConsultantCommentsStateCopyWithImpl<$Res, ConsultantCommentsState>;
@useResult
$Res call(
{ConsultantCommentModel commentsModel, bool dayCommentNeedsToBeFilled});
$ConsultantCommentModelCopyWith<$Res> get commentsModel;
}
/// @nodoc
class _$ConsultantCommentsStateCopyWithImpl<$Res,
$Val extends ConsultantCommentsState>
implements $ConsultantCommentsStateCopyWith<$Res> {
_$ConsultantCommentsStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ConsultantCommentsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? commentsModel = null,
Object? dayCommentNeedsToBeFilled = null,
}) {
return _then(_value.copyWith(
commentsModel: null == commentsModel
? _value.commentsModel
: commentsModel // ignore: cast_nullable_to_non_nullable
as ConsultantCommentModel,
dayCommentNeedsToBeFilled: null == dayCommentNeedsToBeFilled
? _value.dayCommentNeedsToBeFilled
: dayCommentNeedsToBeFilled // ignore: cast_nullable_to_non_nullable
as bool,
) as $Val);
}
/// Create a copy of ConsultantCommentsState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ConsultantCommentModelCopyWith<$Res> get commentsModel {
return $ConsultantCommentModelCopyWith<$Res>(_value.commentsModel, (value) {
return _then(_value.copyWith(commentsModel: value) as $Val);
});
}
}
/// @nodoc
abstract class _$$ConsultantCommentsStateImplCopyWith<$Res>
implements $ConsultantCommentsStateCopyWith<$Res> {
factory _$$ConsultantCommentsStateImplCopyWith(
_$ConsultantCommentsStateImpl value,
$Res Function(_$ConsultantCommentsStateImpl) then) =
__$$ConsultantCommentsStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{ConsultantCommentModel commentsModel, bool dayCommentNeedsToBeFilled});
@override
$ConsultantCommentModelCopyWith<$Res> get commentsModel;
}
/// @nodoc
class __$$ConsultantCommentsStateImplCopyWithImpl<$Res>
extends _$ConsultantCommentsStateCopyWithImpl<$Res,
_$ConsultantCommentsStateImpl>
implements _$$ConsultantCommentsStateImplCopyWith<$Res> {
__$$ConsultantCommentsStateImplCopyWithImpl(
_$ConsultantCommentsStateImpl _value,
$Res Function(_$ConsultantCommentsStateImpl) _then)
: super(_value, _then);
/// Create a copy of ConsultantCommentsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? commentsModel = null,
Object? dayCommentNeedsToBeFilled = null,
}) {
return _then(_$ConsultantCommentsStateImpl(
commentsModel: null == commentsModel
? _value.commentsModel
: commentsModel // ignore: cast_nullable_to_non_nullable
as ConsultantCommentModel,
dayCommentNeedsToBeFilled: null == dayCommentNeedsToBeFilled
? _value.dayCommentNeedsToBeFilled
: dayCommentNeedsToBeFilled // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
class _$ConsultantCommentsStateImpl implements _ConsultantCommentsState {
_$ConsultantCommentsStateImpl(
{required this.commentsModel, this.dayCommentNeedsToBeFilled = false});
@override
final ConsultantCommentModel commentsModel;
@override
@JsonKey()
final bool dayCommentNeedsToBeFilled;
@override
String toString() {
return 'ConsultantCommentsState(commentsModel: $commentsModel, dayCommentNeedsToBeFilled: $dayCommentNeedsToBeFilled)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ConsultantCommentsStateImpl &&
(identical(other.commentsModel, commentsModel) ||
other.commentsModel == commentsModel) &&
(identical(other.dayCommentNeedsToBeFilled,
dayCommentNeedsToBeFilled) ||
other.dayCommentNeedsToBeFilled == dayCommentNeedsToBeFilled));
}
@override
int get hashCode =>
Object.hash(runtimeType, commentsModel, dayCommentNeedsToBeFilled);
/// Create a copy of ConsultantCommentsState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ConsultantCommentsStateImplCopyWith<_$ConsultantCommentsStateImpl>
get copyWith => __$$ConsultantCommentsStateImplCopyWithImpl<
_$ConsultantCommentsStateImpl>(this, _$identity);
}
abstract class _ConsultantCommentsState implements ConsultantCommentsState {
factory _ConsultantCommentsState(
{required final ConsultantCommentModel commentsModel,
final bool dayCommentNeedsToBeFilled}) = _$ConsultantCommentsStateImpl;
@override
ConsultantCommentModel get commentsModel;
@override
bool get dayCommentNeedsToBeFilled;
/// Create a copy of ConsultantCommentsState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ConsultantCommentsStateImplCopyWith<_$ConsultantCommentsStateImpl>
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -12,75 +12,78 @@ class AuthorCard extends StatelessWidget {
final String title;
final Color? backgroundColor;
final TextStyle? titleStyle;
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.sizeOf(context).width,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: backgroundColor ?? appTheme.cardBackground),
child: Stack(
children: [
Padding(
padding: const EdgeInsets.only(left: 16, top: 16, bottom: 24),
child: Column(
children: [
ListTile(
contentPadding: EdgeInsets.zero,
leading: Container(
width: 64,
height: 64,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(author.authorProfileIcon),
fit: BoxFit.cover,
return GestureDetector(
onTap: () {
GoRouter.of(context).pushNamed('profileScreen', extra: author);
},
child: Container(
width: MediaQuery.sizeOf(context).width,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: backgroundColor ?? appTheme.cardBackground),
child: Stack(
children: [
Padding(
padding: const EdgeInsets.only(left: 16, top: 16, bottom: 24),
child: Column(
children: [
ListTile(
contentPadding: EdgeInsets.zero,
leading: Container(
width: 64,
height: 64,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(author.authorProfileIcon),
fit: BoxFit.cover,
),
),
),
),
subtitle: Text(
author.authorName,
style: TextStyles.textLSemibold.copyWith(
color: appTheme.black,
),
),
title: Text(
title,
style: titleStyle ?? TextStyles.textSSemibold.copyWith(
color: appTheme.gray,
),
),
),
Row(
children: [
Text(
'Консультант',
style: TextStyles.textMMedium.copyWith(
subtitle: Text(
author.authorName,
style: TextStyles.textLSemibold.copyWith(
color: appTheme.black,
),
),
const SizedBox(width: 10),
if (author.authorPlaceInRating != null)
InfoBouble(
radius: 12,
backgroundColor: appTheme.whiteA700,
children: [
Text(
'${author.authorPlaceInRating}-й в рейтинге',
style: TextStyles.textMMediumAuto.copyWith(
color: appTheme.blueA400,
),
),
],
title: Text(
title,
style: titleStyle ?? TextStyles.textSSemibold.copyWith(
color: appTheme.gray,
),
],
),
],
),
),
Row(
children: [
Text(
'Консультант',
style: TextStyles.textMMedium.copyWith(
color: appTheme.black,
),
),
const SizedBox(width: 10),
if (author.authorPlaceInRating != null)
InfoBouble(
radius: 12,
backgroundColor: appTheme.whiteA700,
children: [
Text(
'${author.authorPlaceInRating}-й в рейтинге',
style: TextStyles.textMMediumAuto.copyWith(
color: appTheme.blueA400,
),
),
],
),
],
),
],
),
),
),
Positioned(
right: 8,
top: 8,
child: GestureDetector(
onTap: () => GoRouter.of(context).pushNamed('profileScreen', extra: author),
Positioned(
right: 8,
top: 8,
child: Container(
width: 28,
height: 28,
@@ -98,8 +101,8 @@ class AuthorCard extends StatelessWidget {
),
),
),
),
],
],
),
),
);
}

View File

@@ -81,6 +81,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
foregroundImage: NetworkImage(
state.feedBlogPostList[widget.index].author.authorProfileIcon,
),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
),
const SizedBox(width: 8),
Column(

View File

@@ -42,6 +42,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
),
const SizedBox(height: 8),
],
const SizedBox(height: 48),
],
);
}
@@ -60,6 +61,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
children: [
CircleAvatar(
foregroundImage: NetworkImage(comment.authorProfileIcon),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
radius: radius,
),
const SizedBox(width: 8),

View File

@@ -64,6 +64,7 @@ class ConsultantWidget extends StatelessWidget {
const SizedBox(width: 8),
CircleAvatar(
foregroundImage: NetworkImage(consultant.photo),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
),
const SizedBox(width: 8),
Column(
@@ -80,7 +81,7 @@ class ConsultantWidget extends StatelessWidget {
),
const SizedBox(height: 4),
Text(
'Рейтинг: RATING',
'Рейтинг: ${consultant.totalScores}',
style: TextStyle(
color: appTheme.blueA400,
height: 1,
@@ -105,7 +106,10 @@ class ConsultantWidget extends StatelessWidget {
],
),
const SizedBox(height: 8),
const Text('description'),
Text(
consultant.description,
maxLines: 2,
),
if (consultant.badges.isNotEmpty) const SizedBox(height: 8),
_badges(consultant.badges, context),
],

View File

@@ -153,6 +153,19 @@ class _DietsWidgetState extends State<DietsWidget> {
),
),
],
if (widget.diet.details.length > 200)
const Padding(
padding: EdgeInsets.only(left: 16, top: 8),
child: Text(
'Показать ещё',
style: TextStyle(
height: 1,
color: Color(0xFF8B8B8B),
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
],
),
Padding(

View File

@@ -156,6 +156,19 @@ class _PlanWidgetState extends State<PlanWidget> {
},
),
),
if (widget.plan.details.length > 200)
const Padding(
padding: EdgeInsets.only(left: 16, top: 8),
child: Text(
'Показать ещё',
style: TextStyle(
height: 1,
color: Color(0xFF8B8B8B),
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
],
],
),

View File

@@ -187,7 +187,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
),
if (widget.recipe.description.length > 200)
const Padding(
padding: EdgeInsets.symmetric(horizontal: 12),
padding: EdgeInsets.only(left: 16, top: 8),
child: Text(
'Показать ещё',
style: TextStyle(

View File

@@ -1,6 +1,7 @@
enum ConsultationStatus {
completed,
canceled,
inProgress
}
class ConsultantFinanceEntity {

View File

@@ -3,9 +3,12 @@ import 'package:eatvio_app/core/theme/custom_text_style.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/core/widgets/custom_drop_down_button.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart';
import 'package:eatvio_app/features/my_finance/entities/consultant_finance_entity.dart';
import 'package:eatvio_app/features/my_finance/presentation/pages/card_settings.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
class UserFinanceScreen extends StatefulWidget {
@@ -20,162 +23,179 @@ class _UserFinanceScreenState extends State<UserFinanceScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFF0F2F5),
appBar: AppBar(
shape: const RoundedRectangleBorder(borderRadius: BorderRadiusDirectional.vertical(bottom: Radius.circular(12))),
title: const Text('Финансы'),
centerTitle: true,
),
body: SingleChildScrollView(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Column(
children: [
const SizedBox(height: 8),
InkWell(
onTap: () {
GoRouter.of(context).pushNamed(CardSettingsScreen.name);
},
borderRadius: BorderRadius.circular(20),
child: Ink(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), color: appTheme.blueA400),
width: MediaQuery.of(context).size.width - 32,
child: const Center(
child: Padding(
padding: EdgeInsets.all(16),
child: Text('Управление картами', style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w600)),
),
),
),
return BlocBuilder<ProfileAvatarCubit, ProfileAvatarState>(
builder: (BuildContext context, ProfileAvatarState state) {
if (state is ProfileAvatarStateLoaded) {
return Scaffold(
backgroundColor: const Color(0xFFF0F2F5),
appBar: AppBar(
shape: const RoundedRectangleBorder(borderRadius: BorderRadiusDirectional.vertical(bottom: Radius.circular(12))),
title: const Text('Финансы'),
centerTitle: true,
),
const SizedBox(height: 16),
Material(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
child: Padding(
padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
child: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: Column(
children: [
CustomDropDownButton(
items: periods
.mapIndexed(
(index, value) => DropdownMenuItem(
value: periods[index],
child: Text(
periods[index],
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
),
)
.toList(),
onChanged: (value) {},
value: periods.first,
),
const SizedBox(height: 12),
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => Material(
color: const Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(20),
body: SingleChildScrollView(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Column(
children: [
if (state.profile.roles.contains('consultant')) ...[
const SizedBox(height: 8),
InkWell(
onTap: () {
GoRouter.of(context).pushNamed(CardSettingsScreen.name);
},
borderRadius: BorderRadius.circular(20),
child: Ink(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), color: appTheme.blueA400),
width: MediaQuery.of(context).size.width - 32,
child: const Center(
child: Padding(
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Tooltip(
message: testFinanceEntity.consultationsList[index].id,
triggerMode: TooltipTriggerMode.tap,
textStyle: const TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.w500,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha((255 * 0.2).toInt()),
blurRadius: 32,
)
],
),
child: Text(
testFinanceEntity.consultationsList[index].id,
style: const TextStyle(color: Color(0xFF323F4B), height: 1, fontWeight: FontWeight.w500),
),
),
Text(
testFinanceEntity.consultationsList[index].date.format('dd.MM.yyy', 'RU'),
style: const TextStyle(color: Color(0xFF6D6F71), height: 1, fontWeight: FontWeight.w500),
),
],
),
const SizedBox(height: 8),
Text(
testFinanceEntity.consultationsList[index].title,
style: TextStyle(color: appTheme.blueA400, height: 1, fontSize: 18, fontWeight: FontWeight.w600),
),
const SizedBox(height: 8),
Text(
'Покупатель: ${testFinanceEntity.consultationsList[index].clientName}',
style: const TextStyle(color: Color(0xFF323F4B), height: 1, fontSize: 14, fontWeight: FontWeight.w500),
),
const SizedBox(height: 8),
Text(
'${testFinanceEntity.consultationsList[index].planDuration} дней',
style: const TextStyle(color: Color(0xFF323F4B), height: 1, fontSize: 14, fontWeight: FontWeight.w500),
),
const SizedBox(height: 8),
Container(
height: 1,
width: double.infinity,
decoration: const BoxDecoration(
color: Color(0xFFDEDEDF),
),
),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'${testFinanceEntity.consultationsList[index].price} ₽',
style: const TextStyle(color: Color(0xFF323F4B), height: 1, fontSize: 18, fontWeight: FontWeight.w600),
),
Material(
color: const Color(0xFF0BB450).withAlpha(11),
borderRadius: BorderRadius.circular(8),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
child: Text(
testFinanceEntity.consultationsList[index].status.name,
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xFF0BB450), height: 1),
),
),
),
],
),
],
),
padding: EdgeInsets.all(16),
child: Text('Управление картами', style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w600)),
),
),
separatorBuilder: (context, index) => const SizedBox(height: 12),
itemCount: testFinanceEntity.consultationsList.length,
),
],
),
const SizedBox(height: 16),
],
Material(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
child: Padding(
padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
child: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: Column(
children: [
CustomDropDownButton(
items: periods
.mapIndexed(
(index, value) => DropdownMenuItem(
value: periods[index],
child: Text(
periods[index],
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
),
)
.toList(),
onChanged: (value) {},
value: periods.first,
),
const SizedBox(height: 12),
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => Material(
color: const Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(20),
child: Padding(
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Tooltip(
message: testFinanceEntity.consultationsList[index].id,
triggerMode: TooltipTriggerMode.tap,
textStyle: const TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.w500,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha((255 * 0.2).toInt()),
blurRadius: 32,
)
],
),
child: Text(
testFinanceEntity.consultationsList[index].id,
style: const TextStyle(color: Color(0xFF323F4B), height: 1, fontWeight: FontWeight.w500),
),
),
Text(
testFinanceEntity.consultationsList[index].date.format('dd.MM.yyy', 'RU'),
style: const TextStyle(color: Color(0xFF6D6F71), height: 1, fontWeight: FontWeight.w500),
),
],
),
const SizedBox(height: 8),
Text(
testFinanceEntity.consultationsList[index].title,
style: TextStyle(color: appTheme.blueA400, height: 1, fontSize: 18, fontWeight: FontWeight.w600),
),
const SizedBox(height: 8),
Text(
'Покупатель: ${testFinanceEntity.consultationsList[index].clientName}',
style: const TextStyle(color: Color(0xFF323F4B), height: 1, fontSize: 14, fontWeight: FontWeight.w500),
),
const SizedBox(height: 8),
Text(
'${testFinanceEntity.consultationsList[index].planDuration} дней',
style: const TextStyle(color: Color(0xFF323F4B), height: 1, fontSize: 14, fontWeight: FontWeight.w500),
),
const SizedBox(height: 8),
Container(
height: 1,
width: double.infinity,
decoration: const BoxDecoration(
color: Color(0xFFDEDEDF),
),
),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'${testFinanceEntity.consultationsList[index].price} ₽',
style: const TextStyle(color: Color(0xFF323F4B), height: 1, fontSize: 18, fontWeight: FontWeight.w600),
),
Material(
color: testFinanceEntity.consultationsList[index].status == ConsultationStatus.canceled
? const Color(0xFDD01717).withAlpha((255 * 0.1).toInt())
: const Color(0xFF0BB450).withAlpha(11),
borderRadius: BorderRadius.circular(8),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
child: Text(
testFinanceEntity.consultationsList[index].status.name,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: testFinanceEntity.consultationsList[index].status == ConsultationStatus.canceled
? const Color(0xFDD01717)
: const Color(0xFF0BB450),
height: 1),
),
),
),
],
),
],
),
),
),
separatorBuilder: (context, index) => const SizedBox(height: 12),
itemCount: testFinanceEntity.consultationsList.length,
),
],
),
),
),
),
),
],
),
),
],
),
),
);
}
return Container();
},
);
}
}

View File

@@ -1,166 +0,0 @@
// 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 'notification_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');
NotificationModel _$NotificationModelFromJson(Map<String, dynamic> json) {
return _NotificationModel.fromJson(json);
}
/// @nodoc
mixin _$NotificationModel {
NotificationType get type => throw _privateConstructorUsedError;
/// Serializes this NotificationModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of NotificationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$NotificationModelCopyWith<NotificationModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $NotificationModelCopyWith<$Res> {
factory $NotificationModelCopyWith(
NotificationModel value, $Res Function(NotificationModel) then) =
_$NotificationModelCopyWithImpl<$Res, NotificationModel>;
@useResult
$Res call({NotificationType type});
}
/// @nodoc
class _$NotificationModelCopyWithImpl<$Res, $Val extends NotificationModel>
implements $NotificationModelCopyWith<$Res> {
_$NotificationModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of NotificationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? type = null,
}) {
return _then(_value.copyWith(
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as NotificationType,
) as $Val);
}
}
/// @nodoc
abstract class _$$NotificationModelImplCopyWith<$Res>
implements $NotificationModelCopyWith<$Res> {
factory _$$NotificationModelImplCopyWith(_$NotificationModelImpl value,
$Res Function(_$NotificationModelImpl) then) =
__$$NotificationModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({NotificationType type});
}
/// @nodoc
class __$$NotificationModelImplCopyWithImpl<$Res>
extends _$NotificationModelCopyWithImpl<$Res, _$NotificationModelImpl>
implements _$$NotificationModelImplCopyWith<$Res> {
__$$NotificationModelImplCopyWithImpl(_$NotificationModelImpl _value,
$Res Function(_$NotificationModelImpl) _then)
: super(_value, _then);
/// Create a copy of NotificationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? type = null,
}) {
return _then(_$NotificationModelImpl(
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as NotificationType,
));
}
}
/// @nodoc
@JsonSerializable()
class _$NotificationModelImpl implements _NotificationModel {
_$NotificationModelImpl({required this.type});
factory _$NotificationModelImpl.fromJson(Map<String, dynamic> json) =>
_$$NotificationModelImplFromJson(json);
@override
final NotificationType type;
@override
String toString() {
return 'NotificationModel(type: $type)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$NotificationModelImpl &&
(identical(other.type, type) || other.type == type));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, type);
/// Create a copy of NotificationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$NotificationModelImplCopyWith<_$NotificationModelImpl> get copyWith =>
__$$NotificationModelImplCopyWithImpl<_$NotificationModelImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$NotificationModelImplToJson(
this,
);
}
}
abstract class _NotificationModel implements NotificationModel {
factory _NotificationModel({required final NotificationType type}) =
_$NotificationModelImpl;
factory _NotificationModel.fromJson(Map<String, dynamic> json) =
_$NotificationModelImpl.fromJson;
@override
NotificationType get type;
/// Create a copy of NotificationModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$NotificationModelImplCopyWith<_$NotificationModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,28 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'notification_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$NotificationModelImpl _$$NotificationModelImplFromJson(
Map<String, dynamic> json) =>
_$NotificationModelImpl(
type: $enumDecode(_$NotificationTypeEnumMap, json['type']),
);
Map<String, dynamic> _$$NotificationModelImplToJson(
_$NotificationModelImpl instance) =>
<String, dynamic>{
'type': _$NotificationTypeEnumMap[instance.type]!,
};
const _$NotificationTypeEnumMap = {
NotificationType.userSubscribedNotification:
'App\\Notifications\\UserSubscribedNotification',
NotificationType.planSubscriptionStartedToAuthor:
'App\\Notifications\\Plan\\PlanSubscriptionStartedToAuthor',
NotificationType.planSubscriptionCanceledToAuthor:
'App\\Notifications\\Plan\\PlanSubscriptionCanceledToAuthor',
};

View File

@@ -19,18 +19,14 @@ class SubPaginationModel with _$SubPaginationModel {
@freezed
class SubModel with _$SubModel {
const factory SubModel({
required int id,
required String slug,
required String name,
required String city,
required DateTime birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me') required bool isEntitySubscribedByMe,
required String email,
@JsonKey(name: 'profile_photo_url') required String profilePhotoUrl,
required String role,
required List<String> roles,
@JsonKey(name: 'is_public_profile') required bool isPublicProfile,
@JsonKey(name: 'created_at') required DateTime createdAt,
@JsonKey(name: 'updated_at') required DateTime updatedAt,
}) = _SubModel;
factory SubModel.fromJson(Map<String, Object?> json) => _$SubModelFromJson(json);

View File

@@ -658,15 +658,53 @@ class _ProfileScreenState extends State<ProfileScreen> {
children: [
for (int i = 0; i < state.profile.badges.length; i++) ...[
state.profile.badges[i].image.contains('svg')
? SvgPicture.network(
'$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
? Tooltip(
message: state.profile.badges[i].description,
triggerMode: TooltipTriggerMode.tap,
textStyle: const TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.w500,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha((255 * 0.2).toInt()),
blurRadius: 32,
)
],
),
child: SvgPicture.network(
'$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
),
)
: CachedNetworkImage(
imageUrl: '$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
: Tooltip(
message: state.profile.badges[i].description,
triggerMode: TooltipTriggerMode.tap,
textStyle: const TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.w500,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha((255 * 0.2).toInt()),
blurRadius: 32,
)
],
),
child: CachedNetworkImage(
imageUrl: '$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
),
),
i < state.profile.badges.length - 1 ? const SizedBox(width: 8) : const SizedBox.shrink(),
],
@@ -799,9 +837,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
widthFactor: 0.8,
child: CircleAvatar(
radius: 14,
backgroundImage: NetworkImage(
foregroundImage: NetworkImage(
urls[i],
),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
),
),
],

View File

@@ -68,6 +68,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
foregroundImage: NetworkImage(
state.blogPosts[widget.index].author.authorProfileIcon,
),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
),
const SizedBox(width: 8),
Column(

View File

@@ -35,7 +35,8 @@ class _SubWidgetState extends State<SubWidget> {
child: Row(
children: [
CircleAvatar(
backgroundImage: NetworkImage(widget.subModel.profilePhotoUrl),
foregroundImage: NetworkImage(widget.subModel.profilePhotoUrl),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
radius: 28,
),
const SizedBox(width: 12),

View File

@@ -1,4 +1,7 @@
import 'package:eatvio_app/core/utils/toasts.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:url_launcher/url_launcher.dart';
@@ -7,6 +10,8 @@ class SupportScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final s = S.of(context);
return Scaffold(
appBar: AppBar(
title: const Text('Поддержка'),
@@ -44,7 +49,7 @@ class SupportScreen extends StatelessWidget {
),
const SizedBox(width: 12),
const Text(
'Telegram',
'Telegram: t.me/eatvio',
style: TextStyle(
fontSize: 16,
),
@@ -56,10 +61,8 @@ class SupportScreen extends StatelessWidget {
const SizedBox(height: 8),
InkWell(
onTap: () {
launchUrl(
Uri.parse('mailto:help@eatv.io'),
mode: LaunchMode.externalApplication,
);
Clipboard.setData(const ClipboardData(text: 'help@eatv.io'));
showInfoToast(s.mail_was_copied);
},
borderRadius: BorderRadius.circular(16),
child: Ink(
@@ -73,7 +76,7 @@ class SupportScreen extends StatelessWidget {
Icon(Icons.alternate_email_rounded),
SizedBox(width: 12),
Text(
'E-mail',
'E-mail: help@eatv.io',
style: TextStyle(
fontSize: 16,
),

View File

@@ -371,6 +371,9 @@ class MessageLookup extends MessageLookupByLibrary {
),
"loading": MessageLookupByLibrary.simpleMessage("Загрузка..."),
"lower": MessageLookupByLibrary.simpleMessage("Нижнее"),
"mail_was_copied": MessageLookupByLibrary.simpleMessage(
"Почта успешно скопирована",
),
"male": MessageLookupByLibrary.simpleMessage("Мужской"),
"meal": MessageLookupByLibrary.simpleMessage("Приём пищи"),
"mealComment": MessageLookupByLibrary.simpleMessage(

View File

@@ -209,6 +209,9 @@ class MessageLookup extends MessageLookupByLibrary {
"Ссылка успешно скопирована",
),
"loading": MessageLookupByLibrary.simpleMessage("Загрузка..."),
"mail_was_copied": MessageLookupByLibrary.simpleMessage(
"Почта успешно скопирована",
),
"male": MessageLookupByLibrary.simpleMessage("Мужской"),
"meal": MessageLookupByLibrary.simpleMessage("Приём пищи"),
"meat": MessageLookupByLibrary.simpleMessage("Мясо"),

View File

@@ -1055,6 +1055,16 @@ class S {
);
}
/// `Почта успешно скопирована`
String get mail_was_copied {
return Intl.message(
'Почта успешно скопирована',
name: 'mail_was_copied',
desc: '',
args: [],
);
}
/// `Выберите дату старты диеты. Она отобразиться у Вас в дневнике`
String get choose_start_diet_date {
return Intl.message(

View File

@@ -129,6 +129,7 @@
"carbohydrates": "Углеводы",
"answer": "Ответить",
"link_was_copied": "Ссылка успешно скопирована",
"mail_was_copied": "Почта успешно скопирована",
"choose_start_diet_date": "Выберите дату старты диеты. Она отобразиться у Вас в дневнике",
"continue_": "Продолжить",
"order": "Порядок",

View File

@@ -129,6 +129,7 @@
"carbohydrates": "Углеводы",
"answer": "Ответить",
"link_was_copied": "Ссылка успешно скопирована",
"mail_was_copied": "Почта успешно скопирована",
"choose_start_diet_date": "Выберите дату старты диеты. Она отобразиться у Вас в дневнике",
"continue_": "Продолжить",
"order": "Порядок",