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 'plans_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 _$PlansState {
@@ -23,14 +22,16 @@ mixin _$PlansState {
required TResult Function() loading,
required TResult Function(List<PlanModel> plansList) loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<PlanModel> plansList)? loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$PlansState {
TResult Function(List<PlanModel> plansList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_PlansState value) $default, {
required TResult Function(PlansStateLoading value) loading,
required TResult Function(PlansStateLoaded value) loaded,
required TResult Function(PlansStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_PlansState value)? $default, {
TResult? Function(PlansStateLoading value)? loading,
TResult? Function(PlansStateLoaded value)? loaded,
TResult? Function(PlansStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_PlansState value)? $default, {
@@ -60,15 +64,15 @@ mixin _$PlansState {
TResult Function(PlansStateLoaded value)? loaded,
TResult Function(PlansStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PlansStateCopyWith<$Res> {
factory $PlansStateCopyWith(
PlansState value,
$Res Function(PlansState) then,
) = _$PlansStateCopyWithImpl<$Res, PlansState>;
PlansState value, $Res Function(PlansState) then) =
_$PlansStateCopyWithImpl<$Res, PlansState>;
}
/// @nodoc
@@ -88,9 +92,8 @@ class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState>
/// @nodoc
abstract class _$$PlansStateImplCopyWith<$Res> {
factory _$$PlansStateImplCopyWith(
_$PlansStateImpl value,
$Res Function(_$PlansStateImpl) then,
) = __$$PlansStateImplCopyWithImpl<$Res>;
_$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) =
__$$PlansStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -98,9 +101,8 @@ class __$$PlansStateImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl>
implements _$$PlansStateImplCopyWith<$Res> {
__$$PlansStateImplCopyWithImpl(
_$PlansStateImpl _value,
$Res Function(_$PlansStateImpl) _then,
) : super(_value, _then);
_$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then)
: super(_value, _then);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@@ -206,20 +208,18 @@ abstract class _PlansState implements PlansState {
/// @nodoc
abstract class _$$PlansStateLoadingImplCopyWith<$Res> {
factory _$$PlansStateLoadingImplCopyWith(
_$PlansStateLoadingImpl value,
$Res Function(_$PlansStateLoadingImpl) then,
) = __$$PlansStateLoadingImplCopyWithImpl<$Res>;
factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value,
$Res Function(_$PlansStateLoadingImpl) then) =
__$$PlansStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$PlansStateLoadingImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl>
implements _$$PlansStateLoadingImplCopyWith<$Res> {
__$$PlansStateLoadingImplCopyWithImpl(
_$PlansStateLoadingImpl _value,
$Res Function(_$PlansStateLoadingImpl) _then,
) : super(_value, _then);
__$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value,
$Res Function(_$PlansStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@@ -325,10 +325,9 @@ abstract class PlansStateLoading implements PlansState {
/// @nodoc
abstract class _$$PlansStateLoadedImplCopyWith<$Res> {
factory _$$PlansStateLoadedImplCopyWith(
_$PlansStateLoadedImpl value,
$Res Function(_$PlansStateLoadedImpl) then,
) = __$$PlansStateLoadedImplCopyWithImpl<$Res>;
factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value,
$Res Function(_$PlansStateLoadedImpl) then) =
__$$PlansStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({List<PlanModel> plansList});
}
@@ -337,25 +336,23 @@ abstract class _$$PlansStateLoadedImplCopyWith<$Res> {
class __$$PlansStateLoadedImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl>
implements _$$PlansStateLoadedImplCopyWith<$Res> {
__$$PlansStateLoadedImplCopyWithImpl(
_$PlansStateLoadedImpl _value,
$Res Function(_$PlansStateLoadedImpl) _then,
) : super(_value, _then);
__$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value,
$Res Function(_$PlansStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? plansList = null}) {
return _then(
_$PlansStateLoadedImpl(
plansList:
null == plansList
? _value._plansList
: plansList // ignore: cast_nullable_to_non_nullable
as List<PlanModel>,
),
);
$Res call({
Object? plansList = null,
}) {
return _then(_$PlansStateLoadedImpl(
plansList: null == plansList
? _value._plansList
: plansList // ignore: cast_nullable_to_non_nullable
as List<PlanModel>,
));
}
}
@@ -363,7 +360,7 @@ class __$$PlansStateLoadedImplCopyWithImpl<$Res>
class _$PlansStateLoadedImpl implements PlansStateLoaded {
const _$PlansStateLoadedImpl({required final List<PlanModel> plansList})
: _plansList = plansList;
: _plansList = plansList;
final List<PlanModel> _plansList;
@override
@@ -383,10 +380,8 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PlansStateLoadedImpl &&
const DeepCollectionEquality().equals(
other._plansList,
_plansList,
));
const DeepCollectionEquality()
.equals(other._plansList, _plansList));
}
@override
@@ -400,9 +395,7 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded {
@pragma('vm:prefer-inline')
_$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith =>
__$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -494,10 +487,9 @@ abstract class PlansStateLoaded implements PlansState {
/// @nodoc
abstract class _$$PlansStateErrorImplCopyWith<$Res> {
factory _$$PlansStateErrorImplCopyWith(
_$PlansStateErrorImpl value,
$Res Function(_$PlansStateErrorImpl) then,
) = __$$PlansStateErrorImplCopyWithImpl<$Res>;
factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value,
$Res Function(_$PlansStateErrorImpl) then) =
__$$PlansStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -507,24 +499,22 @@ class __$$PlansStateErrorImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl>
implements _$$PlansStateErrorImplCopyWith<$Res> {
__$$PlansStateErrorImplCopyWithImpl(
_$PlansStateErrorImpl _value,
$Res Function(_$PlansStateErrorImpl) _then,
) : super(_value, _then);
_$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$PlansStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$PlansStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -560,9 +550,7 @@ class _$PlansStateErrorImpl implements PlansStateError {
@pragma('vm:prefer-inline')
_$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith =>
__$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs

View File

@@ -12,8 +12,7 @@ part of 'profile_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 _$ProfileState {
@@ -22,58 +21,60 @@ mixin _$ProfileState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_ProfileState value) $default, {
required TResult Function(ProfileStateLoading value) loading,
required TResult Function(ProfileStateLoaded value) loaded,
required TResult Function(ProfileStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_ProfileState value)? $default, {
TResult? Function(ProfileStateLoading value)? loading,
TResult? Function(ProfileStateLoaded value)? loaded,
TResult? Function(ProfileStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_ProfileState value)? $default, {
@@ -81,15 +82,15 @@ mixin _$ProfileState {
TResult Function(ProfileStateLoaded value)? loaded,
TResult Function(ProfileStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ProfileStateCopyWith<$Res> {
factory $ProfileStateCopyWith(
ProfileState value,
$Res Function(ProfileState) then,
) = _$ProfileStateCopyWithImpl<$Res, ProfileState>;
ProfileState value, $Res Function(ProfileState) then) =
_$ProfileStateCopyWithImpl<$Res, ProfileState>;
}
/// @nodoc
@@ -109,9 +110,8 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState>
/// @nodoc
abstract class _$$ProfileStateImplCopyWith<$Res> {
factory _$$ProfileStateImplCopyWith(
_$ProfileStateImpl value,
$Res Function(_$ProfileStateImpl) then,
) = __$$ProfileStateImplCopyWithImpl<$Res>;
_$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) =
__$$ProfileStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -119,9 +119,8 @@ class __$$ProfileStateImplCopyWithImpl<$Res>
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl>
implements _$$ProfileStateImplCopyWith<$Res> {
__$$ProfileStateImplCopyWithImpl(
_$ProfileStateImpl _value,
$Res Function(_$ProfileStateImpl) _then,
) : super(_value, _then);
_$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@@ -152,13 +151,12 @@ class _$ProfileStateImpl implements _ProfileState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) {
return $default();
@@ -170,13 +168,12 @@ class _$ProfileStateImpl implements _ProfileState {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return $default?.call();
@@ -188,13 +185,12 @@ class _$ProfileStateImpl implements _ProfileState {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -248,20 +244,18 @@ abstract class _ProfileState implements ProfileState {
/// @nodoc
abstract class _$$ProfileStateLoadingImplCopyWith<$Res> {
factory _$$ProfileStateLoadingImplCopyWith(
_$ProfileStateLoadingImpl value,
$Res Function(_$ProfileStateLoadingImpl) then,
) = __$$ProfileStateLoadingImplCopyWithImpl<$Res>;
factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value,
$Res Function(_$ProfileStateLoadingImpl) then) =
__$$ProfileStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$ProfileStateLoadingImplCopyWithImpl<$Res>
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl>
implements _$$ProfileStateLoadingImplCopyWith<$Res> {
__$$ProfileStateLoadingImplCopyWithImpl(
_$ProfileStateLoadingImpl _value,
$Res Function(_$ProfileStateLoadingImpl) _then,
) : super(_value, _then);
__$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value,
$Res Function(_$ProfileStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@@ -293,13 +287,12 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loading();
@@ -311,13 +304,12 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loading?.call();
@@ -329,13 +321,12 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -389,18 +380,16 @@ abstract class ProfileStateLoading implements ProfileState {
/// @nodoc
abstract class _$$ProfileStateLoadedImplCopyWith<$Res> {
factory _$$ProfileStateLoadedImplCopyWith(
_$ProfileStateLoadedImpl value,
$Res Function(_$ProfileStateLoadedImpl) then,
) = __$$ProfileStateLoadedImplCopyWithImpl<$Res>;
factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value,
$Res Function(_$ProfileStateLoadedImpl) then) =
__$$ProfileStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
});
$Res call(
{ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints});
$ProfileModelCopyWith<$Res> get profile;
$ProfileDetailsModelCopyWith<$Res> get profileDetails;
@@ -410,10 +399,9 @@ abstract class _$$ProfileStateLoadedImplCopyWith<$Res> {
class __$$ProfileStateLoadedImplCopyWithImpl<$Res>
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl>
implements _$$ProfileStateLoadedImplCopyWith<$Res> {
__$$ProfileStateLoadedImplCopyWithImpl(
_$ProfileStateLoadedImpl _value,
$Res Function(_$ProfileStateLoadedImpl) _then,
) : super(_value, _then);
__$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value,
$Res Function(_$ProfileStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@@ -426,35 +414,28 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res>
Object? weightPoints = freezed,
Object? circumferencePoints = freezed,
}) {
return _then(
_$ProfileStateLoadedImpl(
profile:
null == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel,
profileDetails:
null == profileDetails
? _value.profileDetails
: profileDetails // ignore: cast_nullable_to_non_nullable
as ProfileDetailsModel,
blogPosts:
null == blogPosts
? _value._blogPosts
: blogPosts // ignore: cast_nullable_to_non_nullable
as List<FeedBlogPostModel>,
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(_$ProfileStateLoadedImpl(
profile: null == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel,
profileDetails: null == profileDetails
? _value.profileDetails
: profileDetails // ignore: cast_nullable_to_non_nullable
as ProfileDetailsModel,
blogPosts: null == blogPosts
? _value._blogPosts
: blogPosts // ignore: cast_nullable_to_non_nullable
as List<FeedBlogPostModel>,
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>?,
));
}
/// Create a copy of ProfileState
@@ -481,15 +462,15 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res>
/// @nodoc
class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
const _$ProfileStateLoadedImpl({
required this.profile,
required this.profileDetails,
required final List<FeedBlogPostModel> blogPosts,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints,
}) : _blogPosts = blogPosts,
_weightPoints = weightPoints,
_circumferencePoints = circumferencePoints;
const _$ProfileStateLoadedImpl(
{required this.profile,
required this.profileDetails,
required final List<FeedBlogPostModel> blogPosts,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints})
: _blogPosts = blogPosts,
_weightPoints = weightPoints,
_circumferencePoints = circumferencePoints;
@override
final ProfileModel profile;
@@ -537,29 +518,22 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
(identical(other.profile, profile) || other.profile == profile) &&
(identical(other.profileDetails, profileDetails) ||
other.profileDetails == profileDetails) &&
const DeepCollectionEquality().equals(
other._blogPosts,
_blogPosts,
) &&
const DeepCollectionEquality().equals(
other._weightPoints,
_weightPoints,
) &&
const DeepCollectionEquality().equals(
other._circumferencePoints,
_circumferencePoints,
));
const DeepCollectionEquality()
.equals(other._blogPosts, _blogPosts) &&
const DeepCollectionEquality()
.equals(other._weightPoints, _weightPoints) &&
const DeepCollectionEquality()
.equals(other._circumferencePoints, _circumferencePoints));
}
@override
int get hashCode => Object.hash(
runtimeType,
profile,
profileDetails,
const DeepCollectionEquality().hash(_blogPosts),
const DeepCollectionEquality().hash(_weightPoints),
const DeepCollectionEquality().hash(_circumferencePoints),
);
runtimeType,
profile,
profileDetails,
const DeepCollectionEquality().hash(_blogPosts),
const DeepCollectionEquality().hash(_weightPoints),
const DeepCollectionEquality().hash(_circumferencePoints));
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@@ -568,9 +542,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
@pragma('vm:prefer-inline')
_$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith =>
__$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -578,22 +550,16 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loaded(
profile,
profileDetails,
blogPosts,
weightPoints,
circumferencePoints,
);
profile, profileDetails, blogPosts, weightPoints, circumferencePoints);
}
@override
@@ -602,22 +568,16 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loaded?.call(
profile,
profileDetails,
blogPosts,
weightPoints,
circumferencePoints,
);
profile, profileDetails, blogPosts, weightPoints, circumferencePoints);
}
@override
@@ -626,24 +586,18 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
if (loaded != null) {
return loaded(
profile,
profileDetails,
blogPosts,
weightPoints,
circumferencePoints,
);
return loaded(profile, profileDetails, blogPosts, weightPoints,
circumferencePoints);
}
return orElse();
}
@@ -687,13 +641,13 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
}
abstract class ProfileStateLoaded implements ProfileState {
const factory ProfileStateLoaded({
required final ProfileModel profile,
required final ProfileDetailsModel profileDetails,
required final List<FeedBlogPostModel> blogPosts,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints,
}) = _$ProfileStateLoadedImpl;
const factory ProfileStateLoaded(
{required final ProfileModel profile,
required final ProfileDetailsModel profileDetails,
required final List<FeedBlogPostModel> blogPosts,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints}) =
_$ProfileStateLoadedImpl;
ProfileModel get profile;
ProfileDetailsModel get profileDetails;
@@ -710,10 +664,9 @@ abstract class ProfileStateLoaded implements ProfileState {
/// @nodoc
abstract class _$$ProfileStateErrorImplCopyWith<$Res> {
factory _$$ProfileStateErrorImplCopyWith(
_$ProfileStateErrorImpl value,
$Res Function(_$ProfileStateErrorImpl) then,
) = __$$ProfileStateErrorImplCopyWithImpl<$Res>;
factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value,
$Res Function(_$ProfileStateErrorImpl) then) =
__$$ProfileStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -722,25 +675,23 @@ abstract class _$$ProfileStateErrorImplCopyWith<$Res> {
class __$$ProfileStateErrorImplCopyWithImpl<$Res>
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl>
implements _$$ProfileStateErrorImplCopyWith<$Res> {
__$$ProfileStateErrorImplCopyWithImpl(
_$ProfileStateErrorImpl _value,
$Res Function(_$ProfileStateErrorImpl) _then,
) : super(_value, _then);
__$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value,
$Res Function(_$ProfileStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$ProfileStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$ProfileStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -776,9 +727,7 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
@pragma('vm:prefer-inline')
_$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith =>
__$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -786,13 +735,12 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) {
return error(errorMessage);
@@ -804,13 +752,12 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return error?.call(errorMessage);
@@ -822,13 +769,12 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {

View File

@@ -12,8 +12,7 @@ part of 'sub_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 _$SubState {
@@ -23,14 +22,16 @@ mixin _$SubState {
required TResult Function() loading,
required TResult Function(List<SubModel> subList) loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<SubModel> subList)? loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$SubState {
TResult Function(List<SubModel> subList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_SubState value) $default, {
required TResult Function(SubStateLoading value) loading,
required TResult Function(SubStateLoaded value) loaded,
required TResult Function(SubStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_SubState value)? $default, {
TResult? Function(SubStateLoading value)? loading,
TResult? Function(SubStateLoaded value)? loaded,
TResult? Function(SubStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_SubState value)? $default, {
@@ -60,7 +64,8 @@ mixin _$SubState {
TResult Function(SubStateLoaded value)? loaded,
TResult Function(SubStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
@@ -86,9 +91,8 @@ class _$SubStateCopyWithImpl<$Res, $Val extends SubState>
/// @nodoc
abstract class _$$SubStateImplCopyWith<$Res> {
factory _$$SubStateImplCopyWith(
_$SubStateImpl value,
$Res Function(_$SubStateImpl) then,
) = __$$SubStateImplCopyWithImpl<$Res>;
_$SubStateImpl value, $Res Function(_$SubStateImpl) then) =
__$$SubStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -96,9 +100,8 @@ class __$$SubStateImplCopyWithImpl<$Res>
extends _$SubStateCopyWithImpl<$Res, _$SubStateImpl>
implements _$$SubStateImplCopyWith<$Res> {
__$$SubStateImplCopyWithImpl(
_$SubStateImpl _value,
$Res Function(_$SubStateImpl) _then,
) : super(_value, _then);
_$SubStateImpl _value, $Res Function(_$SubStateImpl) _then)
: super(_value, _then);
/// Create a copy of SubState
/// with the given fields replaced by the non-null parameter values.
@@ -204,10 +207,9 @@ abstract class _SubState implements SubState {
/// @nodoc
abstract class _$$SubStateLoadingImplCopyWith<$Res> {
factory _$$SubStateLoadingImplCopyWith(
_$SubStateLoadingImpl value,
$Res Function(_$SubStateLoadingImpl) then,
) = __$$SubStateLoadingImplCopyWithImpl<$Res>;
factory _$$SubStateLoadingImplCopyWith(_$SubStateLoadingImpl value,
$Res Function(_$SubStateLoadingImpl) then) =
__$$SubStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -215,9 +217,8 @@ class __$$SubStateLoadingImplCopyWithImpl<$Res>
extends _$SubStateCopyWithImpl<$Res, _$SubStateLoadingImpl>
implements _$$SubStateLoadingImplCopyWith<$Res> {
__$$SubStateLoadingImplCopyWithImpl(
_$SubStateLoadingImpl _value,
$Res Function(_$SubStateLoadingImpl) _then,
) : super(_value, _then);
_$SubStateLoadingImpl _value, $Res Function(_$SubStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of SubState
/// with the given fields replaced by the non-null parameter values.
@@ -323,10 +324,9 @@ abstract class SubStateLoading implements SubState {
/// @nodoc
abstract class _$$SubStateLoadedImplCopyWith<$Res> {
factory _$$SubStateLoadedImplCopyWith(
_$SubStateLoadedImpl value,
$Res Function(_$SubStateLoadedImpl) then,
) = __$$SubStateLoadedImplCopyWithImpl<$Res>;
factory _$$SubStateLoadedImplCopyWith(_$SubStateLoadedImpl value,
$Res Function(_$SubStateLoadedImpl) then) =
__$$SubStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({List<SubModel> subList});
}
@@ -336,24 +336,22 @@ class __$$SubStateLoadedImplCopyWithImpl<$Res>
extends _$SubStateCopyWithImpl<$Res, _$SubStateLoadedImpl>
implements _$$SubStateLoadedImplCopyWith<$Res> {
__$$SubStateLoadedImplCopyWithImpl(
_$SubStateLoadedImpl _value,
$Res Function(_$SubStateLoadedImpl) _then,
) : super(_value, _then);
_$SubStateLoadedImpl _value, $Res Function(_$SubStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of SubState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? subList = null}) {
return _then(
_$SubStateLoadedImpl(
subList:
null == subList
? _value._subList
: subList // ignore: cast_nullable_to_non_nullable
as List<SubModel>,
),
);
$Res call({
Object? subList = null,
}) {
return _then(_$SubStateLoadedImpl(
subList: null == subList
? _value._subList
: subList // ignore: cast_nullable_to_non_nullable
as List<SubModel>,
));
}
}
@@ -361,7 +359,7 @@ class __$$SubStateLoadedImplCopyWithImpl<$Res>
class _$SubStateLoadedImpl implements SubStateLoaded {
const _$SubStateLoadedImpl({required final List<SubModel> subList})
: _subList = subList;
: _subList = subList;
final List<SubModel> _subList;
@override
@@ -395,9 +393,7 @@ class _$SubStateLoadedImpl implements SubStateLoaded {
@pragma('vm:prefer-inline')
_$$SubStateLoadedImplCopyWith<_$SubStateLoadedImpl> get copyWith =>
__$$SubStateLoadedImplCopyWithImpl<_$SubStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -490,9 +486,8 @@ abstract class SubStateLoaded implements SubState {
/// @nodoc
abstract class _$$SubStateErrorImplCopyWith<$Res> {
factory _$$SubStateErrorImplCopyWith(
_$SubStateErrorImpl value,
$Res Function(_$SubStateErrorImpl) then,
) = __$$SubStateErrorImplCopyWithImpl<$Res>;
_$SubStateErrorImpl value, $Res Function(_$SubStateErrorImpl) then) =
__$$SubStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -502,24 +497,22 @@ class __$$SubStateErrorImplCopyWithImpl<$Res>
extends _$SubStateCopyWithImpl<$Res, _$SubStateErrorImpl>
implements _$$SubStateErrorImplCopyWith<$Res> {
__$$SubStateErrorImplCopyWithImpl(
_$SubStateErrorImpl _value,
$Res Function(_$SubStateErrorImpl) _then,
) : super(_value, _then);
_$SubStateErrorImpl _value, $Res Function(_$SubStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of SubState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$SubStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$SubStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}

View File

@@ -85,7 +85,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
if (isFirstFetch) {
canSub = !state.profile.isEntitySubscribedByMe;
if (state.profile.roles.contains('consultant')) {
plansCubit..getPlans(state.profile.slug);
plansCubit.getPlans(state.profile.slug);
}
isFirstFetch = false;
}
@@ -116,7 +116,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(16),
@@ -133,7 +133,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Row(
children: [
const SizedBox(width: 16),
Text(
const Text(
'Консультант',
style: TextStyle(
fontSize: 16,
@@ -148,7 +148,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: Color(0xFFF6FAFF),
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
),
child: Text(
@@ -163,9 +163,9 @@ class _ProfileScreenState extends State<ProfileScreen> {
],
),
if (state.profile.educationResource?.hasMedicalEducation == 1)
Row(
const Row(
children: [
const SizedBox(width: 16),
SizedBox(width: 16),
Icon(
Icons.done_rounded,
color: Colors.green,
@@ -190,7 +190,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
_subscriptionsAndSubscribers(state),
if (state.profile.badges.isNotEmpty) Padding(padding: EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.badges.isNotEmpty) Padding(padding: const EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.roles.contains('consultant')) _socialLinks(state),
if (state.profile.roles.contains('consultant')) _education(state),
if (state.profile.roles.contains('consultant')) _diplomasAndCertificates(state),
@@ -211,7 +211,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(16),
@@ -226,11 +226,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
_subscriptionsAndSubscribers(state),
if (state.profile.badges.isNotEmpty) Padding(padding: EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.badges.isNotEmpty) Padding(padding: const EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.roles.contains('consultant')) _socialLinks(state),
if (state.profile.roles.contains('consultant')) _education(state),
if (state.profile.roles.contains('consultant')) _diplomasAndCertificates(state),
Padding(padding: EdgeInsets.only(bottom: 16), child: _charts()),
Padding(padding: const EdgeInsets.only(bottom: 16), child: _charts()),
if (state.profile.roles.contains('consultant')) _activePlans(state),
_newBlogPostButton(),
_blogPosts(state),
@@ -253,8 +253,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@@ -293,7 +293,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
],
);
}
return Loader();
return const Loader();
},
);
}
@@ -321,9 +321,9 @@ class _ProfileScreenState extends State<ProfileScreen> {
return AnimatedContainer(
width: isActive ? 10 : 8,
height: isActive ? 10 : 8,
duration: Duration(milliseconds: 150),
duration: const Duration(milliseconds: 150),
decoration: BoxDecoration(
color: isActive ? appTheme.blueA400 : Color(0xFFD7D9DC),
color: isActive ? appTheme.blueA400 : const Color(0xFFD7D9DC),
shape: BoxShape.circle,
),
);
@@ -341,19 +341,19 @@ class _ProfileScreenState extends State<ProfileScreen> {
},
borderRadius: BorderRadius.circular(8),
child: Ink(
padding: EdgeInsets.all(12),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Color(0xFFF6FAFF),
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(8),
),
child: Row(
child: const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.add_circle_outline_rounded,
color: Color(0xFF2F80ED),
),
const SizedBox(width: 12),
SizedBox(width: 12),
Text(
'Новая запись',
style: TextStyle(
@@ -383,7 +383,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
const Text(
'Дипломы\nи сертификаты',
style: TextStyle(
color: Color(0xFF323F4B),
@@ -394,7 +394,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
widget.author == null ? 'Редактировать' : '',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF2F80ED),
fontSize: 16,
fontWeight: FontWeight.w500,
@@ -417,7 +417,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Row(
children: [
if (state.profile.diplomasAndCertificates != null)
...state.profile.diplomasAndCertificates!.map((d) => _diplomaImage(baseUrl + '/storage/' + d.path)).toList(),
...state.profile.diplomasAndCertificates!.map((d) => _diplomaImage('$baseUrl/storage/${d.path}')),
],
),
),
@@ -457,7 +457,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
_education(ProfileStateLoaded state) {
if (!state.profile.roles.contains('consultant') ||
state.profile.educationResource?.completedCourses == null ||
state.profile.educationResource?.completedCourses?.length == 0) {
(state.profile.educationResource?.completedCourses?.isEmpty ?? false)) {
return const SizedBox.shrink();
}
return Padding(
@@ -469,7 +469,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
const Text(
'Образование',
style: TextStyle(
color: Color(0xFF323F4B),
@@ -479,7 +479,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
widget.author == null ? 'Редактировать' : '',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF2F80ED),
fontSize: 16,
fontWeight: FontWeight.w500,
@@ -499,7 +499,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Column(
children: [
if (state.profile.educationResource?.completedCourses != null)
...state.profile.educationResource!.completedCourses!.map((c) => _educationBlock(c.values.first.title, c.values.first.date)).toList(),
...state.profile.educationResource!.completedCourses!.map((c) => _educationBlock(c.values.first.title, c.values.first.date)),
],
),
),
@@ -514,7 +514,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
return SizedBox(
width: double.infinity,
child: Material(
color: Color(0xFFF6FAFF),
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
child: Padding(
padding: const EdgeInsets.all(12),
@@ -523,7 +523,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
children: [
Text(
title,
style: TextStyle(
style: const TextStyle(
height: 1,
color: Color(0xFF323F4B),
fontWeight: FontWeight.w500,
@@ -533,7 +533,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
const SizedBox(height: 4),
Text(
date,
style: TextStyle(
style: const TextStyle(
height: 1,
color: Color(0xFF6D6F71),
fontWeight: FontWeight.w500,
@@ -613,14 +613,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
width: MediaQuery.of(context).size.width / 3 - (56 / 3),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Color(0xFFF6F6F6),
color: const Color(0xFFF6F6F6),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 16),
child: SvgPicture.asset(
icon,
width: 24,
colorFilter: ColorFilter.mode(Colors.black12, BlendMode.srcIn),
colorFilter: const ColorFilter.mode(Colors.black12, BlendMode.srcIn),
),
),
),
@@ -636,10 +636,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Ink(
padding: const EdgeInsets.all(8),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
const Text(
'Достижения',
style: TextStyle(
color: Color(0xFF6D6F71),
@@ -655,12 +659,12 @@ class _ProfileScreenState extends State<ProfileScreen> {
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,
'$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
)
: CachedNetworkImage(
imageUrl: baseUrl + '/storage/' + state.profile.badges[i].image,
imageUrl: '$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
),
@@ -671,10 +675,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
),
),
);
@@ -688,7 +688,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
InkWell(
onTap: () => GoRouter.of(context).pushNamed(
'subsScreen',
extra: SubType.Subscriptions,
extra: SubType.subscriptions,
pathParameters: {
'slug': state.profile.slug,
},
@@ -697,6 +697,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Ink(
padding: const EdgeInsets.all(8),
width: MediaQuery.of(context).size.width / 2 - 6,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
@@ -704,7 +708,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
const Text(
'Подписки',
style: TextStyle(
color: Color(0xFF6D6F71),
@@ -714,7 +718,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
'${state.profile.subscriptions.length}',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF323F4B),
fontSize: 22,
fontWeight: FontWeight.w700,
@@ -723,22 +727,18 @@ class _ProfileScreenState extends State<ProfileScreen> {
],
),
Padding(
padding: EdgeInsets.only(right: 8),
padding: const EdgeInsets.only(right: 8),
child: _miniAvatars(state.profile.subscriptions.map((e) => e.profilePhotoUrl).toList()),
),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
),
),
SizedBox(width: 4),
const SizedBox(width: 4),
InkWell(
onTap: () => GoRouter.of(context).pushNamed(
'subsScreen',
extra: SubType.Subscribers,
extra: SubType.subscribers,
pathParameters: {
'slug': state.profile.slug,
},
@@ -747,6 +747,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Ink(
padding: const EdgeInsets.all(8),
width: MediaQuery.of(context).size.width / 2 - 6,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
@@ -754,7 +758,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
const Text(
'Подписчики',
style: TextStyle(
color: Color(0xFF6D6F71),
@@ -764,7 +768,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
'${state.profile.subscribers.length}',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF323F4B),
fontSize: 22,
fontWeight: FontWeight.w700,
@@ -773,15 +777,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
],
),
Padding(
padding: EdgeInsets.only(right: 8),
padding: const EdgeInsets.only(right: 8),
child: _miniAvatars(state.profile.subscribers.map((e) => e.profilePhotoUrl).toList()),
),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
),
),
],
@@ -810,14 +810,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
_blogPosts(ProfileStateLoaded state) {
return ListView.separated(
padding: EdgeInsets.symmetric(vertical: 16),
padding: const EdgeInsets.symmetric(vertical: 16),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ProfileBlogPostWidget(
index: index,
profileCubit: profileCubit,
),
separatorBuilder: (context, index) => SizedBox(height: 8),
separatorBuilder: (context, index) => const SizedBox(height: 8),
itemCount: state.blogPosts.length,
);
}
@@ -872,7 +872,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
},
child: const Row(
children: const [
children: [
Icon(Icons.photo_camera),
SizedBox(width: 8),
Text('Фото'),
@@ -890,7 +890,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
},
child: const Row(
children: const [
children: [
Icon(Icons.photo),
SizedBox(width: 8),
Text('Галерея'),
@@ -912,17 +912,17 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
},
itemBuilder: (context) => [
PopupMenuItem(
const PopupMenuItem(
value: 'view',
child: Text('Посмотреть'),
),
if (widget.author == null)
PopupMenuItem(
const PopupMenuItem(
value: 'replace',
child: Text('Заменить'),
),
if (widget.author == null)
PopupMenuItem(
const PopupMenuItem(
value: 'delete',
child: Text('Удалить'),
),
@@ -932,7 +932,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: CircleAvatar(
radius: 32,
foregroundImage: NetworkImage(state.profile.profilePhotoUrl),
backgroundImage: AssetImage('assets/images/no_avatar.png'),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
),
),
),
@@ -941,8 +941,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
state.profileDetails.firstName + ' ' + state.profileDetails.lastName,
style: TextStyle(
'${state.profileDetails.firstName} ${state.profileDetails.lastName}',
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 16,
@@ -963,7 +963,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
const Text(
'Подробнее',
style: TextStyle(
fontSize: 20,
@@ -972,13 +972,13 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
const SizedBox(height: 16),
_additional('Дата рожденя: ', '${state.profileDetails.birthdate}'),
_additional('Дата рожденя: ', state.profileDetails.birthdate),
const SizedBox(height: 12),
_additional('Страна: ', '${state.profileDetails.country}'),
_additional('Страна: ', state.profileDetails.country),
const SizedBox(height: 12),
_additional('Город: ', '${state.profileDetails.city}'),
_additional('Город: ', state.profileDetails.city),
const SizedBox(height: 12),
_additional('Язык общения: ', '${state.profileDetails.lang}'),
_additional('Язык общения: ', state.profileDetails.lang),
const SizedBox(height: 12),
_additional('В Eatvio с: ', '${state.profile.createdAt?.format('d.MM.yyyy', 'ru')}'),
const SizedBox(height: 12),
@@ -987,14 +987,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
);
},
child: Row(
child: const Row(
children: [
Icon(
Icons.info_outline,
size: 20,
color: Color(0xFF6D6F71),
),
const SizedBox(width: 4),
SizedBox(width: 4),
Text(
'Дополнительно',
style: TextStyle(
@@ -1015,7 +1015,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
final box = context.findRenderObject() as RenderBox?;
Share.shareUri(
Uri.parse(
baseUrl + '/ru/profile/' + state.profile.slug,
'$baseUrl/ru/profile/${state.profile.slug}',
),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
@@ -1031,17 +1031,17 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
},
itemBuilder: (context) => [
PopupMenuItem(
const PopupMenuItem(
value: 'share',
child: Text('Поделиться'),
),
if (widget.author != null)
PopupMenuItem(
const PopupMenuItem(
value: 'complain',
child: Text('Пожаловаться'),
),
],
child: Icon(Icons.more_horiz_rounded),
child: const Icon(Icons.more_horiz_rounded),
),
],
),
@@ -1053,7 +1053,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
children: [
Text(
title,
style: TextStyle(
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Color(0xFF6D6F71),
@@ -1061,7 +1061,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
value,
style: TextStyle(
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Color(0xFF323F4B),
@@ -1074,7 +1074,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
_messageAndSubscribe(ProfileStateLoaded state) {
return Row(
children: [
SizedBox(width: 16),
const SizedBox(width: 16),
GestureDetector(
onTap: () async {
GoRouter.of(context).pushNamed(
@@ -1086,7 +1086,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
width: (MediaQuery.of(context).size.width - 40) / 2,
decoration: BoxDecoration(
color: appTheme.blueA400.withValues(alpha: 0.1),
@@ -1100,7 +1100,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
GestureDetector(
onTap: () {
setState(() {
@@ -1110,7 +1110,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
width: (MediaQuery.of(context).size.width - 40) / 2,
decoration: BoxDecoration(
color: !canSub ? Colors.grey.shade200 : appTheme.blueA400,
@@ -1124,7 +1124,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
),
SizedBox(width: 16),
const SizedBox(width: 16),
],
);
}
@@ -1138,14 +1138,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
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),
],
),
@@ -1168,26 +1168,26 @@ class _ProfileScreenState extends State<ProfileScreen> {
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

@@ -8,7 +8,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
enum SubType { Subscribers, Subscriptions }
enum SubType { subscribers, subscriptions }
class SubsScreen extends StatefulWidget {
final SubType subType;
@@ -28,7 +28,7 @@ class _SubsScreenState extends State<SubsScreen> {
@override
Widget build(BuildContext context) {
return BlocProvider<SubCubit>(
create: (BuildContext context) => widget.subType == SubType.Subscriptions
create: (BuildContext context) => widget.subType == SubType.subscriptions
? (sl<SubCubit>()
..getSubscriptions(
widget.slug,
@@ -46,21 +46,21 @@ class _SubsScreenState extends State<SubsScreen> {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: CupertinoSearchTextField(
prefixIcon: Icon(Icons.search),
prefixIcon: const Icon(Icons.search),
placeholder: 'Поиск',
onChanged: (query) {
if (query.length > 2) {
EasyDebounce.debounce(
'searchSubs',
Duration(milliseconds: 300),
const Duration(milliseconds: 300),
() {
widget.subType == SubType.Subscriptions
widget.subType == SubType.subscriptions
? (context.read<SubCubit>().getSubscriptions(widget.slug, query))
: (context.read<SubCubit>().getSubscribers(widget.slug, query));
},
);
} else {
widget.subType == SubType.Subscriptions
widget.subType == SubType.subscriptions
? (context.read<SubCubit>().getSubscriptions(widget.slug))
: (context.read<SubCubit>().getSubscribers(widget.slug));
}
@@ -69,7 +69,7 @@ class _SubsScreenState extends State<SubsScreen> {
),
),
title: Text(
widget.subType == SubType.Subscriptions ? 'Подписки' : 'Подписчики',
widget.subType == SubType.subscriptions ? 'Подписки' : 'Подписчики',
),
),
body: _buildStates(state),
@@ -81,7 +81,7 @@ class _SubsScreenState extends State<SubsScreen> {
_buildStates(SubState state) {
if (state is SubStateLoading) {
return Loader();
return const Loader();
}
if (state is SubStateError) {
return Text(state.errorMessage);

View File

@@ -34,12 +34,12 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
children: [
if (widget.circumferencePoints.isNotEmpty)
Padding(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Text(
'${widget.circumferencePoints.last.chestCircumference}',
style: TextStyle(
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -47,29 +47,29 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
),
if (widget.circumferencePoints.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
margin: const EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
),
if (widget.circumferencePoints.length > 1)
widget.circumferencePoints.last.chestCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].chestCircumference
? Icon(
? const Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
: const Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
),
Text(
'${widget.circumferencePoints.last.waistCircumference}',
style: TextStyle(
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -77,29 +77,29 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
),
if (widget.circumferencePoints.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
margin: const EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
),
if (widget.circumferencePoints.length > 1)
widget.circumferencePoints.last.waistCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].waistCircumference
? Icon(
? const Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
: const Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
),
Text(
'${widget.circumferencePoints.last.hipCircumference}',
style: TextStyle(
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -107,22 +107,22 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
),
if (widget.circumferencePoints.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
margin: const EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
),
if (widget.circumferencePoints.length > 1)
widget.circumferencePoints.last.hipCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].hipCircumference
? Icon(
? const Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
: const Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
@@ -134,33 +134,33 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
alignment: Alignment.center,
children: [
SfCartesianChart(
margin: EdgeInsets.symmetric(horizontal: 8),
margin: const EdgeInsets.symmetric(horizontal: 8),
enableAxisAnimation: true,
plotAreaBorderWidth: 0,
trackballBehavior: TrackballBehavior(
enable: true,
activationMode: ActivationMode.singleTap,
tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
tooltipSettings: InteractiveTooltip(),
tooltipSettings: const InteractiveTooltip(),
lineType: TrackballLineType.vertical,
),
primaryXAxis: DateTimeCategoryAxis(
tickPosition: TickPosition.inside,
majorTickLines: MajorTickLines(
majorTickLines: const MajorTickLines(
size: 0,
),
edgeLabelPlacement: EdgeLabelPlacement.shift,
dateFormat: DateFormat.MMMd('ru'),
labelStyle: TextStyle(
labelStyle: const TextStyle(
color: Colors.grey,
),
majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withValues(alpha: 0.3)),
majorGridLines: MajorGridLines(dashArray: const [1], color: Colors.grey.withValues(alpha: 0.3)),
axisLine: AxisLine(
color: Colors.grey.withValues(alpha: 0.3),
width: 0.4,
),
),
primaryYAxis: NumericAxis(
primaryYAxis: const NumericAxis(
isVisible: false,
labelFormat: '{value} см',
axisLine: AxisLine(
@@ -259,12 +259,12 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
borderRadius: BorderRadius.circular(16),
child: Ink(
width: MediaQuery.of(context).size.width - 32,
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: appTheme.blueA400,
borderRadius: BorderRadius.circular(16),
),
child: Center(
child: const Center(
child: Text(
'Сохранить',
style: TextStyle(
@@ -280,16 +280,16 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
);
},
backgroundColor: appTheme.blueA400,
shape: CircleBorder(),
child: Icon(
shape: const CircleBorder(),
child: const Icon(
Icons.add,
color: Colors.white,
),
),
),
if (widget.circumferencePoints.isEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 48),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 48),
child: Text(
'Добавьте Ваши замеры',
textAlign: TextAlign.center,
@@ -302,19 +302,19 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
}
List<CartesianSeries<CircumferenceModel, DateTime>> _getSplineSeries() {
final Color seriesColor1 = Colors.red;
const Color seriesColor1 = Colors.red;
final Color seriesColor2 = appTheme.blueA400;
final Color seriesColor3 = Colors.green;
const Color seriesColor3 = Colors.green;
return <CartesianSeries<CircumferenceModel, DateTime>>[
SplineAreaSeries<CircumferenceModel, DateTime>(
markerSettings: MarkerSettings(
markerSettings: const MarkerSettings(
isVisible: true,
color: seriesColor1,
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -326,7 +326,7 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'Грудь',
xValueMapper: (CircumferenceModel value, int index) => value.createdAt,
@@ -339,7 +339,7 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -351,20 +351,20 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'Талия',
xValueMapper: (CircumferenceModel value, int index) => value.createdAt,
yValueMapper: (CircumferenceModel value, int index) => value.waistCircumference,
),
SplineAreaSeries<CircumferenceModel, DateTime>(
markerSettings: MarkerSettings(
markerSettings: const MarkerSettings(
isVisible: true,
color: seriesColor3,
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -376,7 +376,7 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'Бёдра',
xValueMapper: (CircumferenceModel value, int index) => value.createdAt,

View File

@@ -21,10 +21,10 @@ class ImtChartWidget extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
if (weightPoints.length > 0)
if (weightPoints.isNotEmpty)
Text(
'${weightPoints.last.bmi.toStringAsFixed(2)}',
style: TextStyle(
weightPoints.last.bmi.toStringAsFixed(2),
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -32,12 +32,12 @@ class ImtChartWidget extends StatelessWidget {
),
if (weightPoints.length > 1)
weightPoints.last.bmi > weightPoints[weightPoints.length - 2].bmi
? Icon(
? const Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
: const Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
@@ -49,41 +49,41 @@ class ImtChartWidget extends StatelessWidget {
alignment: Alignment.center,
children: [
SfCartesianChart(
margin: EdgeInsets.symmetric(horizontal: 8),
margin: const EdgeInsets.symmetric(horizontal: 8),
enableAxisAnimation: true,
plotAreaBorderWidth: 0,
trackballBehavior: TrackballBehavior(
enable: true,
activationMode: ActivationMode.singleTap,
tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
tooltipSettings: InteractiveTooltip(),
tooltipSettings: const InteractiveTooltip(),
lineType: TrackballLineType.vertical,
),
primaryXAxis: DateTimeCategoryAxis(
tickPosition: TickPosition.inside,
majorTickLines: MajorTickLines(
majorTickLines: const MajorTickLines(
size: 0,
),
edgeLabelPlacement: EdgeLabelPlacement.shift,
dateFormat: DateFormat.MMMd('ru'),
labelStyle: TextStyle(
labelStyle: const TextStyle(
color: Colors.grey,
),
majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withValues(alpha: 0.3)),
majorGridLines: MajorGridLines(dashArray: const [1], color: Colors.grey.withValues(alpha: 0.3)),
axisLine: AxisLine(
color: Colors.grey.withValues(alpha: 0.3),
width: 0.4,
),
),
primaryYAxis: NumericAxis(
primaryYAxis: const NumericAxis(
isVisible: false,
),
series: _getSplineSeries(),
tooltipBehavior: TooltipBehavior(enable: true),
),
if (weightPoints.isEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 32),
child: Text(
'Индекс Массы Тела рассчитывается при указанных весе и росте',
textAlign: TextAlign.center,
@@ -104,7 +104,7 @@ class ImtChartWidget extends StatelessWidget {
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -116,7 +116,7 @@ class ImtChartWidget extends StatelessWidget {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'ИМТ',
xValueMapper: (WeightModel value, int index) => value.createdAt,

View File

@@ -57,7 +57,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
@@ -69,13 +69,13 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
state.blogPosts[widget.index].author.authorProfileIcon,
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
state.blogPosts[widget.index].author.authorName,
style: TextStyle(
style: const TextStyle(
height: 1,
color: Colors.black87,
fontWeight: FontWeight.w500,
@@ -84,7 +84,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
const SizedBox(height: 4),
Text(
'${calculateDifference(state.blogPosts[widget.index].createdAt)} в ${state.blogPosts[widget.index].createdAt.hour.toString().padLeft(2, '0')}:${state.blogPosts[widget.index].createdAt.minute.toString().padLeft(2, '0')}',
style: TextStyle(
style: const TextStyle(
height: 1,
color: Colors.black45,
),
@@ -99,19 +99,19 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
],
),
),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) SizedBox(height: 12),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Text(
state.blogPosts[widget.index].title,
style: TextStyle(
style: const TextStyle(
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.black87,
),
),
),
if (state.blogPosts[widget.index].title.isNotEmpty && state.blogPosts[widget.index].description.isNotEmpty) SizedBox(height: 8),
if (state.blogPosts[widget.index].title.isNotEmpty && state.blogPosts[widget.index].description.isNotEmpty) const SizedBox(height: 8),
if (state.blogPosts[widget.index].description.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
@@ -139,28 +139,28 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
),
),
),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) SizedBox(height: 8),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) const SizedBox(height: 8),
GestureDetector(
onTap: () {
context.pushTransparentRoute(
rootNavigator: true,
PhotoViewScreen(
imageUrls: [baseUrl + '/storage/' + state.blogPosts[widget.index].image],
imageUrls: ['$baseUrl/storage/${state.blogPosts[widget.index].image}'],
index: 0,
),
);
},
child: Hero(
tag: baseUrl + '/storage/' + state.blogPosts[widget.index].image,
tag: '$baseUrl/storage/${state.blogPosts[widget.index].image}',
child: CachedNetworkImage(
fit: BoxFit.fitWidth,
width: MediaQuery.of(context).size.width,
imageUrl: baseUrl + '/storage/' + state.blogPosts[widget.index].image,
errorWidget: (context, str, object) => SizedBox.shrink(),
imageUrl: '$baseUrl/storage/${state.blogPosts[widget.index].image}',
errorWidget: (context, str, object) => const SizedBox.shrink(),
),
),
),
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
@@ -185,7 +185,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
);
},
),
SizedBox(width: 8),
const SizedBox(width: 8),
FeedIconButton(
svgIcon: SvgPicture.asset(
'assets/icons/comment.svg',
@@ -202,7 +202,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
extra: state.blogPosts[widget.index],
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
FeedIconButton(
svgIcon: SvgPicture.asset(
height: 20,
@@ -214,19 +214,19 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
final box = context.findRenderObject() as RenderBox?;
Share.shareUri(
Uri.parse(
baseUrl + '/ru/blog_post/' + state.blogPosts[widget.index].id.toString(),
'$baseUrl/ru/blog_post/${state.blogPosts[widget.index].id}',
),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
},
),
Spacer(),
const Spacer(),
Icon(
Icons.visibility_rounded,
size: 16,
color: appTheme.gray500,
),
SizedBox(width: 4),
const SizedBox(width: 4),
Text(
state.blogPosts[widget.index].totalViews.toString(),
style: TextStyle(
@@ -238,7 +238,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
],
),
),
SizedBox(height: 8),
const SizedBox(height: 8),
],
),
),

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
enum SubActionType { SendMessage, Subscribe }
enum SubActionType { sendMessage, subscribe }
class SubActionButtonWidget extends StatefulWidget {
final SubActionType subActionType;
@@ -33,22 +33,22 @@ class _SubActionButtonWidgetState extends State<SubActionButtonWidget> {
@override
Widget build(BuildContext context) {
if (subActionType == SubActionType.Subscribe) {
if (subActionType == SubActionType.subscribe) {
return InkWell(
onTap: () {
context.read<SubCubit>().subscribe(widget.slug);
setState(() {
subActionType = SubActionType.SendMessage;
subActionType = SubActionType.sendMessage;
});
},
borderRadius: BorderRadius.circular(8),
child: Ink(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: appTheme.blueA400,
),
child: Text(
child: const Text(
'Подписаться',
style: TextStyle(
fontSize: 13,
@@ -65,17 +65,17 @@ class _SubActionButtonWidgetState extends State<SubActionButtonWidget> {
'chatScreen',
extra: {
'chatId': await sl<ProfileCubit>().getChatRoomIdBySlug(slug: widget.slug),
},
},
);
},
borderRadius: BorderRadius.circular(8),
child: Ink(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFF1F2F6),
color: const Color(0xFFF1F2F6),
),
child: Text(
child: const Text(
'Сообщение',
style: TextStyle(
fontSize: 13,

View File

@@ -31,7 +31,7 @@ class _SubWidgetState extends State<SubWidget> {
),
),
child: Ink(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: Row(
children: [
CircleAvatar(
@@ -45,7 +45,7 @@ class _SubWidgetState extends State<SubWidget> {
children: [
Text(
widget.subModel.name,
style: TextStyle(
style: const TextStyle(
color: Color(0xFF323F4B),
fontSize: 16,
fontWeight: FontWeight.w600,
@@ -55,7 +55,7 @@ class _SubWidgetState extends State<SubWidget> {
const SizedBox(height: 4),
Text(
'${DateTime.now().year - widget.subModel.birthdate.year - (DateTime.now().isBefore(DateTime(DateTime.now().year, widget.subModel.birthdate.month, widget.subModel.birthdate.day)) ? 1 : 0)} лет, ${widget.subModel.city}',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF6D6F71),
fontSize: 12,
fontWeight: FontWeight.w500,
@@ -66,7 +66,7 @@ class _SubWidgetState extends State<SubWidget> {
),
const Spacer(),
SubActionButtonWidget(
subActionType: widget.subModel.isEntitySubscribedByMe ? SubActionType.SendMessage : SubActionType.Subscribe,
subActionType: widget.subModel.isEntitySubscribedByMe ? SubActionType.sendMessage : SubActionType.subscribe,
slug: widget.subModel.slug,
),
],

View File

@@ -38,7 +38,7 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
children: [
Text(
'${widget.weightPoints.last.weight.toStringAsFixed(1)} кг',
style: TextStyle(
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -46,10 +46,10 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
),
if (widget.weightPoints.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
margin: const EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
@@ -73,33 +73,33 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
alignment: Alignment.center,
children: [
SfCartesianChart(
margin: EdgeInsets.symmetric(horizontal: 8),
margin: const EdgeInsets.symmetric(horizontal: 8),
enableAxisAnimation: true,
plotAreaBorderWidth: 0,
trackballBehavior: TrackballBehavior(
enable: true,
activationMode: ActivationMode.singleTap,
tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
tooltipSettings: InteractiveTooltip(),
tooltipSettings: const InteractiveTooltip(),
lineType: TrackballLineType.vertical,
),
primaryXAxis: DateTimeCategoryAxis(
tickPosition: TickPosition.inside,
majorTickLines: MajorTickLines(
majorTickLines: const MajorTickLines(
size: 0,
),
edgeLabelPlacement: EdgeLabelPlacement.shift,
dateFormat: DateFormat.MMMd('ru'),
labelStyle: TextStyle(
labelStyle: const TextStyle(
color: Colors.grey,
),
majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withValues(alpha: 0.3)),
majorGridLines: MajorGridLines(dashArray: const [1], color: Colors.grey.withValues(alpha: 0.3)),
axisLine: AxisLine(
color: Colors.grey.withValues(alpha: 0.3),
width: 0.4,
),
),
primaryYAxis: NumericAxis(
primaryYAxis: const NumericAxis(
isVisible: false,
labelFormat: '{value} кг',
majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey),
@@ -181,12 +181,12 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
borderRadius: BorderRadius.circular(16),
child: Ink(
width: MediaQuery.of(context).size.width - 32,
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: appTheme.blueA400,
borderRadius: BorderRadius.circular(16),
),
child: Center(
child: const Center(
child: Text(
'Сохранить',
style: TextStyle(
@@ -202,14 +202,14 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
);
},
backgroundColor: appTheme.blueA400,
shape: CircleBorder(),
child: Icon(
shape: const CircleBorder(),
child: const Icon(
Icons.add,
color: Colors.white,
),
),
),
if (widget.weightPoints.isEmpty) Text('Добавьте Ваш вес'),
if (widget.weightPoints.isEmpty) const Text('Добавьте Ваш вес'),
],
),
],
@@ -225,7 +225,7 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -237,7 +237,7 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'Вес',
xValueMapper: (WeightModel value, int index) => value.createdAt,