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

@@ -12,8 +12,7 @@ part of 'user_details_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 _$UserDetailsState {
@@ -34,17 +33,15 @@ mixin _$UserDetailsState {
/// @nodoc
abstract class $UserDetailsStateCopyWith<$Res> {
factory $UserDetailsStateCopyWith(
UserDetailsState value,
$Res Function(UserDetailsState) then,
) = _$UserDetailsStateCopyWithImpl<$Res, UserDetailsState>;
UserDetailsState value, $Res Function(UserDetailsState) then) =
_$UserDetailsStateCopyWithImpl<$Res, UserDetailsState>;
@useResult
$Res call({
bool isLoading,
String? error,
ProfileDetailsModel? profileDetails,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
});
$Res call(
{bool isLoading,
String? error,
ProfileDetailsModel? profileDetails,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints});
$ProfileDetailsModelCopyWith<$Res>? get profileDetails;
}
@@ -70,36 +67,28 @@ class _$UserDetailsStateCopyWithImpl<$Res, $Val extends UserDetailsState>
Object? weightPoints = freezed,
Object? circumferencePoints = freezed,
}) {
return _then(
_value.copyWith(
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
error:
freezed == error
? _value.error
: error // ignore: cast_nullable_to_non_nullable
as String?,
profileDetails:
freezed == profileDetails
? _value.profileDetails
: profileDetails // ignore: cast_nullable_to_non_nullable
as ProfileDetailsModel?,
weightPoints:
freezed == weightPoints
? _value.weightPoints
: weightPoints // ignore: cast_nullable_to_non_nullable
as List<WeightModel>?,
circumferencePoints:
freezed == circumferencePoints
? _value.circumferencePoints
: circumferencePoints // ignore: cast_nullable_to_non_nullable
as List<CircumferenceModel>?,
)
as $Val,
);
return _then(_value.copyWith(
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
error: freezed == error
? _value.error
: error // ignore: cast_nullable_to_non_nullable
as String?,
profileDetails: freezed == profileDetails
? _value.profileDetails
: profileDetails // ignore: cast_nullable_to_non_nullable
as ProfileDetailsModel?,
weightPoints: freezed == weightPoints
? _value.weightPoints
: weightPoints // ignore: cast_nullable_to_non_nullable
as List<WeightModel>?,
circumferencePoints: freezed == circumferencePoints
? _value.circumferencePoints
: circumferencePoints // ignore: cast_nullable_to_non_nullable
as List<CircumferenceModel>?,
) as $Val);
}
/// Create a copy of UserDetailsState
@@ -120,19 +109,17 @@ class _$UserDetailsStateCopyWithImpl<$Res, $Val extends UserDetailsState>
/// @nodoc
abstract class _$$UserDetailsStateImplCopyWith<$Res>
implements $UserDetailsStateCopyWith<$Res> {
factory _$$UserDetailsStateImplCopyWith(
_$UserDetailsStateImpl value,
$Res Function(_$UserDetailsStateImpl) then,
) = __$$UserDetailsStateImplCopyWithImpl<$Res>;
factory _$$UserDetailsStateImplCopyWith(_$UserDetailsStateImpl value,
$Res Function(_$UserDetailsStateImpl) then) =
__$$UserDetailsStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
bool isLoading,
String? error,
ProfileDetailsModel? profileDetails,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
});
$Res call(
{bool isLoading,
String? error,
ProfileDetailsModel? profileDetails,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints});
@override
$ProfileDetailsModelCopyWith<$Res>? get profileDetails;
@@ -142,10 +129,9 @@ abstract class _$$UserDetailsStateImplCopyWith<$Res>
class __$$UserDetailsStateImplCopyWithImpl<$Res>
extends _$UserDetailsStateCopyWithImpl<$Res, _$UserDetailsStateImpl>
implements _$$UserDetailsStateImplCopyWith<$Res> {
__$$UserDetailsStateImplCopyWithImpl(
_$UserDetailsStateImpl _value,
$Res Function(_$UserDetailsStateImpl) _then,
) : super(_value, _then);
__$$UserDetailsStateImplCopyWithImpl(_$UserDetailsStateImpl _value,
$Res Function(_$UserDetailsStateImpl) _then)
: super(_value, _then);
/// Create a copy of UserDetailsState
/// with the given fields replaced by the non-null parameter values.
@@ -158,49 +144,42 @@ class __$$UserDetailsStateImplCopyWithImpl<$Res>
Object? weightPoints = freezed,
Object? circumferencePoints = freezed,
}) {
return _then(
_$UserDetailsStateImpl(
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
error:
freezed == error
? _value.error
: error // ignore: cast_nullable_to_non_nullable
as String?,
profileDetails:
freezed == profileDetails
? _value.profileDetails
: profileDetails // ignore: cast_nullable_to_non_nullable
as ProfileDetailsModel?,
weightPoints:
freezed == weightPoints
? _value._weightPoints
: weightPoints // ignore: cast_nullable_to_non_nullable
as List<WeightModel>?,
circumferencePoints:
freezed == circumferencePoints
? _value._circumferencePoints
: circumferencePoints // ignore: cast_nullable_to_non_nullable
as List<CircumferenceModel>?,
),
);
return _then(_$UserDetailsStateImpl(
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
error: freezed == error
? _value.error
: error // ignore: cast_nullable_to_non_nullable
as String?,
profileDetails: freezed == profileDetails
? _value.profileDetails
: profileDetails // ignore: cast_nullable_to_non_nullable
as ProfileDetailsModel?,
weightPoints: freezed == weightPoints
? _value._weightPoints
: weightPoints // ignore: cast_nullable_to_non_nullable
as List<WeightModel>?,
circumferencePoints: freezed == circumferencePoints
? _value._circumferencePoints
: circumferencePoints // ignore: cast_nullable_to_non_nullable
as List<CircumferenceModel>?,
));
}
}
/// @nodoc
class _$UserDetailsStateImpl implements _UserDetailsState {
_$UserDetailsStateImpl({
this.isLoading = false,
this.error,
this.profileDetails,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints,
}) : _weightPoints = weightPoints,
_circumferencePoints = circumferencePoints;
_$UserDetailsStateImpl(
{this.isLoading = false,
this.error,
this.profileDetails,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints})
: _weightPoints = weightPoints,
_circumferencePoints = circumferencePoints;
@override
@JsonKey()
@@ -245,25 +224,20 @@ class _$UserDetailsStateImpl implements _UserDetailsState {
(identical(other.error, error) || other.error == error) &&
(identical(other.profileDetails, profileDetails) ||
other.profileDetails == profileDetails) &&
const DeepCollectionEquality().equals(
other._weightPoints,
_weightPoints,
) &&
const DeepCollectionEquality().equals(
other._circumferencePoints,
_circumferencePoints,
));
const DeepCollectionEquality()
.equals(other._weightPoints, _weightPoints) &&
const DeepCollectionEquality()
.equals(other._circumferencePoints, _circumferencePoints));
}
@override
int get hashCode => Object.hash(
runtimeType,
isLoading,
error,
profileDetails,
const DeepCollectionEquality().hash(_weightPoints),
const DeepCollectionEquality().hash(_circumferencePoints),
);
runtimeType,
isLoading,
error,
profileDetails,
const DeepCollectionEquality().hash(_weightPoints),
const DeepCollectionEquality().hash(_circumferencePoints));
/// Create a copy of UserDetailsState
/// with the given fields replaced by the non-null parameter values.
@@ -272,19 +246,17 @@ class _$UserDetailsStateImpl implements _UserDetailsState {
@pragma('vm:prefer-inline')
_$$UserDetailsStateImplCopyWith<_$UserDetailsStateImpl> get copyWith =>
__$$UserDetailsStateImplCopyWithImpl<_$UserDetailsStateImpl>(
this,
_$identity,
);
this, _$identity);
}
abstract class _UserDetailsState implements UserDetailsState {
factory _UserDetailsState({
final bool isLoading,
final String? error,
final ProfileDetailsModel? profileDetails,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints,
}) = _$UserDetailsStateImpl;
factory _UserDetailsState(
{final bool isLoading,
final String? error,
final ProfileDetailsModel? profileDetails,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints}) =
_$UserDetailsStateImpl;
@override
bool get isLoading;

View File

@@ -84,7 +84,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
complainedContentType: ComplainedContent.profile,
slug: widget.slug,
),
anchor: Aligned(
anchor: const Aligned(
shiftToWithinBound: AxisFlag(x: true, y: true),
follower: Alignment.topRight,
target: Alignment.bottomRight,
@@ -108,15 +108,17 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
child: SingleChildScrollView(
controller: ScrollController()
..addListener(() {
setState(() {
isMoreOptionsVisible = false;
});
if (isMoreOptionsVisible) {
setState(() {
isMoreOptionsVisible = false;
});
}
}),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
spacing: 12,
children: [
SizedBox.shrink(),
const SizedBox.shrink(),
_charts(),
ExpandableBouble(
initiallyExpanded: true,
@@ -126,22 +128,22 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.date_of_birth,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: DateTime.parse(profileDetails.birthdate).format('dd.MM.yyyy')),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(
s.sex,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.gender.parseGender()),
),
SizedBox(height: 16),
const SizedBox(height: 16),
],
),
ExpandableBouble(
@@ -157,7 +159,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.height,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.height.toString()),
@@ -165,7 +167,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
],
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -174,7 +176,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.weight,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.weight.toStringAsFixed(0)),
@@ -184,7 +186,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
),
],
),
SizedBox(height: 16),
const SizedBox(height: 16),
Row(
children: [
Expanded(
@@ -195,7 +197,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.chest_circumference,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.chestCircumference.toString()),
@@ -203,7 +205,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
],
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -212,7 +214,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.waist_circumference,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.waistCircumference.toString()),
@@ -220,7 +222,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
],
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -229,7 +231,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.hip_circumference,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.hipCircumference.toString()),
@@ -239,7 +241,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
),
],
),
SizedBox(height: 16),
const SizedBox(height: 16),
],
),
ExpandableBouble(
@@ -255,7 +257,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.upper,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.bloodPressureUp.toString()),
@@ -263,7 +265,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
],
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -272,7 +274,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.lower,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.bloodPressureDown.toStringAsFixed(0)),
@@ -282,7 +284,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
),
],
),
SizedBox(height: 16),
const SizedBox(height: 16),
Row(
children: [
Expanded(
@@ -293,7 +295,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.has_hypo,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.hasHypo.toString()),
@@ -301,7 +303,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
],
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -310,7 +312,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.has_hyper,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.hasHyper.toString()),
@@ -320,7 +322,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
),
],
),
SizedBox(height: 16),
const SizedBox(height: 16),
],
),
ExpandableBouble(
@@ -330,57 +332,57 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
s.has_alergy,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.aboutAlergy),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(
s.takes_pills,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.aboutTakingPils),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(
s.sport_hobbies,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.aboutSportHobbies),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(
s.liked_groceries,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.favoriteFoods),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(
s.not_liked_groceries,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
readOnly: true,
controller: TextEditingController(text: profileDetails.unfavoriteFoods),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(
s.additional_information,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
SizedBox(
height: 112,
child: CustomTextFormField(
@@ -393,7 +395,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
controller: TextEditingController(text: profileDetails.additionalInfo),
),
),
SizedBox(height: 16),
const SizedBox(height: 16),
],
),
],
@@ -413,7 +415,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
}
return Scaffold(
appBar: AppBar(),
body: Loader(),
body: const Loader(),
);
},
);
@@ -428,14 +430,14 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
children: [
const SizedBox(height: 8),
SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16),
scrollDirection: Axis.horizontal,
child: Row(
children: [
_choiceChipWidget(0),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceChipWidget(1),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceChipWidget(2),
],
),
@@ -456,26 +458,26 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
weightPoints: weightPoints,
);
default:
return SizedBox.shrink();
return const SizedBox.shrink();
}
},
),
SizedBox(height: 8),
const SizedBox(height: 8),
Row(
children: [
SizedBox(width: 16),
const SizedBox(width: 16),
_choiceIntervalChipWidget(0),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceIntervalChipWidget(1),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceIntervalChipWidget(2),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceIntervalChipWidget(3),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceIntervalChipWidget(4),
],
),
SizedBox(height: 8),
const SizedBox(height: 8),
],
),
);

View File

@@ -11,7 +11,7 @@ class ExpandableBouble extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AnimatedSize(
duration: Duration(seconds: 1),
duration: const Duration(seconds: 1),
child: MainBackgroundBouble(
child: Theme(
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
@@ -19,8 +19,8 @@ class ExpandableBouble extends StatelessWidget {
initiallyExpanded: initiallyExpanded,
expandedCrossAxisAlignment: CrossAxisAlignment.start,
expandedAlignment: Alignment.bottomLeft,
tilePadding: EdgeInsets.symmetric(horizontal: 16),
childrenPadding: EdgeInsets.symmetric(horizontal: 16),
tilePadding: const EdgeInsets.symmetric(horizontal: 16),
childrenPadding: const EdgeInsets.symmetric(horizontal: 16),
title: Text(
title,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),