feat(order info): added order info screen

This commit is contained in:
Username1548
2025-04-04 20:21:31 +07:00
parent 9715f4cac9
commit 748484cf8f
387 changed files with 16171 additions and 18199 deletions

View File

@@ -53,7 +53,7 @@ class CreateDietCubit extends Cubit<CreateDietState> {
name: diet.name,
duration: diet.duration,
type: type,
imageUrl: baseUrl + '/storage/' + diet.image,
imageUrl: '$baseUrl/storage/${diet.image}',
),
);
emit(state.copyWith(dietStateIndex: dietStateIndex, durationIndex: durationValues.indexOf(diet.duration)));

View File

@@ -12,8 +12,7 @@ part of 'create_diet_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'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 _$CreateDietState {
@@ -45,28 +44,26 @@ mixin _$CreateDietState {
/// @nodoc
abstract class $CreateDietStateCopyWith<$Res> {
factory $CreateDietStateCopyWith(
CreateDietState value,
$Res Function(CreateDietState) then,
) = _$CreateDietStateCopyWithImpl<$Res, CreateDietState>;
CreateDietState value, $Res Function(CreateDietState) then) =
_$CreateDietStateCopyWithImpl<$Res, CreateDietState>;
@useResult
$Res call({
bool isLoading,
bool isDietPublishing,
String? errorMessage,
CreateDietModel dietData,
List<List<DailySchedule>>? copiedDay,
String? dietNameError,
String? dietDescriptionError,
String? dietDurationError,
String? dietStateError,
String? dietImageError,
List<String> dailyScheduleErrors,
int? durationIndex,
int? dietStateIndex,
bool published,
bool drafted,
bool isDietBeingEdited,
});
$Res call(
{bool isLoading,
bool isDietPublishing,
String? errorMessage,
CreateDietModel dietData,
List<List<DailySchedule>>? copiedDay,
String? dietNameError,
String? dietDescriptionError,
String? dietDurationError,
String? dietStateError,
String? dietImageError,
List<String> dailyScheduleErrors,
int? durationIndex,
int? dietStateIndex,
bool published,
bool drafted,
bool isDietBeingEdited});
$CreateDietModelCopyWith<$Res> get dietData;
}
@@ -103,91 +100,72 @@ class _$CreateDietStateCopyWithImpl<$Res, $Val extends CreateDietState>
Object? drafted = null,
Object? isDietBeingEdited = null,
}) {
return _then(
_value.copyWith(
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
isDietPublishing:
null == isDietPublishing
? _value.isDietPublishing
: isDietPublishing // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
dietData:
null == dietData
? _value.dietData
: dietData // ignore: cast_nullable_to_non_nullable
as CreateDietModel,
copiedDay:
freezed == copiedDay
? _value.copiedDay
: copiedDay // ignore: cast_nullable_to_non_nullable
as List<List<DailySchedule>>?,
dietNameError:
freezed == dietNameError
? _value.dietNameError
: dietNameError // ignore: cast_nullable_to_non_nullable
as String?,
dietDescriptionError:
freezed == dietDescriptionError
? _value.dietDescriptionError
: dietDescriptionError // ignore: cast_nullable_to_non_nullable
as String?,
dietDurationError:
freezed == dietDurationError
? _value.dietDurationError
: dietDurationError // ignore: cast_nullable_to_non_nullable
as String?,
dietStateError:
freezed == dietStateError
? _value.dietStateError
: dietStateError // ignore: cast_nullable_to_non_nullable
as String?,
dietImageError:
freezed == dietImageError
? _value.dietImageError
: dietImageError // ignore: cast_nullable_to_non_nullable
as String?,
dailyScheduleErrors:
null == dailyScheduleErrors
? _value.dailyScheduleErrors
: dailyScheduleErrors // ignore: cast_nullable_to_non_nullable
as List<String>,
durationIndex:
freezed == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int?,
dietStateIndex:
freezed == dietStateIndex
? _value.dietStateIndex
: dietStateIndex // ignore: cast_nullable_to_non_nullable
as int?,
published:
null == published
? _value.published
: published // ignore: cast_nullable_to_non_nullable
as bool,
drafted:
null == drafted
? _value.drafted
: drafted // ignore: cast_nullable_to_non_nullable
as bool,
isDietBeingEdited:
null == isDietBeingEdited
? _value.isDietBeingEdited
: isDietBeingEdited // ignore: cast_nullable_to_non_nullable
as bool,
)
as $Val,
);
return _then(_value.copyWith(
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
isDietPublishing: null == isDietPublishing
? _value.isDietPublishing
: isDietPublishing // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
dietData: null == dietData
? _value.dietData
: dietData // ignore: cast_nullable_to_non_nullable
as CreateDietModel,
copiedDay: freezed == copiedDay
? _value.copiedDay
: copiedDay // ignore: cast_nullable_to_non_nullable
as List<List<DailySchedule>>?,
dietNameError: freezed == dietNameError
? _value.dietNameError
: dietNameError // ignore: cast_nullable_to_non_nullable
as String?,
dietDescriptionError: freezed == dietDescriptionError
? _value.dietDescriptionError
: dietDescriptionError // ignore: cast_nullable_to_non_nullable
as String?,
dietDurationError: freezed == dietDurationError
? _value.dietDurationError
: dietDurationError // ignore: cast_nullable_to_non_nullable
as String?,
dietStateError: freezed == dietStateError
? _value.dietStateError
: dietStateError // ignore: cast_nullable_to_non_nullable
as String?,
dietImageError: freezed == dietImageError
? _value.dietImageError
: dietImageError // ignore: cast_nullable_to_non_nullable
as String?,
dailyScheduleErrors: null == dailyScheduleErrors
? _value.dailyScheduleErrors
: dailyScheduleErrors // ignore: cast_nullable_to_non_nullable
as List<String>,
durationIndex: freezed == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int?,
dietStateIndex: freezed == dietStateIndex
? _value.dietStateIndex
: dietStateIndex // ignore: cast_nullable_to_non_nullable
as int?,
published: null == published
? _value.published
: published // ignore: cast_nullable_to_non_nullable
as bool,
drafted: null == drafted
? _value.drafted
: drafted // ignore: cast_nullable_to_non_nullable
as bool,
isDietBeingEdited: null == isDietBeingEdited
? _value.isDietBeingEdited
: isDietBeingEdited // ignore: cast_nullable_to_non_nullable
as bool,
) as $Val);
}
/// Create a copy of CreateDietState
@@ -204,30 +182,28 @@ class _$CreateDietStateCopyWithImpl<$Res, $Val extends CreateDietState>
/// @nodoc
abstract class _$$CreateDietStateImplCopyWith<$Res>
implements $CreateDietStateCopyWith<$Res> {
factory _$$CreateDietStateImplCopyWith(
_$CreateDietStateImpl value,
$Res Function(_$CreateDietStateImpl) then,
) = __$$CreateDietStateImplCopyWithImpl<$Res>;
factory _$$CreateDietStateImplCopyWith(_$CreateDietStateImpl value,
$Res Function(_$CreateDietStateImpl) then) =
__$$CreateDietStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
bool isLoading,
bool isDietPublishing,
String? errorMessage,
CreateDietModel dietData,
List<List<DailySchedule>>? copiedDay,
String? dietNameError,
String? dietDescriptionError,
String? dietDurationError,
String? dietStateError,
String? dietImageError,
List<String> dailyScheduleErrors,
int? durationIndex,
int? dietStateIndex,
bool published,
bool drafted,
bool isDietBeingEdited,
});
$Res call(
{bool isLoading,
bool isDietPublishing,
String? errorMessage,
CreateDietModel dietData,
List<List<DailySchedule>>? copiedDay,
String? dietNameError,
String? dietDescriptionError,
String? dietDurationError,
String? dietStateError,
String? dietImageError,
List<String> dailyScheduleErrors,
int? durationIndex,
int? dietStateIndex,
bool published,
bool drafted,
bool isDietBeingEdited});
@override
$CreateDietModelCopyWith<$Res> get dietData;
@@ -238,9 +214,8 @@ class __$$CreateDietStateImplCopyWithImpl<$Res>
extends _$CreateDietStateCopyWithImpl<$Res, _$CreateDietStateImpl>
implements _$$CreateDietStateImplCopyWith<$Res> {
__$$CreateDietStateImplCopyWithImpl(
_$CreateDietStateImpl _value,
$Res Function(_$CreateDietStateImpl) _then,
) : super(_value, _then);
_$CreateDietStateImpl _value, $Res Function(_$CreateDietStateImpl) _then)
: super(_value, _then);
/// Create a copy of CreateDietState
/// with the given fields replaced by the non-null parameter values.
@@ -264,115 +239,97 @@ class __$$CreateDietStateImplCopyWithImpl<$Res>
Object? drafted = null,
Object? isDietBeingEdited = null,
}) {
return _then(
_$CreateDietStateImpl(
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
isDietPublishing:
null == isDietPublishing
? _value.isDietPublishing
: isDietPublishing // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
dietData:
null == dietData
? _value.dietData
: dietData // ignore: cast_nullable_to_non_nullable
as CreateDietModel,
copiedDay:
freezed == copiedDay
? _value._copiedDay
: copiedDay // ignore: cast_nullable_to_non_nullable
as List<List<DailySchedule>>?,
dietNameError:
freezed == dietNameError
? _value.dietNameError
: dietNameError // ignore: cast_nullable_to_non_nullable
as String?,
dietDescriptionError:
freezed == dietDescriptionError
? _value.dietDescriptionError
: dietDescriptionError // ignore: cast_nullable_to_non_nullable
as String?,
dietDurationError:
freezed == dietDurationError
? _value.dietDurationError
: dietDurationError // ignore: cast_nullable_to_non_nullable
as String?,
dietStateError:
freezed == dietStateError
? _value.dietStateError
: dietStateError // ignore: cast_nullable_to_non_nullable
as String?,
dietImageError:
freezed == dietImageError
? _value.dietImageError
: dietImageError // ignore: cast_nullable_to_non_nullable
as String?,
dailyScheduleErrors:
null == dailyScheduleErrors
? _value._dailyScheduleErrors
: dailyScheduleErrors // ignore: cast_nullable_to_non_nullable
as List<String>,
durationIndex:
freezed == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int?,
dietStateIndex:
freezed == dietStateIndex
? _value.dietStateIndex
: dietStateIndex // ignore: cast_nullable_to_non_nullable
as int?,
published:
null == published
? _value.published
: published // ignore: cast_nullable_to_non_nullable
as bool,
drafted:
null == drafted
? _value.drafted
: drafted // ignore: cast_nullable_to_non_nullable
as bool,
isDietBeingEdited:
null == isDietBeingEdited
? _value.isDietBeingEdited
: isDietBeingEdited // ignore: cast_nullable_to_non_nullable
as bool,
),
);
return _then(_$CreateDietStateImpl(
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
isDietPublishing: null == isDietPublishing
? _value.isDietPublishing
: isDietPublishing // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
dietData: null == dietData
? _value.dietData
: dietData // ignore: cast_nullable_to_non_nullable
as CreateDietModel,
copiedDay: freezed == copiedDay
? _value._copiedDay
: copiedDay // ignore: cast_nullable_to_non_nullable
as List<List<DailySchedule>>?,
dietNameError: freezed == dietNameError
? _value.dietNameError
: dietNameError // ignore: cast_nullable_to_non_nullable
as String?,
dietDescriptionError: freezed == dietDescriptionError
? _value.dietDescriptionError
: dietDescriptionError // ignore: cast_nullable_to_non_nullable
as String?,
dietDurationError: freezed == dietDurationError
? _value.dietDurationError
: dietDurationError // ignore: cast_nullable_to_non_nullable
as String?,
dietStateError: freezed == dietStateError
? _value.dietStateError
: dietStateError // ignore: cast_nullable_to_non_nullable
as String?,
dietImageError: freezed == dietImageError
? _value.dietImageError
: dietImageError // ignore: cast_nullable_to_non_nullable
as String?,
dailyScheduleErrors: null == dailyScheduleErrors
? _value._dailyScheduleErrors
: dailyScheduleErrors // ignore: cast_nullable_to_non_nullable
as List<String>,
durationIndex: freezed == durationIndex
? _value.durationIndex
: durationIndex // ignore: cast_nullable_to_non_nullable
as int?,
dietStateIndex: freezed == dietStateIndex
? _value.dietStateIndex
: dietStateIndex // ignore: cast_nullable_to_non_nullable
as int?,
published: null == published
? _value.published
: published // ignore: cast_nullable_to_non_nullable
as bool,
drafted: null == drafted
? _value.drafted
: drafted // ignore: cast_nullable_to_non_nullable
as bool,
isDietBeingEdited: null == isDietBeingEdited
? _value.isDietBeingEdited
: isDietBeingEdited // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
class _$CreateDietStateImpl implements _CreateDietState {
const _$CreateDietStateImpl({
required this.isLoading,
required this.isDietPublishing,
required this.errorMessage,
required this.dietData,
final List<List<DailySchedule>>? copiedDay,
this.dietNameError,
this.dietDescriptionError,
this.dietDurationError,
this.dietStateError,
this.dietImageError,
required final List<String> dailyScheduleErrors,
this.durationIndex,
this.dietStateIndex,
this.published = false,
this.drafted = false,
this.isDietBeingEdited = false,
}) : _copiedDay = copiedDay,
_dailyScheduleErrors = dailyScheduleErrors;
const _$CreateDietStateImpl(
{required this.isLoading,
required this.isDietPublishing,
required this.errorMessage,
required this.dietData,
final List<List<DailySchedule>>? copiedDay,
this.dietNameError,
this.dietDescriptionError,
this.dietDurationError,
this.dietStateError,
this.dietImageError,
required final List<String> dailyScheduleErrors,
this.durationIndex,
this.dietStateIndex,
this.published = false,
this.drafted = false,
this.isDietBeingEdited = false})
: _copiedDay = copiedDay,
_dailyScheduleErrors = dailyScheduleErrors;
@override
final bool isLoading;
@@ -443,10 +400,8 @@ class _$CreateDietStateImpl implements _CreateDietState {
other.errorMessage == errorMessage) &&
(identical(other.dietData, dietData) ||
other.dietData == dietData) &&
const DeepCollectionEquality().equals(
other._copiedDay,
_copiedDay,
) &&
const DeepCollectionEquality()
.equals(other._copiedDay, _copiedDay) &&
(identical(other.dietNameError, dietNameError) ||
other.dietNameError == dietNameError) &&
(identical(other.dietDescriptionError, dietDescriptionError) ||
@@ -457,10 +412,8 @@ class _$CreateDietStateImpl implements _CreateDietState {
other.dietStateError == dietStateError) &&
(identical(other.dietImageError, dietImageError) ||
other.dietImageError == dietImageError) &&
const DeepCollectionEquality().equals(
other._dailyScheduleErrors,
_dailyScheduleErrors,
) &&
const DeepCollectionEquality()
.equals(other._dailyScheduleErrors, _dailyScheduleErrors) &&
(identical(other.durationIndex, durationIndex) ||
other.durationIndex == durationIndex) &&
(identical(other.dietStateIndex, dietStateIndex) ||
@@ -474,24 +427,23 @@ class _$CreateDietStateImpl implements _CreateDietState {
@override
int get hashCode => Object.hash(
runtimeType,
isLoading,
isDietPublishing,
errorMessage,
dietData,
const DeepCollectionEquality().hash(_copiedDay),
dietNameError,
dietDescriptionError,
dietDurationError,
dietStateError,
dietImageError,
const DeepCollectionEquality().hash(_dailyScheduleErrors),
durationIndex,
dietStateIndex,
published,
drafted,
isDietBeingEdited,
);
runtimeType,
isLoading,
isDietPublishing,
errorMessage,
dietData,
const DeepCollectionEquality().hash(_copiedDay),
dietNameError,
dietDescriptionError,
dietDurationError,
dietStateError,
dietImageError,
const DeepCollectionEquality().hash(_dailyScheduleErrors),
durationIndex,
dietStateIndex,
published,
drafted,
isDietBeingEdited);
/// Create a copy of CreateDietState
/// with the given fields replaced by the non-null parameter values.
@@ -500,30 +452,27 @@ class _$CreateDietStateImpl implements _CreateDietState {
@pragma('vm:prefer-inline')
_$$CreateDietStateImplCopyWith<_$CreateDietStateImpl> get copyWith =>
__$$CreateDietStateImplCopyWithImpl<_$CreateDietStateImpl>(
this,
_$identity,
);
this, _$identity);
}
abstract class _CreateDietState implements CreateDietState {
const factory _CreateDietState({
required final bool isLoading,
required final bool isDietPublishing,
required final String? errorMessage,
required final CreateDietModel dietData,
final List<List<DailySchedule>>? copiedDay,
final String? dietNameError,
final String? dietDescriptionError,
final String? dietDurationError,
final String? dietStateError,
final String? dietImageError,
required final List<String> dailyScheduleErrors,
final int? durationIndex,
final int? dietStateIndex,
final bool published,
final bool drafted,
final bool isDietBeingEdited,
}) = _$CreateDietStateImpl;
const factory _CreateDietState(
{required final bool isLoading,
required final bool isDietPublishing,
required final String? errorMessage,
required final CreateDietModel dietData,
final List<List<DailySchedule>>? copiedDay,
final String? dietNameError,
final String? dietDescriptionError,
final String? dietDurationError,
final String? dietStateError,
final String? dietImageError,
required final List<String> dailyScheduleErrors,
final int? durationIndex,
final int? dietStateIndex,
final bool published,
final bool drafted,
final bool isDietBeingEdited}) = _$CreateDietStateImpl;
@override
bool get isLoading;