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

@@ -1,4 +1,4 @@
const List<String> citiesList = const [
const List<String> citiesList = [
"Абаза",
"Абакан",
"Абдулино",

View File

@@ -12,8 +12,7 @@ part of 'location_model.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');
LocationModel _$LocationModelFromJson(Map<String, dynamic> json) {
return _LocationModel.fromJson(json);
@@ -38,14 +37,12 @@ mixin _$LocationModel {
/// @nodoc
abstract class $LocationModelCopyWith<$Res> {
factory $LocationModelCopyWith(
LocationModel value,
$Res Function(LocationModel) then,
) = _$LocationModelCopyWithImpl<$Res, LocationModel>;
LocationModel value, $Res Function(LocationModel) then) =
_$LocationModelCopyWithImpl<$Res, LocationModel>;
@useResult
$Res call({
List<String> locations,
@JsonKey(name: 'response_body') String responseBody,
});
$Res call(
{List<String> locations,
@JsonKey(name: 'response_body') String responseBody});
}
/// @nodoc
@@ -62,22 +59,20 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? locations = null, Object? responseBody = null}) {
return _then(
_value.copyWith(
locations:
null == locations
? _value.locations
: locations // ignore: cast_nullable_to_non_nullable
as List<String>,
responseBody:
null == responseBody
? _value.responseBody
: responseBody // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
$Res call({
Object? locations = null,
Object? responseBody = null,
}) {
return _then(_value.copyWith(
locations: null == locations
? _value.locations
: locations // ignore: cast_nullable_to_non_nullable
as List<String>,
responseBody: null == responseBody
? _value.responseBody
: responseBody // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
@@ -85,15 +80,13 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel>
abstract class _$$LocationModelImplCopyWith<$Res>
implements $LocationModelCopyWith<$Res> {
factory _$$LocationModelImplCopyWith(
_$LocationModelImpl value,
$Res Function(_$LocationModelImpl) then,
) = __$$LocationModelImplCopyWithImpl<$Res>;
_$LocationModelImpl value, $Res Function(_$LocationModelImpl) then) =
__$$LocationModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
List<String> locations,
@JsonKey(name: 'response_body') String responseBody,
});
$Res call(
{List<String> locations,
@JsonKey(name: 'response_body') String responseBody});
}
/// @nodoc
@@ -101,39 +94,37 @@ class __$$LocationModelImplCopyWithImpl<$Res>
extends _$LocationModelCopyWithImpl<$Res, _$LocationModelImpl>
implements _$$LocationModelImplCopyWith<$Res> {
__$$LocationModelImplCopyWithImpl(
_$LocationModelImpl _value,
$Res Function(_$LocationModelImpl) _then,
) : super(_value, _then);
_$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then)
: super(_value, _then);
/// Create a copy of LocationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? locations = null, Object? responseBody = null}) {
return _then(
_$LocationModelImpl(
locations:
null == locations
? _value._locations
: locations // ignore: cast_nullable_to_non_nullable
as List<String>,
responseBody:
null == responseBody
? _value.responseBody
: responseBody // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? locations = null,
Object? responseBody = null,
}) {
return _then(_$LocationModelImpl(
locations: null == locations
? _value._locations
: locations // ignore: cast_nullable_to_non_nullable
as List<String>,
responseBody: null == responseBody
? _value.responseBody
: responseBody // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _$LocationModelImpl implements _LocationModel {
const _$LocationModelImpl({
required final List<String> locations,
@JsonKey(name: 'response_body') required this.responseBody,
}) : _locations = locations;
const _$LocationModelImpl(
{required final List<String> locations,
@JsonKey(name: 'response_body') required this.responseBody})
: _locations = locations;
factory _$LocationModelImpl.fromJson(Map<String, dynamic> json) =>
_$$LocationModelImplFromJson(json);
@@ -160,21 +151,16 @@ class _$LocationModelImpl implements _LocationModel {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$LocationModelImpl &&
const DeepCollectionEquality().equals(
other._locations,
_locations,
) &&
const DeepCollectionEquality()
.equals(other._locations, _locations) &&
(identical(other.responseBody, responseBody) ||
other.responseBody == responseBody));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_locations),
responseBody,
);
int get hashCode => Object.hash(runtimeType,
const DeepCollectionEquality().hash(_locations), responseBody);
/// Create a copy of LocationModel
/// with the given fields replaced by the non-null parameter values.
@@ -186,15 +172,17 @@ class _$LocationModelImpl implements _LocationModel {
@override
Map<String, dynamic> toJson() {
return _$$LocationModelImplToJson(this);
return _$$LocationModelImplToJson(
this,
);
}
}
abstract class _LocationModel implements LocationModel {
const factory _LocationModel({
required final List<String> locations,
@JsonKey(name: 'response_body') required final String responseBody,
}) = _$LocationModelImpl;
const factory _LocationModel(
{required final List<String> locations,
@JsonKey(name: 'response_body') required final String responseBody}) =
_$LocationModelImpl;
factory _LocationModel.fromJson(Map<String, dynamic> json) =
_$LocationModelImpl.fromJson;

View File

@@ -12,12 +12,10 @@ part of 'user_registration_model.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');
UserRegistrationSheet _$UserRegistrationSheetFromJson(
Map<String, dynamic> json,
) {
Map<String, dynamic> json) {
return _UserRegistrationSheet.fromJson(json);
}
@@ -83,48 +81,44 @@ mixin _$UserRegistrationSheet {
/// @nodoc
abstract class $UserRegistrationSheetCopyWith<$Res> {
factory $UserRegistrationSheetCopyWith(
UserRegistrationSheet value,
$Res Function(UserRegistrationSheet) then,
) = _$UserRegistrationSheetCopyWithImpl<$Res, UserRegistrationSheet>;
factory $UserRegistrationSheetCopyWith(UserRegistrationSheet value,
$Res Function(UserRegistrationSheet) then) =
_$UserRegistrationSheetCopyWithImpl<$Res, UserRegistrationSheet>;
@useResult
$Res call({
@JsonKey(name: 'first_name') String firstName,
@JsonKey(name: 'last_name') String lastName,
String email,
String password,
@JsonKey(name: 'password_confirmation') String passwordConfirmation,
@JsonKey(name: 'terms') String termsAccepted,
String birthdate,
String gender,
String location,
@JsonKey(name: 'response_body') String responseBody,
String lang,
int weight,
int height,
String phone,
@JsonKey(name: 'chest_circumference') int chestCircumference,
@JsonKey(name: 'waist_circumference') int waistCircumference,
@JsonKey(name: 'hip_circumference') int hipCircumference,
@JsonKey(name: 'blood_pressure_up') int bloodPressureUp,
@JsonKey(name: 'blood_pressure_down') int bloodPressureDown,
@JsonKey(name: 'has_hypo') int hasHypo,
@JsonKey(name: 'has_hyper') int hasHyper,
@JsonKey(name: 'about_alergy') String aboutAllergy,
@JsonKey(name: 'about_taking_pils') String aboutTakingPils,
@JsonKey(name: 'about_sport_hobbies') String aboutSportHobbies,
@JsonKey(name: 'favorite_foods') String favoriteFoods,
@JsonKey(name: 'unfavorite_foods') String unfavoriteFoods,
@JsonKey(name: 'additional_info') String additionalInfo,
@JsonKey(name: 'activity_coefficient') double activityCoefficient,
});
$Res call(
{@JsonKey(name: 'first_name') String firstName,
@JsonKey(name: 'last_name') String lastName,
String email,
String password,
@JsonKey(name: 'password_confirmation') String passwordConfirmation,
@JsonKey(name: 'terms') String termsAccepted,
String birthdate,
String gender,
String location,
@JsonKey(name: 'response_body') String responseBody,
String lang,
int weight,
int height,
String phone,
@JsonKey(name: 'chest_circumference') int chestCircumference,
@JsonKey(name: 'waist_circumference') int waistCircumference,
@JsonKey(name: 'hip_circumference') int hipCircumference,
@JsonKey(name: 'blood_pressure_up') int bloodPressureUp,
@JsonKey(name: 'blood_pressure_down') int bloodPressureDown,
@JsonKey(name: 'has_hypo') int hasHypo,
@JsonKey(name: 'has_hyper') int hasHyper,
@JsonKey(name: 'about_alergy') String aboutAllergy,
@JsonKey(name: 'about_taking_pils') String aboutTakingPils,
@JsonKey(name: 'about_sport_hobbies') String aboutSportHobbies,
@JsonKey(name: 'favorite_foods') String favoriteFoods,
@JsonKey(name: 'unfavorite_foods') String unfavoriteFoods,
@JsonKey(name: 'additional_info') String additionalInfo,
@JsonKey(name: 'activity_coefficient') double activityCoefficient});
}
/// @nodoc
class _$UserRegistrationSheetCopyWithImpl<
$Res,
$Val extends UserRegistrationSheet
>
class _$UserRegistrationSheetCopyWithImpl<$Res,
$Val extends UserRegistrationSheet>
implements $UserRegistrationSheetCopyWith<$Res> {
_$UserRegistrationSheetCopyWithImpl(this._value, this._then);
@@ -167,151 +161,120 @@ class _$UserRegistrationSheetCopyWithImpl<
Object? additionalInfo = null,
Object? activityCoefficient = null,
}) {
return _then(
_value.copyWith(
firstName:
null == firstName
? _value.firstName
: firstName // ignore: cast_nullable_to_non_nullable
as String,
lastName:
null == lastName
? _value.lastName
: lastName // ignore: cast_nullable_to_non_nullable
as String,
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password:
null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
passwordConfirmation:
null == passwordConfirmation
? _value.passwordConfirmation
: passwordConfirmation // ignore: cast_nullable_to_non_nullable
as String,
termsAccepted:
null == termsAccepted
? _value.termsAccepted
: termsAccepted // ignore: cast_nullable_to_non_nullable
as String,
birthdate:
null == birthdate
? _value.birthdate
: birthdate // ignore: cast_nullable_to_non_nullable
as String,
gender:
null == gender
? _value.gender
: gender // ignore: cast_nullable_to_non_nullable
as String,
location:
null == location
? _value.location
: location // ignore: cast_nullable_to_non_nullable
as String,
responseBody:
null == responseBody
? _value.responseBody
: responseBody // ignore: cast_nullable_to_non_nullable
as String,
lang:
null == lang
? _value.lang
: lang // ignore: cast_nullable_to_non_nullable
as String,
weight:
null == weight
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
height:
null == height
? _value.height
: height // ignore: cast_nullable_to_non_nullable
as int,
phone:
null == phone
? _value.phone
: phone // ignore: cast_nullable_to_non_nullable
as String,
chestCircumference:
null == chestCircumference
? _value.chestCircumference
: chestCircumference // ignore: cast_nullable_to_non_nullable
as int,
waistCircumference:
null == waistCircumference
? _value.waistCircumference
: waistCircumference // ignore: cast_nullable_to_non_nullable
as int,
hipCircumference:
null == hipCircumference
? _value.hipCircumference
: hipCircumference // ignore: cast_nullable_to_non_nullable
as int,
bloodPressureUp:
null == bloodPressureUp
? _value.bloodPressureUp
: bloodPressureUp // ignore: cast_nullable_to_non_nullable
as int,
bloodPressureDown:
null == bloodPressureDown
? _value.bloodPressureDown
: bloodPressureDown // ignore: cast_nullable_to_non_nullable
as int,
hasHypo:
null == hasHypo
? _value.hasHypo
: hasHypo // ignore: cast_nullable_to_non_nullable
as int,
hasHyper:
null == hasHyper
? _value.hasHyper
: hasHyper // ignore: cast_nullable_to_non_nullable
as int,
aboutAllergy:
null == aboutAllergy
? _value.aboutAllergy
: aboutAllergy // ignore: cast_nullable_to_non_nullable
as String,
aboutTakingPils:
null == aboutTakingPils
? _value.aboutTakingPils
: aboutTakingPils // ignore: cast_nullable_to_non_nullable
as String,
aboutSportHobbies:
null == aboutSportHobbies
? _value.aboutSportHobbies
: aboutSportHobbies // ignore: cast_nullable_to_non_nullable
as String,
favoriteFoods:
null == favoriteFoods
? _value.favoriteFoods
: favoriteFoods // ignore: cast_nullable_to_non_nullable
as String,
unfavoriteFoods:
null == unfavoriteFoods
? _value.unfavoriteFoods
: unfavoriteFoods // ignore: cast_nullable_to_non_nullable
as String,
additionalInfo:
null == additionalInfo
? _value.additionalInfo
: additionalInfo // ignore: cast_nullable_to_non_nullable
as String,
activityCoefficient:
null == activityCoefficient
? _value.activityCoefficient
: activityCoefficient // ignore: cast_nullable_to_non_nullable
as double,
)
as $Val,
);
return _then(_value.copyWith(
firstName: null == firstName
? _value.firstName
: firstName // ignore: cast_nullable_to_non_nullable
as String,
lastName: null == lastName
? _value.lastName
: lastName // ignore: cast_nullable_to_non_nullable
as String,
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password: null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
passwordConfirmation: null == passwordConfirmation
? _value.passwordConfirmation
: passwordConfirmation // ignore: cast_nullable_to_non_nullable
as String,
termsAccepted: null == termsAccepted
? _value.termsAccepted
: termsAccepted // ignore: cast_nullable_to_non_nullable
as String,
birthdate: null == birthdate
? _value.birthdate
: birthdate // ignore: cast_nullable_to_non_nullable
as String,
gender: null == gender
? _value.gender
: gender // ignore: cast_nullable_to_non_nullable
as String,
location: null == location
? _value.location
: location // ignore: cast_nullable_to_non_nullable
as String,
responseBody: null == responseBody
? _value.responseBody
: responseBody // ignore: cast_nullable_to_non_nullable
as String,
lang: null == lang
? _value.lang
: lang // ignore: cast_nullable_to_non_nullable
as String,
weight: null == weight
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
height: null == height
? _value.height
: height // ignore: cast_nullable_to_non_nullable
as int,
phone: null == phone
? _value.phone
: phone // ignore: cast_nullable_to_non_nullable
as String,
chestCircumference: null == chestCircumference
? _value.chestCircumference
: chestCircumference // ignore: cast_nullable_to_non_nullable
as int,
waistCircumference: null == waistCircumference
? _value.waistCircumference
: waistCircumference // ignore: cast_nullable_to_non_nullable
as int,
hipCircumference: null == hipCircumference
? _value.hipCircumference
: hipCircumference // ignore: cast_nullable_to_non_nullable
as int,
bloodPressureUp: null == bloodPressureUp
? _value.bloodPressureUp
: bloodPressureUp // ignore: cast_nullable_to_non_nullable
as int,
bloodPressureDown: null == bloodPressureDown
? _value.bloodPressureDown
: bloodPressureDown // ignore: cast_nullable_to_non_nullable
as int,
hasHypo: null == hasHypo
? _value.hasHypo
: hasHypo // ignore: cast_nullable_to_non_nullable
as int,
hasHyper: null == hasHyper
? _value.hasHyper
: hasHyper // ignore: cast_nullable_to_non_nullable
as int,
aboutAllergy: null == aboutAllergy
? _value.aboutAllergy
: aboutAllergy // ignore: cast_nullable_to_non_nullable
as String,
aboutTakingPils: null == aboutTakingPils
? _value.aboutTakingPils
: aboutTakingPils // ignore: cast_nullable_to_non_nullable
as String,
aboutSportHobbies: null == aboutSportHobbies
? _value.aboutSportHobbies
: aboutSportHobbies // ignore: cast_nullable_to_non_nullable
as String,
favoriteFoods: null == favoriteFoods
? _value.favoriteFoods
: favoriteFoods // ignore: cast_nullable_to_non_nullable
as String,
unfavoriteFoods: null == unfavoriteFoods
? _value.unfavoriteFoods
: unfavoriteFoods // ignore: cast_nullable_to_non_nullable
as String,
additionalInfo: null == additionalInfo
? _value.additionalInfo
: additionalInfo // ignore: cast_nullable_to_non_nullable
as String,
activityCoefficient: null == activityCoefficient
? _value.activityCoefficient
: activityCoefficient // ignore: cast_nullable_to_non_nullable
as double,
) as $Val);
}
}
@@ -319,52 +282,50 @@ class _$UserRegistrationSheetCopyWithImpl<
abstract class _$$UserRegistrationSheetImplCopyWith<$Res>
implements $UserRegistrationSheetCopyWith<$Res> {
factory _$$UserRegistrationSheetImplCopyWith(
_$UserRegistrationSheetImpl value,
$Res Function(_$UserRegistrationSheetImpl) then,
) = __$$UserRegistrationSheetImplCopyWithImpl<$Res>;
_$UserRegistrationSheetImpl value,
$Res Function(_$UserRegistrationSheetImpl) then) =
__$$UserRegistrationSheetImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: 'first_name') String firstName,
@JsonKey(name: 'last_name') String lastName,
String email,
String password,
@JsonKey(name: 'password_confirmation') String passwordConfirmation,
@JsonKey(name: 'terms') String termsAccepted,
String birthdate,
String gender,
String location,
@JsonKey(name: 'response_body') String responseBody,
String lang,
int weight,
int height,
String phone,
@JsonKey(name: 'chest_circumference') int chestCircumference,
@JsonKey(name: 'waist_circumference') int waistCircumference,
@JsonKey(name: 'hip_circumference') int hipCircumference,
@JsonKey(name: 'blood_pressure_up') int bloodPressureUp,
@JsonKey(name: 'blood_pressure_down') int bloodPressureDown,
@JsonKey(name: 'has_hypo') int hasHypo,
@JsonKey(name: 'has_hyper') int hasHyper,
@JsonKey(name: 'about_alergy') String aboutAllergy,
@JsonKey(name: 'about_taking_pils') String aboutTakingPils,
@JsonKey(name: 'about_sport_hobbies') String aboutSportHobbies,
@JsonKey(name: 'favorite_foods') String favoriteFoods,
@JsonKey(name: 'unfavorite_foods') String unfavoriteFoods,
@JsonKey(name: 'additional_info') String additionalInfo,
@JsonKey(name: 'activity_coefficient') double activityCoefficient,
});
$Res call(
{@JsonKey(name: 'first_name') String firstName,
@JsonKey(name: 'last_name') String lastName,
String email,
String password,
@JsonKey(name: 'password_confirmation') String passwordConfirmation,
@JsonKey(name: 'terms') String termsAccepted,
String birthdate,
String gender,
String location,
@JsonKey(name: 'response_body') String responseBody,
String lang,
int weight,
int height,
String phone,
@JsonKey(name: 'chest_circumference') int chestCircumference,
@JsonKey(name: 'waist_circumference') int waistCircumference,
@JsonKey(name: 'hip_circumference') int hipCircumference,
@JsonKey(name: 'blood_pressure_up') int bloodPressureUp,
@JsonKey(name: 'blood_pressure_down') int bloodPressureDown,
@JsonKey(name: 'has_hypo') int hasHypo,
@JsonKey(name: 'has_hyper') int hasHyper,
@JsonKey(name: 'about_alergy') String aboutAllergy,
@JsonKey(name: 'about_taking_pils') String aboutTakingPils,
@JsonKey(name: 'about_sport_hobbies') String aboutSportHobbies,
@JsonKey(name: 'favorite_foods') String favoriteFoods,
@JsonKey(name: 'unfavorite_foods') String unfavoriteFoods,
@JsonKey(name: 'additional_info') String additionalInfo,
@JsonKey(name: 'activity_coefficient') double activityCoefficient});
}
/// @nodoc
class __$$UserRegistrationSheetImplCopyWithImpl<$Res>
extends
_$UserRegistrationSheetCopyWithImpl<$Res, _$UserRegistrationSheetImpl>
extends _$UserRegistrationSheetCopyWithImpl<$Res,
_$UserRegistrationSheetImpl>
implements _$$UserRegistrationSheetImplCopyWith<$Res> {
__$$UserRegistrationSheetImplCopyWithImpl(
_$UserRegistrationSheetImpl _value,
$Res Function(_$UserRegistrationSheetImpl) _then,
) : super(_value, _then);
__$$UserRegistrationSheetImplCopyWithImpl(_$UserRegistrationSheetImpl _value,
$Res Function(_$UserRegistrationSheetImpl) _then)
: super(_value, _then);
/// Create a copy of UserRegistrationSheet
/// with the given fields replaced by the non-null parameter values.
@@ -400,186 +361,156 @@ class __$$UserRegistrationSheetImplCopyWithImpl<$Res>
Object? additionalInfo = null,
Object? activityCoefficient = null,
}) {
return _then(
_$UserRegistrationSheetImpl(
firstName:
null == firstName
? _value.firstName
: firstName // ignore: cast_nullable_to_non_nullable
as String,
lastName:
null == lastName
? _value.lastName
: lastName // ignore: cast_nullable_to_non_nullable
as String,
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password:
null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
passwordConfirmation:
null == passwordConfirmation
? _value.passwordConfirmation
: passwordConfirmation // ignore: cast_nullable_to_non_nullable
as String,
termsAccepted:
null == termsAccepted
? _value.termsAccepted
: termsAccepted // ignore: cast_nullable_to_non_nullable
as String,
birthdate:
null == birthdate
? _value.birthdate
: birthdate // ignore: cast_nullable_to_non_nullable
as String,
gender:
null == gender
? _value.gender
: gender // ignore: cast_nullable_to_non_nullable
as String,
location:
null == location
? _value.location
: location // ignore: cast_nullable_to_non_nullable
as String,
responseBody:
null == responseBody
? _value.responseBody
: responseBody // ignore: cast_nullable_to_non_nullable
as String,
lang:
null == lang
? _value.lang
: lang // ignore: cast_nullable_to_non_nullable
as String,
weight:
null == weight
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
height:
null == height
? _value.height
: height // ignore: cast_nullable_to_non_nullable
as int,
phone:
null == phone
? _value.phone
: phone // ignore: cast_nullable_to_non_nullable
as String,
chestCircumference:
null == chestCircumference
? _value.chestCircumference
: chestCircumference // ignore: cast_nullable_to_non_nullable
as int,
waistCircumference:
null == waistCircumference
? _value.waistCircumference
: waistCircumference // ignore: cast_nullable_to_non_nullable
as int,
hipCircumference:
null == hipCircumference
? _value.hipCircumference
: hipCircumference // ignore: cast_nullable_to_non_nullable
as int,
bloodPressureUp:
null == bloodPressureUp
? _value.bloodPressureUp
: bloodPressureUp // ignore: cast_nullable_to_non_nullable
as int,
bloodPressureDown:
null == bloodPressureDown
? _value.bloodPressureDown
: bloodPressureDown // ignore: cast_nullable_to_non_nullable
as int,
hasHypo:
null == hasHypo
? _value.hasHypo
: hasHypo // ignore: cast_nullable_to_non_nullable
as int,
hasHyper:
null == hasHyper
? _value.hasHyper
: hasHyper // ignore: cast_nullable_to_non_nullable
as int,
aboutAllergy:
null == aboutAllergy
? _value.aboutAllergy
: aboutAllergy // ignore: cast_nullable_to_non_nullable
as String,
aboutTakingPils:
null == aboutTakingPils
? _value.aboutTakingPils
: aboutTakingPils // ignore: cast_nullable_to_non_nullable
as String,
aboutSportHobbies:
null == aboutSportHobbies
? _value.aboutSportHobbies
: aboutSportHobbies // ignore: cast_nullable_to_non_nullable
as String,
favoriteFoods:
null == favoriteFoods
? _value.favoriteFoods
: favoriteFoods // ignore: cast_nullable_to_non_nullable
as String,
unfavoriteFoods:
null == unfavoriteFoods
? _value.unfavoriteFoods
: unfavoriteFoods // ignore: cast_nullable_to_non_nullable
as String,
additionalInfo:
null == additionalInfo
? _value.additionalInfo
: additionalInfo // ignore: cast_nullable_to_non_nullable
as String,
activityCoefficient:
null == activityCoefficient
? _value.activityCoefficient
: activityCoefficient // ignore: cast_nullable_to_non_nullable
as double,
),
);
return _then(_$UserRegistrationSheetImpl(
firstName: null == firstName
? _value.firstName
: firstName // ignore: cast_nullable_to_non_nullable
as String,
lastName: null == lastName
? _value.lastName
: lastName // ignore: cast_nullable_to_non_nullable
as String,
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password: null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
passwordConfirmation: null == passwordConfirmation
? _value.passwordConfirmation
: passwordConfirmation // ignore: cast_nullable_to_non_nullable
as String,
termsAccepted: null == termsAccepted
? _value.termsAccepted
: termsAccepted // ignore: cast_nullable_to_non_nullable
as String,
birthdate: null == birthdate
? _value.birthdate
: birthdate // ignore: cast_nullable_to_non_nullable
as String,
gender: null == gender
? _value.gender
: gender // ignore: cast_nullable_to_non_nullable
as String,
location: null == location
? _value.location
: location // ignore: cast_nullable_to_non_nullable
as String,
responseBody: null == responseBody
? _value.responseBody
: responseBody // ignore: cast_nullable_to_non_nullable
as String,
lang: null == lang
? _value.lang
: lang // ignore: cast_nullable_to_non_nullable
as String,
weight: null == weight
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
height: null == height
? _value.height
: height // ignore: cast_nullable_to_non_nullable
as int,
phone: null == phone
? _value.phone
: phone // ignore: cast_nullable_to_non_nullable
as String,
chestCircumference: null == chestCircumference
? _value.chestCircumference
: chestCircumference // ignore: cast_nullable_to_non_nullable
as int,
waistCircumference: null == waistCircumference
? _value.waistCircumference
: waistCircumference // ignore: cast_nullable_to_non_nullable
as int,
hipCircumference: null == hipCircumference
? _value.hipCircumference
: hipCircumference // ignore: cast_nullable_to_non_nullable
as int,
bloodPressureUp: null == bloodPressureUp
? _value.bloodPressureUp
: bloodPressureUp // ignore: cast_nullable_to_non_nullable
as int,
bloodPressureDown: null == bloodPressureDown
? _value.bloodPressureDown
: bloodPressureDown // ignore: cast_nullable_to_non_nullable
as int,
hasHypo: null == hasHypo
? _value.hasHypo
: hasHypo // ignore: cast_nullable_to_non_nullable
as int,
hasHyper: null == hasHyper
? _value.hasHyper
: hasHyper // ignore: cast_nullable_to_non_nullable
as int,
aboutAllergy: null == aboutAllergy
? _value.aboutAllergy
: aboutAllergy // ignore: cast_nullable_to_non_nullable
as String,
aboutTakingPils: null == aboutTakingPils
? _value.aboutTakingPils
: aboutTakingPils // ignore: cast_nullable_to_non_nullable
as String,
aboutSportHobbies: null == aboutSportHobbies
? _value.aboutSportHobbies
: aboutSportHobbies // ignore: cast_nullable_to_non_nullable
as String,
favoriteFoods: null == favoriteFoods
? _value.favoriteFoods
: favoriteFoods // ignore: cast_nullable_to_non_nullable
as String,
unfavoriteFoods: null == unfavoriteFoods
? _value.unfavoriteFoods
: unfavoriteFoods // ignore: cast_nullable_to_non_nullable
as String,
additionalInfo: null == additionalInfo
? _value.additionalInfo
: additionalInfo // ignore: cast_nullable_to_non_nullable
as String,
activityCoefficient: null == activityCoefficient
? _value.activityCoefficient
: activityCoefficient // ignore: cast_nullable_to_non_nullable
as double,
));
}
}
/// @nodoc
@JsonSerializable()
class _$UserRegistrationSheetImpl implements _UserRegistrationSheet {
const _$UserRegistrationSheetImpl({
@JsonKey(name: 'first_name') required this.firstName,
@JsonKey(name: 'last_name') required this.lastName,
required this.email,
required this.password,
@JsonKey(name: 'password_confirmation') required this.passwordConfirmation,
@JsonKey(name: 'terms') this.termsAccepted = 'accepted',
required this.birthdate,
required this.gender,
required this.location,
@JsonKey(name: 'response_body') required this.responseBody,
required this.lang,
required this.weight,
required this.height,
required this.phone,
@JsonKey(name: 'chest_circumference') required this.chestCircumference,
@JsonKey(name: 'waist_circumference') required this.waistCircumference,
@JsonKey(name: 'hip_circumference') required this.hipCircumference,
@JsonKey(name: 'blood_pressure_up') required this.bloodPressureUp,
@JsonKey(name: 'blood_pressure_down') required this.bloodPressureDown,
@JsonKey(name: 'has_hypo') required this.hasHypo,
@JsonKey(name: 'has_hyper') required this.hasHyper,
@JsonKey(name: 'about_alergy') required this.aboutAllergy,
@JsonKey(name: 'about_taking_pils') required this.aboutTakingPils,
@JsonKey(name: 'about_sport_hobbies') required this.aboutSportHobbies,
@JsonKey(name: 'favorite_foods') required this.favoriteFoods,
@JsonKey(name: 'unfavorite_foods') required this.unfavoriteFoods,
@JsonKey(name: 'additional_info') required this.additionalInfo,
@JsonKey(name: 'activity_coefficient') this.activityCoefficient = 1.2,
});
const _$UserRegistrationSheetImpl(
{@JsonKey(name: 'first_name') required this.firstName,
@JsonKey(name: 'last_name') required this.lastName,
required this.email,
required this.password,
@JsonKey(name: 'password_confirmation')
required this.passwordConfirmation,
@JsonKey(name: 'terms') this.termsAccepted = 'accepted',
required this.birthdate,
required this.gender,
required this.location,
@JsonKey(name: 'response_body') required this.responseBody,
required this.lang,
required this.weight,
required this.height,
required this.phone,
@JsonKey(name: 'chest_circumference') required this.chestCircumference,
@JsonKey(name: 'waist_circumference') required this.waistCircumference,
@JsonKey(name: 'hip_circumference') required this.hipCircumference,
@JsonKey(name: 'blood_pressure_up') required this.bloodPressureUp,
@JsonKey(name: 'blood_pressure_down') required this.bloodPressureDown,
@JsonKey(name: 'has_hypo') required this.hasHypo,
@JsonKey(name: 'has_hyper') required this.hasHyper,
@JsonKey(name: 'about_alergy') required this.aboutAllergy,
@JsonKey(name: 'about_taking_pils') required this.aboutTakingPils,
@JsonKey(name: 'about_sport_hobbies') required this.aboutSportHobbies,
@JsonKey(name: 'favorite_foods') required this.favoriteFoods,
@JsonKey(name: 'unfavorite_foods') required this.unfavoriteFoods,
@JsonKey(name: 'additional_info') required this.additionalInfo,
@JsonKey(name: 'activity_coefficient') this.activityCoefficient = 1.2});
factory _$UserRegistrationSheetImpl.fromJson(Map<String, dynamic> json) =>
_$$UserRegistrationSheetImplFromJson(json);
@@ -724,36 +655,36 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([
runtimeType,
firstName,
lastName,
email,
password,
passwordConfirmation,
termsAccepted,
birthdate,
gender,
location,
responseBody,
lang,
weight,
height,
phone,
chestCircumference,
waistCircumference,
hipCircumference,
bloodPressureUp,
bloodPressureDown,
hasHypo,
hasHyper,
aboutAllergy,
aboutTakingPils,
aboutSportHobbies,
favoriteFoods,
unfavoriteFoods,
additionalInfo,
activityCoefficient,
]);
runtimeType,
firstName,
lastName,
email,
password,
passwordConfirmation,
termsAccepted,
birthdate,
gender,
location,
responseBody,
lang,
weight,
height,
phone,
chestCircumference,
waistCircumference,
hipCircumference,
bloodPressureUp,
bloodPressureDown,
hasHypo,
hasHyper,
aboutAllergy,
aboutTakingPils,
aboutSportHobbies,
favoriteFoods,
unfavoriteFoods,
additionalInfo,
activityCoefficient
]);
/// Create a copy of UserRegistrationSheet
/// with the given fields replaced by the non-null parameter values.
@@ -761,51 +692,53 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet {
@override
@pragma('vm:prefer-inline')
_$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl>
get copyWith =>
__$$UserRegistrationSheetImplCopyWithImpl<_$UserRegistrationSheetImpl>(
this,
_$identity,
);
get copyWith => __$$UserRegistrationSheetImplCopyWithImpl<
_$UserRegistrationSheetImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$UserRegistrationSheetImplToJson(this);
return _$$UserRegistrationSheetImplToJson(
this,
);
}
}
abstract class _UserRegistrationSheet implements UserRegistrationSheet {
const factory _UserRegistrationSheet({
@JsonKey(name: 'first_name') required final String firstName,
@JsonKey(name: 'last_name') required final String lastName,
required final String email,
required final String password,
@JsonKey(name: 'password_confirmation')
required final String passwordConfirmation,
@JsonKey(name: 'terms') final String termsAccepted,
required final String birthdate,
required final String gender,
required final String location,
@JsonKey(name: 'response_body') required final String responseBody,
required final String lang,
required final int weight,
required final int height,
required final String phone,
@JsonKey(name: 'chest_circumference') required final int chestCircumference,
@JsonKey(name: 'waist_circumference') required final int waistCircumference,
@JsonKey(name: 'hip_circumference') required final int hipCircumference,
@JsonKey(name: 'blood_pressure_up') required final int bloodPressureUp,
@JsonKey(name: 'blood_pressure_down') required final int bloodPressureDown,
@JsonKey(name: 'has_hypo') required final int hasHypo,
@JsonKey(name: 'has_hyper') required final int hasHyper,
@JsonKey(name: 'about_alergy') required final String aboutAllergy,
@JsonKey(name: 'about_taking_pils') required final String aboutTakingPils,
@JsonKey(name: 'about_sport_hobbies')
required final String aboutSportHobbies,
@JsonKey(name: 'favorite_foods') required final String favoriteFoods,
@JsonKey(name: 'unfavorite_foods') required final String unfavoriteFoods,
@JsonKey(name: 'additional_info') required final String additionalInfo,
@JsonKey(name: 'activity_coefficient') final double activityCoefficient,
}) = _$UserRegistrationSheetImpl;
const factory _UserRegistrationSheet(
{@JsonKey(name: 'first_name') required final String firstName,
@JsonKey(name: 'last_name') required final String lastName,
required final String email,
required final String password,
@JsonKey(name: 'password_confirmation')
required final String passwordConfirmation,
@JsonKey(name: 'terms') final String termsAccepted,
required final String birthdate,
required final String gender,
required final String location,
@JsonKey(name: 'response_body') required final String responseBody,
required final String lang,
required final int weight,
required final int height,
required final String phone,
@JsonKey(name: 'chest_circumference')
required final int chestCircumference,
@JsonKey(name: 'waist_circumference')
required final int waistCircumference,
@JsonKey(name: 'hip_circumference') required final int hipCircumference,
@JsonKey(name: 'blood_pressure_up') required final int bloodPressureUp,
@JsonKey(name: 'blood_pressure_down')
required final int bloodPressureDown,
@JsonKey(name: 'has_hypo') required final int hasHypo,
@JsonKey(name: 'has_hyper') required final int hasHyper,
@JsonKey(name: 'about_alergy') required final String aboutAllergy,
@JsonKey(name: 'about_taking_pils') required final String aboutTakingPils,
@JsonKey(name: 'about_sport_hobbies')
required final String aboutSportHobbies,
@JsonKey(name: 'favorite_foods') required final String favoriteFoods,
@JsonKey(name: 'unfavorite_foods') required final String unfavoriteFoods,
@JsonKey(name: 'additional_info') required final String additionalInfo,
@JsonKey(name: 'activity_coefficient')
final double activityCoefficient}) = _$UserRegistrationSheetImpl;
factory _UserRegistrationSheet.fromJson(Map<String, dynamic> json) =
_$UserRegistrationSheetImpl.fromJson;
@@ -891,5 +824,5 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet {
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -7,68 +7,68 @@ part of 'user_registration_model.dart';
// **************************************************************************
_$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(
Map<String, dynamic> json,
) => _$UserRegistrationSheetImpl(
firstName: json['first_name'] as String,
lastName: json['last_name'] as String,
email: json['email'] as String,
password: json['password'] as String,
passwordConfirmation: json['password_confirmation'] as String,
termsAccepted: json['terms'] as String? ?? 'accepted',
birthdate: json['birthdate'] as String,
gender: json['gender'] as String,
location: json['location'] as String,
responseBody: json['response_body'] as String,
lang: json['lang'] as String,
weight: (json['weight'] as num).toInt(),
height: (json['height'] as num).toInt(),
phone: json['phone'] as String,
chestCircumference: (json['chest_circumference'] as num).toInt(),
waistCircumference: (json['waist_circumference'] as num).toInt(),
hipCircumference: (json['hip_circumference'] as num).toInt(),
bloodPressureUp: (json['blood_pressure_up'] as num).toInt(),
bloodPressureDown: (json['blood_pressure_down'] as num).toInt(),
hasHypo: (json['has_hypo'] as num).toInt(),
hasHyper: (json['has_hyper'] as num).toInt(),
aboutAllergy: json['about_alergy'] as String,
aboutTakingPils: json['about_taking_pils'] as String,
aboutSportHobbies: json['about_sport_hobbies'] as String,
favoriteFoods: json['favorite_foods'] as String,
unfavoriteFoods: json['unfavorite_foods'] as String,
additionalInfo: json['additional_info'] as String,
activityCoefficient:
(json['activity_coefficient'] as num?)?.toDouble() ?? 1.2,
);
Map<String, dynamic> json) =>
_$UserRegistrationSheetImpl(
firstName: json['first_name'] as String,
lastName: json['last_name'] as String,
email: json['email'] as String,
password: json['password'] as String,
passwordConfirmation: json['password_confirmation'] as String,
termsAccepted: json['terms'] as String? ?? 'accepted',
birthdate: json['birthdate'] as String,
gender: json['gender'] as String,
location: json['location'] as String,
responseBody: json['response_body'] as String,
lang: json['lang'] as String,
weight: (json['weight'] as num).toInt(),
height: (json['height'] as num).toInt(),
phone: json['phone'] as String,
chestCircumference: (json['chest_circumference'] as num).toInt(),
waistCircumference: (json['waist_circumference'] as num).toInt(),
hipCircumference: (json['hip_circumference'] as num).toInt(),
bloodPressureUp: (json['blood_pressure_up'] as num).toInt(),
bloodPressureDown: (json['blood_pressure_down'] as num).toInt(),
hasHypo: (json['has_hypo'] as num).toInt(),
hasHyper: (json['has_hyper'] as num).toInt(),
aboutAllergy: json['about_alergy'] as String,
aboutTakingPils: json['about_taking_pils'] as String,
aboutSportHobbies: json['about_sport_hobbies'] as String,
favoriteFoods: json['favorite_foods'] as String,
unfavoriteFoods: json['unfavorite_foods'] as String,
additionalInfo: json['additional_info'] as String,
activityCoefficient:
(json['activity_coefficient'] as num?)?.toDouble() ?? 1.2,
);
Map<String, dynamic> _$$UserRegistrationSheetImplToJson(
_$UserRegistrationSheetImpl instance,
) => <String, dynamic>{
'first_name': instance.firstName,
'last_name': instance.lastName,
'email': instance.email,
'password': instance.password,
'password_confirmation': instance.passwordConfirmation,
'terms': instance.termsAccepted,
'birthdate': instance.birthdate,
'gender': instance.gender,
'location': instance.location,
'response_body': instance.responseBody,
'lang': instance.lang,
'weight': instance.weight,
'height': instance.height,
'phone': instance.phone,
'chest_circumference': instance.chestCircumference,
'waist_circumference': instance.waistCircumference,
'hip_circumference': instance.hipCircumference,
'blood_pressure_up': instance.bloodPressureUp,
'blood_pressure_down': instance.bloodPressureDown,
'has_hypo': instance.hasHypo,
'has_hyper': instance.hasHyper,
'about_alergy': instance.aboutAllergy,
'about_taking_pils': instance.aboutTakingPils,
'about_sport_hobbies': instance.aboutSportHobbies,
'favorite_foods': instance.favoriteFoods,
'unfavorite_foods': instance.unfavoriteFoods,
'additional_info': instance.additionalInfo,
'activity_coefficient': instance.activityCoefficient,
};
_$UserRegistrationSheetImpl instance) =>
<String, dynamic>{
'first_name': instance.firstName,
'last_name': instance.lastName,
'email': instance.email,
'password': instance.password,
'password_confirmation': instance.passwordConfirmation,
'terms': instance.termsAccepted,
'birthdate': instance.birthdate,
'gender': instance.gender,
'location': instance.location,
'response_body': instance.responseBody,
'lang': instance.lang,
'weight': instance.weight,
'height': instance.height,
'phone': instance.phone,
'chest_circumference': instance.chestCircumference,
'waist_circumference': instance.waistCircumference,
'hip_circumference': instance.hipCircumference,
'blood_pressure_up': instance.bloodPressureUp,
'blood_pressure_down': instance.bloodPressureDown,
'has_hypo': instance.hasHypo,
'has_hyper': instance.hasHyper,
'about_alergy': instance.aboutAllergy,
'about_taking_pils': instance.aboutTakingPils,
'about_sport_hobbies': instance.aboutSportHobbies,
'favorite_foods': instance.favoriteFoods,
'unfavorite_foods': instance.unfavoriteFoods,
'additional_info': instance.additionalInfo,
'activity_coefficient': instance.activityCoefficient,
};

View File

@@ -15,7 +15,7 @@ class RegistrationCubit extends Cubit<RegistrationState> {
RegistrationCubit({
required this.registrationRepository,
}) : super(
RegistrationState(
const RegistrationState(
sheet: UserRegistrationSheet(
firstName: '',
lastName: '',

View File

@@ -12,8 +12,7 @@ part of 'registration_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 _$RegistrationState {
@@ -29,9 +28,8 @@ mixin _$RegistrationState {
/// @nodoc
abstract class $RegistrationStateCopyWith<$Res> {
factory $RegistrationStateCopyWith(
RegistrationState value,
$Res Function(RegistrationState) then,
) = _$RegistrationStateCopyWithImpl<$Res, RegistrationState>;
RegistrationState value, $Res Function(RegistrationState) then) =
_$RegistrationStateCopyWithImpl<$Res, RegistrationState>;
@useResult
$Res call({UserRegistrationSheet sheet});
@@ -52,17 +50,15 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? sheet = null}) {
return _then(
_value.copyWith(
sheet:
null == sheet
? _value.sheet
: sheet // ignore: cast_nullable_to_non_nullable
as UserRegistrationSheet,
)
as $Val,
);
$Res call({
Object? sheet = null,
}) {
return _then(_value.copyWith(
sheet: null == sheet
? _value.sheet
: sheet // ignore: cast_nullable_to_non_nullable
as UserRegistrationSheet,
) as $Val);
}
/// Create a copy of RegistrationState
@@ -79,10 +75,9 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState>
/// @nodoc
abstract class _$$RegistrationStateImplCopyWith<$Res>
implements $RegistrationStateCopyWith<$Res> {
factory _$$RegistrationStateImplCopyWith(
_$RegistrationStateImpl value,
$Res Function(_$RegistrationStateImpl) then,
) = __$$RegistrationStateImplCopyWithImpl<$Res>;
factory _$$RegistrationStateImplCopyWith(_$RegistrationStateImpl value,
$Res Function(_$RegistrationStateImpl) then) =
__$$RegistrationStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({UserRegistrationSheet sheet});
@@ -95,25 +90,23 @@ abstract class _$$RegistrationStateImplCopyWith<$Res>
class __$$RegistrationStateImplCopyWithImpl<$Res>
extends _$RegistrationStateCopyWithImpl<$Res, _$RegistrationStateImpl>
implements _$$RegistrationStateImplCopyWith<$Res> {
__$$RegistrationStateImplCopyWithImpl(
_$RegistrationStateImpl _value,
$Res Function(_$RegistrationStateImpl) _then,
) : super(_value, _then);
__$$RegistrationStateImplCopyWithImpl(_$RegistrationStateImpl _value,
$Res Function(_$RegistrationStateImpl) _then)
: super(_value, _then);
/// Create a copy of RegistrationState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? sheet = null}) {
return _then(
_$RegistrationStateImpl(
sheet:
null == sheet
? _value.sheet
: sheet // ignore: cast_nullable_to_non_nullable
as UserRegistrationSheet,
),
);
$Res call({
Object? sheet = null,
}) {
return _then(_$RegistrationStateImpl(
sheet: null == sheet
? _value.sheet
: sheet // ignore: cast_nullable_to_non_nullable
as UserRegistrationSheet,
));
}
}
@@ -148,15 +141,12 @@ class _$RegistrationStateImpl implements _RegistrationState {
@pragma('vm:prefer-inline')
_$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith =>
__$$RegistrationStateImplCopyWithImpl<_$RegistrationStateImpl>(
this,
_$identity,
);
this, _$identity);
}
abstract class _RegistrationState implements RegistrationState {
const factory _RegistrationState({
required final UserRegistrationSheet sheet,
}) = _$RegistrationStateImpl;
const factory _RegistrationState(
{required final UserRegistrationSheet sheet}) = _$RegistrationStateImpl;
@override
UserRegistrationSheet get sheet;

View File

@@ -28,23 +28,23 @@ class _AdditionalInformationScreenState extends State<AdditionalInformationScree
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
const Text(
'Дополнительная информация (не обязательно)',
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.start,
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
controller: editTextController,
textInputAction: TextInputAction.done,
maxLines: 8,
inputFormatters: [
new LengthLimitingTextInputFormatter(250),
LengthLimitingTextInputFormatter(250),
],
focusNode: editFocusNode,
autofocus: true,

View File

@@ -29,12 +29,12 @@ class _AllergiesScreenState extends State<AllergiesScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.allergies_presence + ' (не обязательно)'),
SizedBox(height: 4),
Text('${s.allergies_presence} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
controller: enterInformationController,
hintText: 'Например: орехи, мёд и т.д.',

View File

@@ -20,11 +20,11 @@ class BloodPressureScreen extends StatefulWidget {
class _BloodPressureScreenState extends State<BloodPressureScreen> {
final List<SelectionPopupModel> selectionPopupList = [
SelectionPopupModel(
const SelectionPopupModel(
id: 1,
title: "Да",
),
SelectionPopupModel(
const SelectionPopupModel(
id: 0,
title: "Нет",
),
@@ -54,12 +54,12 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.up_pressure + ' (не обязательно)'),
SizedBox(height: 4),
Text('${s.up_pressure} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
inputFormatters: [digitsOnly],
controller: upPressureController,
@@ -71,9 +71,9 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(bloodPressureUp: int.parse(newValue)));
},
),
SizedBox(height: 16),
Text(s.down_pressure + ' (не обязательно)'),
SizedBox(height: 4),
const SizedBox(height: 16),
Text('${s.down_pressure} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
inputFormatters: [digitsOnly],
controller: downPressureController,
@@ -83,12 +83,12 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(bloodPressureDown: int.parse(newValue)));
},
),
SizedBox(height: 16),
Text(s.do_you_have_hypotension_tendency + ' (не обязательно)'),
SizedBox(height: 4),
const SizedBox(height: 16),
Text('${s.do_you_have_hypotension_tendency} (не обязательно)'),
const SizedBox(height: 4),
CustomDropDown(
icon: Container(
margin: EdgeInsets.all(16),
margin: const EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
),
@@ -109,12 +109,12 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
});
},
),
SizedBox(height: 16),
Text(s.do_you_have_hypertension_tendency + ' (не обязательно)'),
SizedBox(height: 4),
const SizedBox(height: 16),
Text('${s.do_you_have_hypertension_tendency} (не обязательно)'),
const SizedBox(height: 4),
CustomDropDown(
icon: Container(
margin: EdgeInsets.all(16),
margin: const EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
),

View File

@@ -35,12 +35,12 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.chest_circumference + ' (не обязательно)'),
SizedBox(height: 4),
Text('${s.chest_circumference} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
inputFormatters: [digitsOnly],
autofocus: true,
@@ -52,9 +52,9 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(chestCircumference: int.parse(value)));
},
),
SizedBox(height: 16),
Text(s.waist_circumference + ' (не обязательно)'),
SizedBox(height: 4),
const SizedBox(height: 16),
Text('${s.waist_circumference} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
inputFormatters: [digitsOnly],
controller: waistCircumferenceController,
@@ -64,9 +64,9 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(waistCircumference: int.parse(value)));
},
),
SizedBox(height: 16),
Text(s.hip_circumference + ' (не обязательно)'),
SizedBox(height: 4),
const SizedBox(height: 16),
Text('${s.hip_circumference} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
inputFormatters: [digitsOnly],
controller: hipCircumferenceController,

View File

@@ -18,7 +18,7 @@ class CityOfLivingScreen extends StatefulWidget {
class _CityOfLivingScreenState extends State<CityOfLivingScreen> {
final dropdownItemList = [
SelectionPopupModel(id: 1, title: "Россия", isSelected: true),
const SelectionPopupModel(id: 1, title: "Россия", isSelected: true),
];
late SelectionPopupModel selectedItem;
@@ -37,18 +37,18 @@ class _CityOfLivingScreenState extends State<CityOfLivingScreen> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, right: 16, left: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, right: 16, left: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Местоположение"),
SizedBox(height: 4),
const Text("Местоположение"),
const SizedBox(height: 4),
Row(
children: [
SizedBox(
width: MediaQuery.of(context).size.width - 32,
child: TypeAheadField(
debounceDuration: Duration(milliseconds: 300),
debounceDuration: const Duration(milliseconds: 300),
controller: cityController,
suggestionsController: suggestionsController,
builder: (context, controller, focus) => CustomTextFormField(
@@ -60,7 +60,7 @@ class _CityOfLivingScreenState extends State<CityOfLivingScreen> {
final registrationCubit = context.read<RegistrationCubit>();
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(location: value));
},
textStyle: TextStyle(
textStyle: const TextStyle(
fontSize: 16,
color: Colors.black,
),

View File

@@ -36,13 +36,13 @@ class _CredentialsScreenState extends State<CredentialsScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16),
padding: const EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.email),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
controller: emailController,
focusNode: emailFocusNode,
@@ -56,9 +56,9 @@ class _CredentialsScreenState extends State<CredentialsScreen> {
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(email: newValue));
},
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(s.password),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
obscureText: hidePassword,
controller: passwordController,
@@ -80,9 +80,9 @@ class _CredentialsScreenState extends State<CredentialsScreen> {
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(password: newValue));
},
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(s.password_confirmation),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
obscureText: hidePassword,
controller: passwordConfirmationController,

View File

@@ -37,16 +37,16 @@ class _DateOfBirthScreenState extends State<DateOfBirthScreen> {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16),
padding: const EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.date_of_birth),
SizedBox(height: 4),
const SizedBox(height: 4),
ListTile(
onTap: onTapCalendar(context),
leading: Icon(Icons.calendar_month_rounded, color: appTheme.blueA400),
trailing: Icon(Icons.keyboard_arrow_down_rounded),
trailing: const Icon(Icons.keyboard_arrow_down_rounded),
title: Text(selectedDate.format('dd MMMM yyyy', 'ru')),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
@@ -112,7 +112,7 @@ class _DateOfBirthScreenState extends State<DateOfBirthScreen> {
borderRadius: BorderRadius.circular(20),
color: appTheme.blueA400,
),
child: Center(
child: const Center(
child: Text(
'Сохранить',
style: TextStyle(

View File

@@ -31,12 +31,12 @@ class _FavoriteFoodsScreenState extends State<FavoriteFoodsScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.favorite_foods + ' (не обязательно)'),
SizedBox(height: 4),
Text('${s.favorite_foods} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
controller: favoriteFoodsController,
hintText: s.enter_information,
@@ -49,9 +49,9 @@ class _FavoriteFoodsScreenState extends State<FavoriteFoodsScreen> {
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(favoriteFoods: newValue));
},
),
SizedBox(height: 16),
Text(s.unfavorite_foods + ' (не обязательно)'),
SizedBox(height: 4),
const SizedBox(height: 16),
Text('${s.unfavorite_foods} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
controller: unFavoriteFoodsController,
hintText: s.enter_information,

View File

@@ -29,12 +29,12 @@ class _FavoriteSportsScreenState extends State<FavoriteSportsScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.your_favorite_sports + ' (не обязательно)'),
SizedBox(height: 4),
Text('${s.your_favorite_sports} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
controller: enterInformationController,
focusNode: infoFocusNode,

View File

@@ -24,7 +24,7 @@ class _GenderScreenState extends State<GenderScreen> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16),
padding: const EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16),
child: Column(
children: [
RadioListTile(
@@ -32,7 +32,7 @@ class _GenderScreenState extends State<GenderScreen> {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
title: Text('Мужской'),
title: const Text('Мужской'),
value: 'male',
groupValue: currentValue,
onChanged: (newValue) {
@@ -48,13 +48,13 @@ class _GenderScreenState extends State<GenderScreen> {
height: 40,
),
),
SizedBox(height: 16),
const SizedBox(height: 16),
RadioListTile(
contentPadding: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
title: Text('Женский'),
title: const Text('Женский'),
value: 'female',
groupValue: currentValue,
onChanged: (newValue) {

View File

@@ -30,12 +30,12 @@ class _HeightScreenState extends State<HeightScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.your_height),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
textInputAction: TextInputAction.done,
autofocus: true,

View File

@@ -17,7 +17,7 @@ class LanguageSelectScreen extends StatefulWidget {
class _LanguageSelectScreenState extends State<LanguageSelectScreen> {
final List<SelectionPopupModel> dropdownItemList = [
SelectionPopupModel(id: 1, title: "Русский", isSelected: true),
const SelectionPopupModel(id: 1, title: "Русский", isSelected: true),
];
late SelectionPopupModel value;
@@ -38,7 +38,7 @@ class _LanguageSelectScreenState extends State<LanguageSelectScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, right: 16, left: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, right: 16, left: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

View File

@@ -29,12 +29,12 @@ class _MedicineIntakeScreenState extends State<MedicineIntakeScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.do_you_take_pills + ' (не обязательно)'),
SizedBox(height: 4),
Text('${s.do_you_take_pills} (не обязательно)'),
const SizedBox(height: 4),
CustomTextFormField(
controller: enterInformationController,
hintText: s.enter_information,

View File

@@ -31,12 +31,12 @@ class _NameScreenState extends State<NameScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16),
padding: const EdgeInsets.only(bottom: 80, top: 16, left: 16, right: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.first_name),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
controller: firstNameController,
focusNode: nameFocus,
@@ -47,9 +47,9 @@ class _NameScreenState extends State<NameScreen> {
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(firstName: newValue));
},
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(s.last_name),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
controller: lastNameController,
textInputAction: TextInputAction.done,

View File

@@ -36,12 +36,12 @@ class _PhoneScreenState extends State<PhoneScreen> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Номер телефона'),
SizedBox(height: 4),
const Text('Номер телефона'),
const SizedBox(height: 4),
CustomTextFormField(
textInputAction: TextInputAction.done,
autofocus: true,

View File

@@ -52,7 +52,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
Container(
height: 48,
width: MediaQuery.of(context).size.width * 0.2,
padding: EdgeInsets.only(left: 16, right: 4),
padding: const EdgeInsets.only(left: 16, right: 4),
child: FloatingActionButton.extended(
heroTag: 'backButtonRegistration',
highlightElevation: 0,
@@ -61,7 +61,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
backgroundColor: Color(0xFFEAF2FD),
backgroundColor: const Color(0xFFEAF2FD),
onPressed: () async {
setState(() {
pageController.previousPage(
@@ -79,7 +79,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
Container(
height: 48,
width: MediaQuery.of(context).size.width * 0.8,
padding: EdgeInsets.only(left: 4, right: 16),
padding: const EdgeInsets.only(left: 4, right: 16),
child: FloatingActionButton.extended(
heroTag: 'nextButtonRegistration',
highlightElevation: 0,
@@ -90,7 +90,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
),
backgroundColor: appTheme.blueA400,
onPressed: () async {
if (await canGoNext(state)) {
if (await canGoNext(state, context)) {
setState(() {
pageController.nextPage(
duration: const Duration(milliseconds: 350),
@@ -111,7 +111,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
automaticallyImplyLeading: false,
leading: Builder(
builder: (context) => IconButton(
icon: Icon(Icons.close_rounded),
icon: const Icon(Icons.close_rounded),
onPressed: () => GoRouter.of(context).pop(),
),
),
@@ -150,7 +150,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
),
),
body: PageView(
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
controller: pageController,
onPageChanged: (index) {
setState(() {
@@ -183,19 +183,19 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
);
}
Future<bool> canGoNext(RegistrationState state) async {
Future<bool> canGoNext(RegistrationState state, BuildContext context) async {
switch (step) {
case 1:
if (state.sheet.phone.length != 18) {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Ошибка'),
content: Text('Введите корректный номер телефона'),
title: const Text('Ошибка'),
content: const Text('Введите корректный номер телефона'),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('OK'),
child: const Text('OK'),
),
],
),
@@ -217,18 +217,18 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
String errorMessage = '';
for (var error in errors) {
errorMessage += error + '\n\n';
errorMessage += '$error\n\n';
}
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Ошибка'),
title: const Text('Ошибка'),
content: Text(errorMessage),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('OK'),
child: const Text('OK'),
),
],
),
@@ -247,18 +247,18 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
String errorMessage = '';
for (var error in errors) {
errorMessage += error + '\n\n';
errorMessage += '$error\n\n';
}
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Ошибка'),
title: const Text('Ошибка'),
content: Text(errorMessage),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('OK'),
child: const Text('OK'),
),
],
),
@@ -266,18 +266,18 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
return false;
}
case 4:
if (state.sheet.gender.isNotEmpty)
if (state.sheet.gender.isNotEmpty) {
return true;
else {
} else {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Ошибка'),
content: Text('Выберете пол'),
title: const Text('Ошибка'),
content: const Text('Выберете пол'),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('OK'),
child: const Text('OK'),
),
],
),
@@ -285,18 +285,18 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
return false;
}
case 6:
if (state.sheet.location.isNotEmpty)
if (state.sheet.location.isNotEmpty) {
return true;
else {
} else {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Ошибка'),
content: Text('Заполните все поля'),
title: const Text('Ошибка'),
content: const Text('Заполните все поля'),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('OK'),
child: const Text('OK'),
),
],
),
@@ -316,18 +316,18 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
String errorMessage = '';
for (var error in errors) {
errorMessage += error + '\n\n';
errorMessage += '$error\n\n';
}
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Ошибка'),
title: const Text('Ошибка'),
content: Text(errorMessage),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('OK'),
child: const Text('OK'),
),
],
),
@@ -340,21 +340,25 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
barrierDismissible: false,
useSafeArea: false,
context: context,
builder: (context) => PopScope(
builder: (context) => const PopScope(
canPop: false,
child: const Loader(),
child: Loader(),
),
);
await registrationCubit.tryRegistration();
Navigator.pop(context);
if (context.mounted) {
Navigator.pop(context);
}
} catch (e) {
Navigator.pop(context);
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Ошибка при попытке регистрации'),
),
);
if (context.mounted) {
Navigator.pop(context);
showDialog(
context: context,
builder: (context) => const AlertDialog(
title: Text('Ошибка при попытке регистрации'),
),
);
}
}
return false;
default:
@@ -423,7 +427,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
errors.add('First name cannot be empty');
}
if (firstName.length < 1) {
if (firstName.isEmpty) {
errors.add('First name is too short');
}
@@ -431,7 +435,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
errors.add('Last name cannot be empty');
}
if (lastName.length < 1) {
if (lastName.isEmpty) {
errors.add('Last name is too short');
}

View File

@@ -1,4 +1,5 @@
import 'dart:convert';
import 'dart:developer';
import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/locator_service.dart';
@@ -7,7 +8,7 @@ import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class WebViewRegistrationScreen extends StatefulWidget {
const WebViewRegistrationScreen();
const WebViewRegistrationScreen({super.key});
@override
State<WebViewRegistrationScreen> createState() => _WebViewRegistrationScreenState();
@@ -31,10 +32,10 @@ class _WebViewRegistrationScreenState extends State<WebViewRegistrationScreen> {
final data = jsonDecode(message.message);
if (data['type'] == 'email') {
email = data['value'];
print("Email: $email");
log("Email: $email");
} else if (data['type'] == 'password') {
password = data['value'];
print("Password: $password");
log("Password: $password");
}
},
)
@@ -51,13 +52,13 @@ class _WebViewRegistrationScreenState extends State<WebViewRegistrationScreen> {
},
),
)
..loadRequest(Uri.parse(baseUrl + '/registration/step1'));
..loadRequest(Uri.parse('$baseUrl/registration/step1'));
_injectJavaScript();
}
void _injectJavaScript() async {
await Future.delayed(Duration(seconds: 2));
await Future.delayed(const Duration(seconds: 2));
_controller.runJavaScript('''
function sendMessageToFlutter(data) {
window.flutter_inject.postMessage(JSON.stringify(data));

View File

@@ -30,12 +30,12 @@ class _WeightScreenState extends State<WeightScreen> {
Widget build(BuildContext context) {
final s = S.of(context);
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
padding: const EdgeInsets.only(bottom: 80, left: 16, right: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.your_weight),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
autofocus: true,
hintText: 'кг',