forked from eatvio/eatvio_app
feature(registration): iter6
This commit is contained in:
3
.env
3
.env
@@ -1,2 +1,3 @@
|
||||
SERVER_ROOT='https://mobile-stage.eatvio.ru/api'
|
||||
STORAGE_URL='https://mobile-stage.eatvio.ru/storage/'
|
||||
STORAGE_URL='https://mobile-stage.eatvio.ru/storage/'
|
||||
OFERTA='https://mobile-stage.eatvio.ru/oferta_bs.pdf'
|
||||
@@ -9,7 +9,7 @@ class UserRegistrationSheet with _$UserRegistrationSheet {
|
||||
required String name,
|
||||
@JsonKey(name: 'first_name')
|
||||
required String firstName,
|
||||
@JsonKey(name: 'last')
|
||||
@JsonKey(name: 'last_name')
|
||||
required String lastName,
|
||||
required String email,
|
||||
required String password,
|
||||
@@ -23,22 +23,22 @@ class UserRegistrationSheet with _$UserRegistrationSheet {
|
||||
required String country,
|
||||
required String city,
|
||||
required String lang,
|
||||
required String weight,
|
||||
required String height,
|
||||
required int weight,
|
||||
required int height,
|
||||
@JsonKey(name: 'chest_circumference')
|
||||
required String chestCircumference,
|
||||
required int chestCircumference,
|
||||
@JsonKey(name: 'waist_circumference')
|
||||
required String waistCircumference,
|
||||
required int waistCircumference,
|
||||
@JsonKey(name: 'hip_circumference')
|
||||
required String hipCircumference,
|
||||
required int hipCircumference,
|
||||
@JsonKey(name: 'blood_pressure_up')
|
||||
required String bloodPressureUp,
|
||||
required int bloodPressureUp,
|
||||
@JsonKey(name: 'blood_pressure_down')
|
||||
required String bloodPressureDown,
|
||||
required int bloodPressureDown,
|
||||
@JsonKey(name: 'has_hypo')
|
||||
required String hasHypo,
|
||||
required int hasHypo,
|
||||
@JsonKey(name: 'has_hyper')
|
||||
required String hasHyper,
|
||||
required int hasHyper,
|
||||
@JsonKey(name: 'about_alergy')
|
||||
required String aboutAllergy,
|
||||
@JsonKey(name: 'about_taking_pils')
|
||||
@@ -51,9 +51,9 @@ class UserRegistrationSheet with _$UserRegistrationSheet {
|
||||
required String unfavoriteFoods,
|
||||
@JsonKey(name: 'additional_info')
|
||||
required String additionalInfo,
|
||||
@Default('1.2')
|
||||
@Default(1.2)
|
||||
@JsonKey(name: 'activity_coefficient')
|
||||
String activityCoefficient,
|
||||
double activityCoefficient,
|
||||
}) = _UserRegistrationSheet;
|
||||
|
||||
factory UserRegistrationSheet.fromJson(Map<String, Object?> json) => _$UserRegistrationSheetFromJson(json);
|
||||
|
||||
@@ -24,7 +24,7 @@ mixin _$UserRegistrationSheet {
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'first_name')
|
||||
String get firstName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'last')
|
||||
@JsonKey(name: 'last_name')
|
||||
String get lastName => throw _privateConstructorUsedError;
|
||||
String get email => throw _privateConstructorUsedError;
|
||||
String get password => throw _privateConstructorUsedError;
|
||||
@@ -37,22 +37,22 @@ mixin _$UserRegistrationSheet {
|
||||
String get country => throw _privateConstructorUsedError;
|
||||
String get city => throw _privateConstructorUsedError;
|
||||
String get lang => throw _privateConstructorUsedError;
|
||||
String get weight => throw _privateConstructorUsedError;
|
||||
String get height => throw _privateConstructorUsedError;
|
||||
int get weight => throw _privateConstructorUsedError;
|
||||
int get height => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'chest_circumference')
|
||||
String get chestCircumference => throw _privateConstructorUsedError;
|
||||
int get chestCircumference => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'waist_circumference')
|
||||
String get waistCircumference => throw _privateConstructorUsedError;
|
||||
int get waistCircumference => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'hip_circumference')
|
||||
String get hipCircumference => throw _privateConstructorUsedError;
|
||||
int get hipCircumference => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'blood_pressure_up')
|
||||
String get bloodPressureUp => throw _privateConstructorUsedError;
|
||||
int get bloodPressureUp => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'blood_pressure_down')
|
||||
String get bloodPressureDown => throw _privateConstructorUsedError;
|
||||
int get bloodPressureDown => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'has_hypo')
|
||||
String get hasHypo => throw _privateConstructorUsedError;
|
||||
int get hasHypo => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'has_hyper')
|
||||
String get hasHyper => throw _privateConstructorUsedError;
|
||||
int get hasHyper => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'about_alergy')
|
||||
String get aboutAllergy => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'about_taking_pils')
|
||||
@@ -66,7 +66,7 @@ mixin _$UserRegistrationSheet {
|
||||
@JsonKey(name: 'additional_info')
|
||||
String get additionalInfo => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'activity_coefficient')
|
||||
String get activityCoefficient => throw _privateConstructorUsedError;
|
||||
double get activityCoefficient => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@JsonKey(ignore: true)
|
||||
@@ -83,7 +83,7 @@ abstract class $UserRegistrationSheetCopyWith<$Res> {
|
||||
$Res call(
|
||||
{String name,
|
||||
@JsonKey(name: 'first_name') String firstName,
|
||||
@JsonKey(name: 'last') String lastName,
|
||||
@JsonKey(name: 'last_name') String lastName,
|
||||
String email,
|
||||
String password,
|
||||
@JsonKey(name: 'password_confirmation') String passwordConfirmation,
|
||||
@@ -93,22 +93,22 @@ abstract class $UserRegistrationSheetCopyWith<$Res> {
|
||||
String country,
|
||||
String city,
|
||||
String lang,
|
||||
String weight,
|
||||
String height,
|
||||
@JsonKey(name: 'chest_circumference') String chestCircumference,
|
||||
@JsonKey(name: 'waist_circumference') String waistCircumference,
|
||||
@JsonKey(name: 'hip_circumference') String hipCircumference,
|
||||
@JsonKey(name: 'blood_pressure_up') String bloodPressureUp,
|
||||
@JsonKey(name: 'blood_pressure_down') String bloodPressureDown,
|
||||
@JsonKey(name: 'has_hypo') String hasHypo,
|
||||
@JsonKey(name: 'has_hyper') String hasHyper,
|
||||
int weight,
|
||||
int height,
|
||||
@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') String activityCoefficient});
|
||||
@JsonKey(name: 'activity_coefficient') double activityCoefficient});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -206,39 +206,39 @@ class _$UserRegistrationSheetCopyWithImpl<$Res,
|
||||
weight: null == weight
|
||||
? _value.weight
|
||||
: weight // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
height: null == height
|
||||
? _value.height
|
||||
: height // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
chestCircumference: null == chestCircumference
|
||||
? _value.chestCircumference
|
||||
: chestCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
waistCircumference: null == waistCircumference
|
||||
? _value.waistCircumference
|
||||
: waistCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
hipCircumference: null == hipCircumference
|
||||
? _value.hipCircumference
|
||||
: hipCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
bloodPressureUp: null == bloodPressureUp
|
||||
? _value.bloodPressureUp
|
||||
: bloodPressureUp // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
bloodPressureDown: null == bloodPressureDown
|
||||
? _value.bloodPressureDown
|
||||
: bloodPressureDown // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
hasHypo: null == hasHypo
|
||||
? _value.hasHypo
|
||||
: hasHypo // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
hasHyper: null == hasHyper
|
||||
? _value.hasHyper
|
||||
: hasHyper // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
aboutAllergy: null == aboutAllergy
|
||||
? _value.aboutAllergy
|
||||
: aboutAllergy // ignore: cast_nullable_to_non_nullable
|
||||
@@ -266,7 +266,7 @@ class _$UserRegistrationSheetCopyWithImpl<$Res,
|
||||
activityCoefficient: null == activityCoefficient
|
||||
? _value.activityCoefficient
|
||||
: activityCoefficient // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as double,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -283,7 +283,7 @@ abstract class _$$UserRegistrationSheetImplCopyWith<$Res>
|
||||
$Res call(
|
||||
{String name,
|
||||
@JsonKey(name: 'first_name') String firstName,
|
||||
@JsonKey(name: 'last') String lastName,
|
||||
@JsonKey(name: 'last_name') String lastName,
|
||||
String email,
|
||||
String password,
|
||||
@JsonKey(name: 'password_confirmation') String passwordConfirmation,
|
||||
@@ -293,22 +293,22 @@ abstract class _$$UserRegistrationSheetImplCopyWith<$Res>
|
||||
String country,
|
||||
String city,
|
||||
String lang,
|
||||
String weight,
|
||||
String height,
|
||||
@JsonKey(name: 'chest_circumference') String chestCircumference,
|
||||
@JsonKey(name: 'waist_circumference') String waistCircumference,
|
||||
@JsonKey(name: 'hip_circumference') String hipCircumference,
|
||||
@JsonKey(name: 'blood_pressure_up') String bloodPressureUp,
|
||||
@JsonKey(name: 'blood_pressure_down') String bloodPressureDown,
|
||||
@JsonKey(name: 'has_hypo') String hasHypo,
|
||||
@JsonKey(name: 'has_hyper') String hasHyper,
|
||||
int weight,
|
||||
int height,
|
||||
@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') String activityCoefficient});
|
||||
@JsonKey(name: 'activity_coefficient') double activityCoefficient});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -404,39 +404,39 @@ class __$$UserRegistrationSheetImplCopyWithImpl<$Res>
|
||||
weight: null == weight
|
||||
? _value.weight
|
||||
: weight // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
height: null == height
|
||||
? _value.height
|
||||
: height // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
chestCircumference: null == chestCircumference
|
||||
? _value.chestCircumference
|
||||
: chestCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
waistCircumference: null == waistCircumference
|
||||
? _value.waistCircumference
|
||||
: waistCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
hipCircumference: null == hipCircumference
|
||||
? _value.hipCircumference
|
||||
: hipCircumference // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
bloodPressureUp: null == bloodPressureUp
|
||||
? _value.bloodPressureUp
|
||||
: bloodPressureUp // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
bloodPressureDown: null == bloodPressureDown
|
||||
? _value.bloodPressureDown
|
||||
: bloodPressureDown // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
hasHypo: null == hasHypo
|
||||
? _value.hasHypo
|
||||
: hasHypo // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
hasHyper: null == hasHyper
|
||||
? _value.hasHyper
|
||||
: hasHyper // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as int,
|
||||
aboutAllergy: null == aboutAllergy
|
||||
? _value.aboutAllergy
|
||||
: aboutAllergy // ignore: cast_nullable_to_non_nullable
|
||||
@@ -464,7 +464,7 @@ class __$$UserRegistrationSheetImplCopyWithImpl<$Res>
|
||||
activityCoefficient: null == activityCoefficient
|
||||
? _value.activityCoefficient
|
||||
: activityCoefficient // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as double,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -475,7 +475,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet {
|
||||
const _$UserRegistrationSheetImpl(
|
||||
{required this.name,
|
||||
@JsonKey(name: 'first_name') required this.firstName,
|
||||
@JsonKey(name: 'last') required this.lastName,
|
||||
@JsonKey(name: 'last_name') required this.lastName,
|
||||
required this.email,
|
||||
required this.password,
|
||||
@JsonKey(name: 'password_confirmation')
|
||||
@@ -501,7 +501,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet {
|
||||
@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'});
|
||||
@JsonKey(name: 'activity_coefficient') this.activityCoefficient = 1.2});
|
||||
|
||||
factory _$UserRegistrationSheetImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$UserRegistrationSheetImplFromJson(json);
|
||||
@@ -512,7 +512,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet {
|
||||
@JsonKey(name: 'first_name')
|
||||
final String firstName;
|
||||
@override
|
||||
@JsonKey(name: 'last')
|
||||
@JsonKey(name: 'last_name')
|
||||
final String lastName;
|
||||
@override
|
||||
final String email;
|
||||
@@ -535,30 +535,30 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet {
|
||||
@override
|
||||
final String lang;
|
||||
@override
|
||||
final String weight;
|
||||
final int weight;
|
||||
@override
|
||||
final String height;
|
||||
final int height;
|
||||
@override
|
||||
@JsonKey(name: 'chest_circumference')
|
||||
final String chestCircumference;
|
||||
final int chestCircumference;
|
||||
@override
|
||||
@JsonKey(name: 'waist_circumference')
|
||||
final String waistCircumference;
|
||||
final int waistCircumference;
|
||||
@override
|
||||
@JsonKey(name: 'hip_circumference')
|
||||
final String hipCircumference;
|
||||
final int hipCircumference;
|
||||
@override
|
||||
@JsonKey(name: 'blood_pressure_up')
|
||||
final String bloodPressureUp;
|
||||
final int bloodPressureUp;
|
||||
@override
|
||||
@JsonKey(name: 'blood_pressure_down')
|
||||
final String bloodPressureDown;
|
||||
final int bloodPressureDown;
|
||||
@override
|
||||
@JsonKey(name: 'has_hypo')
|
||||
final String hasHypo;
|
||||
final int hasHypo;
|
||||
@override
|
||||
@JsonKey(name: 'has_hyper')
|
||||
final String hasHyper;
|
||||
final int hasHyper;
|
||||
@override
|
||||
@JsonKey(name: 'about_alergy')
|
||||
final String aboutAllergy;
|
||||
@@ -579,7 +579,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet {
|
||||
final String additionalInfo;
|
||||
@override
|
||||
@JsonKey(name: 'activity_coefficient')
|
||||
final String activityCoefficient;
|
||||
final double activityCoefficient;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -693,7 +693,7 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet {
|
||||
const factory _UserRegistrationSheet(
|
||||
{required final String name,
|
||||
@JsonKey(name: 'first_name') required final String firstName,
|
||||
@JsonKey(name: 'last') required final String lastName,
|
||||
@JsonKey(name: 'last_name') required final String lastName,
|
||||
required final String email,
|
||||
required final String password,
|
||||
@JsonKey(name: 'password_confirmation')
|
||||
@@ -704,19 +704,18 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet {
|
||||
required final String country,
|
||||
required final String city,
|
||||
required final String lang,
|
||||
required final String weight,
|
||||
required final String height,
|
||||
required final int weight,
|
||||
required final int height,
|
||||
@JsonKey(name: 'chest_circumference')
|
||||
required final String chestCircumference,
|
||||
required final int chestCircumference,
|
||||
@JsonKey(name: 'waist_circumference')
|
||||
required final String waistCircumference,
|
||||
@JsonKey(name: 'hip_circumference')
|
||||
required final String hipCircumference,
|
||||
@JsonKey(name: 'blood_pressure_up') required final String bloodPressureUp,
|
||||
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 String bloodPressureDown,
|
||||
@JsonKey(name: 'has_hypo') required final String hasHypo,
|
||||
@JsonKey(name: 'has_hyper') required final String hasHyper,
|
||||
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')
|
||||
@@ -725,7 +724,7 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet {
|
||||
@JsonKey(name: 'unfavorite_foods') required final String unfavoriteFoods,
|
||||
@JsonKey(name: 'additional_info') required final String additionalInfo,
|
||||
@JsonKey(name: 'activity_coefficient')
|
||||
final String activityCoefficient}) = _$UserRegistrationSheetImpl;
|
||||
final double activityCoefficient}) = _$UserRegistrationSheetImpl;
|
||||
|
||||
factory _UserRegistrationSheet.fromJson(Map<String, dynamic> json) =
|
||||
_$UserRegistrationSheetImpl.fromJson;
|
||||
@@ -736,7 +735,7 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet {
|
||||
@JsonKey(name: 'first_name')
|
||||
String get firstName;
|
||||
@override
|
||||
@JsonKey(name: 'last')
|
||||
@JsonKey(name: 'last_name')
|
||||
String get lastName;
|
||||
@override
|
||||
String get email;
|
||||
@@ -759,30 +758,30 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet {
|
||||
@override
|
||||
String get lang;
|
||||
@override
|
||||
String get weight;
|
||||
int get weight;
|
||||
@override
|
||||
String get height;
|
||||
int get height;
|
||||
@override
|
||||
@JsonKey(name: 'chest_circumference')
|
||||
String get chestCircumference;
|
||||
int get chestCircumference;
|
||||
@override
|
||||
@JsonKey(name: 'waist_circumference')
|
||||
String get waistCircumference;
|
||||
int get waistCircumference;
|
||||
@override
|
||||
@JsonKey(name: 'hip_circumference')
|
||||
String get hipCircumference;
|
||||
int get hipCircumference;
|
||||
@override
|
||||
@JsonKey(name: 'blood_pressure_up')
|
||||
String get bloodPressureUp;
|
||||
int get bloodPressureUp;
|
||||
@override
|
||||
@JsonKey(name: 'blood_pressure_down')
|
||||
String get bloodPressureDown;
|
||||
int get bloodPressureDown;
|
||||
@override
|
||||
@JsonKey(name: 'has_hypo')
|
||||
String get hasHypo;
|
||||
int get hasHypo;
|
||||
@override
|
||||
@JsonKey(name: 'has_hyper')
|
||||
String get hasHyper;
|
||||
int get hasHyper;
|
||||
@override
|
||||
@JsonKey(name: 'about_alergy')
|
||||
String get aboutAllergy;
|
||||
@@ -803,7 +802,7 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet {
|
||||
String get additionalInfo;
|
||||
@override
|
||||
@JsonKey(name: 'activity_coefficient')
|
||||
String get activityCoefficient;
|
||||
double get activityCoefficient;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl>
|
||||
|
||||
@@ -11,7 +11,7 @@ _$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(
|
||||
_$UserRegistrationSheetImpl(
|
||||
name: json['name'] as String,
|
||||
firstName: json['first_name'] as String,
|
||||
lastName: json['last'] as String,
|
||||
lastName: json['last_name'] as String,
|
||||
email: json['email'] as String,
|
||||
password: json['password'] as String,
|
||||
passwordConfirmation: json['password_confirmation'] as String,
|
||||
@@ -21,22 +21,23 @@ _$UserRegistrationSheetImpl _$$UserRegistrationSheetImplFromJson(
|
||||
country: json['country'] as String,
|
||||
city: json['city'] as String,
|
||||
lang: json['lang'] as String,
|
||||
weight: json['weight'] as String,
|
||||
height: json['height'] as String,
|
||||
chestCircumference: json['chest_circumference'] as String,
|
||||
waistCircumference: json['waist_circumference'] as String,
|
||||
hipCircumference: json['hip_circumference'] as String,
|
||||
bloodPressureUp: json['blood_pressure_up'] as String,
|
||||
bloodPressureDown: json['blood_pressure_down'] as String,
|
||||
hasHypo: json['has_hypo'] as String,
|
||||
hasHyper: json['has_hyper'] as String,
|
||||
weight: (json['weight'] as num).toInt(),
|
||||
height: (json['height'] as num).toInt(),
|
||||
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 String? ?? '1.2',
|
||||
activityCoefficient:
|
||||
(json['activity_coefficient'] as num?)?.toDouble() ?? 1.2,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$UserRegistrationSheetImplToJson(
|
||||
@@ -44,7 +45,7 @@ Map<String, dynamic> _$$UserRegistrationSheetImplToJson(
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'first_name': instance.firstName,
|
||||
'last': instance.lastName,
|
||||
'last_name': instance.lastName,
|
||||
'email': instance.email,
|
||||
'password': instance.password,
|
||||
'password_confirmation': instance.passwordConfirmation,
|
||||
|
||||
@@ -1,159 +1,4 @@
|
||||
import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'bloc/city_of_living_bloc.dart';
|
||||
import 'models/city_of_living_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/custom_drop_down.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CityOfLivingScreen extends StatefulWidget {
|
||||
final UserRegistrationSheet sheet;
|
||||
|
||||
const CityOfLivingScreen({super.key, required this.sheet});
|
||||
|
||||
@override
|
||||
State<CityOfLivingScreen> createState() => _CityOfLivingScreenState();
|
||||
}
|
||||
|
||||
class _CityOfLivingScreenState extends State<CityOfLivingScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider<CityOfLivingBloc>(
|
||||
create: (BuildContext context) =>
|
||||
CityOfLivingBloc(CityOfLivingState(cityOfLivingModelObj: CityOfLivingModel(userRegistrationSheet: widget.sheet)))..add(CityOfLivingInitialEvent()),
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
Text("place_of_living".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 39.v),
|
||||
Text("country".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 2.v),
|
||||
BlocSelector<CityOfLivingBloc, CityOfLivingState, CityOfLivingModel?>(
|
||||
selector: (state) => state.cityOfLivingModelObj,
|
||||
builder: (context, cityOfLivingModelObj) {
|
||||
return CustomDropDown(
|
||||
icon: Container(
|
||||
margin: EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)),
|
||||
child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),
|
||||
),
|
||||
hintText: "Не выбрано".tr,
|
||||
items: cityOfLivingModelObj?.dropdownItemList ?? [],
|
||||
onChanged: onDropDownChange(context),
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 22.v),
|
||||
Text("Населенный пункт", style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 2.v),
|
||||
BlocBuilder<CityOfLivingBloc, CityOfLivingState>(
|
||||
builder: (context, state) {
|
||||
return RawAutocomplete<String>(
|
||||
optionsBuilder: (TextEditingValue textEditingValue) => _options.where((String option) {
|
||||
return option.toLowerCase().startsWith(textEditingValue.text.toLowerCase());
|
||||
}),
|
||||
fieldViewBuilder: (
|
||||
BuildContext context,
|
||||
TextEditingController textEditingController,
|
||||
FocusNode focusNode,
|
||||
VoidCallback onFieldSubmitted,
|
||||
) {
|
||||
return CustomTextFormField(
|
||||
controller: textEditingController,
|
||||
focusNode: focusNode,
|
||||
onFieldSubmitted: (String value) => onFieldSubmitted(),
|
||||
);
|
||||
},
|
||||
optionsViewBuilder: (
|
||||
BuildContext context,
|
||||
AutocompleteOnSelected<String> onSelected,
|
||||
Iterable<String> options,
|
||||
) {
|
||||
return Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Material(
|
||||
elevation: 4.0,
|
||||
child: SizedBox(
|
||||
height: 200.0,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
itemCount: options.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final String option = options.elementAt(index);
|
||||
return GestureDetector(
|
||||
onTap: () => onSelected(option),
|
||||
child: ListTile(
|
||||
title: Text(option),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
onTapContinue(CityOfLivingState state, BuildContext context) {
|
||||
return () {
|
||||
UserRegistrationSheet sheet = state.cityOfLivingModelObj!.userRegistrationSheet;
|
||||
GoRouter.of(context).goNamed('bodyCircumferencesScreen', extra: sheet);
|
||||
};
|
||||
}
|
||||
|
||||
onDropDownChange(BuildContext context) {
|
||||
return (value) {
|
||||
context.read<CityOfLivingBloc>().add(ChangeDropDownEvent(value: value));
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(country: value));
|
||||
};
|
||||
}
|
||||
|
||||
Function onTapBack(BuildContext context) {
|
||||
return () {
|
||||
onTapArrowLeft(context);
|
||||
};
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
GoRouter.of(context).pop();
|
||||
}
|
||||
}
|
||||
|
||||
selectProduct(AutocompleteOnSelected<String> onSelected, String option, CityOfLivingState state, BuildContext context) {
|
||||
state.cityController?.text = option;
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(city: option));
|
||||
return () {
|
||||
onSelected(option);
|
||||
};
|
||||
}
|
||||
|
||||
buildOptions(List<String> _options) {
|
||||
return (TextEditingValue textEditingValue) {
|
||||
return _options.where((String option) {
|
||||
return true;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
const List<String> _options = const [
|
||||
const List<String> citiesList = const [
|
||||
"Абаза",
|
||||
"Абакан",
|
||||
"Абдулино",
|
||||
@@ -1271,4 +1116,4 @@ const List<String> _options = const [
|
||||
"Ясногорск",
|
||||
"Ясный",
|
||||
"Яхрома",
|
||||
];
|
||||
];
|
||||
@@ -2,12 +2,43 @@ import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_state.dart';
|
||||
import 'package:eatvio_app/features/registration/repositories/registration_repository.dart';
|
||||
import 'package:eatvio_app/presentation/registration/language_select_screen/models/language_select_model.dart';
|
||||
|
||||
class RegistrationCubit extends Cubit<RegistrationState> {
|
||||
final RegistrationRepository registrationRepository;
|
||||
|
||||
RegistrationCubit({required this.registrationRepository}) : super(RegistrationState(sheet: LanguageSelectModel().userRegistrationSheet));
|
||||
RegistrationCubit({required this.registrationRepository})
|
||||
: super(
|
||||
RegistrationState(
|
||||
sheet: UserRegistrationSheet(
|
||||
name: '',
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
email: '',
|
||||
password: '',
|
||||
passwordConfirmation: '',
|
||||
birthdate: DateTime.now().toString(),
|
||||
gender: '',
|
||||
country: '',
|
||||
city: '',
|
||||
lang: 'Русский',
|
||||
weight: 0,
|
||||
height: 0,
|
||||
chestCircumference: 0,
|
||||
waistCircumference: 0,
|
||||
hipCircumference: 0,
|
||||
bloodPressureUp: 0,
|
||||
bloodPressureDown: 0,
|
||||
hasHypo: 0,
|
||||
hasHyper: 0,
|
||||
aboutAllergy: '',
|
||||
aboutTakingPils: '',
|
||||
aboutSportHobbies: '',
|
||||
favoriteFoods: '',
|
||||
unfavoriteFoods: '',
|
||||
additionalInfo: '',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
updateSheet(UserRegistrationSheet sheet) => emit(RegistrationState(sheet: sheet));
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
|
||||
title: "Да",
|
||||
),
|
||||
SelectionPopupModel(
|
||||
id: 2,
|
||||
id: 0,
|
||||
title: "Нет",
|
||||
),
|
||||
];
|
||||
@@ -39,14 +39,10 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
|
||||
super.initState();
|
||||
selectedPopupHypo = selectionPopupList[1];
|
||||
selectedPopupHyper = selectionPopupList[1];
|
||||
upPressureController.text = widget.sheet.bloodPressureUp;
|
||||
downPressureController.text = widget.sheet.bloodPressureDown;
|
||||
if (widget.sheet.hasHyper.isNotEmpty) {
|
||||
widget.sheet.hasHyper == 'Да' ? selectedPopupHyper = selectionPopupList[0] : selectedPopupHyper = selectionPopupList[1];
|
||||
}
|
||||
if (widget.sheet.hasHypo.isNotEmpty) {
|
||||
widget.sheet.hasHypo == 'Да' ? selectedPopupHypo = selectionPopupList[0] : selectedPopupHypo = selectionPopupList[1];
|
||||
}
|
||||
upPressureController.text = widget.sheet.bloodPressureUp.toString();
|
||||
downPressureController.text = widget.sheet.bloodPressureDown.toString();
|
||||
widget.sheet.hasHyper == '1' ? selectedPopupHyper = selectionPopupList[0] : selectedPopupHyper = selectionPopupList[1];
|
||||
widget.sheet.hasHypo == '1' ? selectedPopupHypo = selectionPopupList[0] : selectedPopupHypo = selectionPopupList[1];
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -82,7 +78,7 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
|
||||
hintText: "90".tr,
|
||||
onChanged: (newValue) {
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(bloodPressureUp: newValue));
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(bloodPressureUp: int.parse(newValue)));
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -102,7 +98,7 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
|
||||
hintText: "90".tr,
|
||||
onChanged: (newValue) {
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(bloodPressureDown: newValue));
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(bloodPressureDown: int.parse(newValue)));
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -126,7 +122,7 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
|
||||
setState(() {
|
||||
selectedPopupHypo = newPopup;
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(hasHypo: selectedPopupHypo.title));
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(hasHypo: selectedPopupHypo.id!));
|
||||
});
|
||||
},
|
||||
),
|
||||
@@ -149,7 +145,7 @@ class _BloodPressureScreenState extends State<BloodPressureScreen> {
|
||||
setState(() {
|
||||
selectedPopupHyper = newPopup;
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(hasHyper: selectedPopupHyper.title));
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(hasHyper: selectedPopupHyper.id!));
|
||||
});
|
||||
},
|
||||
),
|
||||
@@ -24,9 +24,9 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
chestCircumferenceController.text = widget.sheet.chestCircumference;
|
||||
waistCircumferenceController.text = widget.sheet.waistCircumference;
|
||||
hipCircumferenceController.text = widget.sheet.hipCircumference;
|
||||
if (widget.sheet.chestCircumference != 0) chestCircumferenceController.text = widget.sheet.chestCircumference.toString();
|
||||
if (widget.sheet.waistCircumference != 0) waistCircumferenceController.text = widget.sheet.waistCircumference.toString();
|
||||
if (widget.sheet.hipCircumference != 0) hipCircumferenceController.text = widget.sheet.hipCircumference.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -50,7 +50,7 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
|
||||
hintText: "90".tr,
|
||||
onChanged: (value) {
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(chestCircumference: value));
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(chestCircumference: int.parse(value)));
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -64,7 +64,7 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
|
||||
hintText: "60".tr,
|
||||
onChanged: (value) {
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(waistCircumference: value));
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(waistCircumference: int.parse(value)));
|
||||
},
|
||||
),
|
||||
SizedBox(height: 21.v),
|
||||
@@ -77,7 +77,7 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
|
||||
textInputAction: TextInputAction.done,
|
||||
onChanged: (value) {
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(hipCircumference: value));
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(hipCircumference: int.parse(value)));
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -0,0 +1,88 @@
|
||||
import 'package:eatvio_app/features/registration/consts/cities_list.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/custom_drop_down.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_typeahead/flutter_typeahead.dart';
|
||||
|
||||
class CityOfLivingScreen extends StatefulWidget {
|
||||
final UserRegistrationSheet sheet;
|
||||
|
||||
const CityOfLivingScreen({super.key, required this.sheet});
|
||||
|
||||
@override
|
||||
State<CityOfLivingScreen> createState() => _CityOfLivingScreenState();
|
||||
}
|
||||
|
||||
class _CityOfLivingScreenState extends State<CityOfLivingScreen> {
|
||||
final dropdownItemList = [
|
||||
SelectionPopupModel(id: 1, title: "Россия", isSelected: true),
|
||||
];
|
||||
|
||||
late SelectionPopupModel selectedItem;
|
||||
final cityController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
selectedItem = dropdownItemList[0];
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(country: selectedItem.title));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
Text("place_of_living".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 39.v),
|
||||
Text("country".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 2.v),
|
||||
CustomDropDown(
|
||||
icon: Container(
|
||||
margin: EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)),
|
||||
child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),
|
||||
),
|
||||
hintText: "Не выбрано".tr,
|
||||
items: dropdownItemList,
|
||||
value: selectedItem,
|
||||
onChanged: (newValue) {
|
||||
setState(() {
|
||||
selectedItem = newValue;
|
||||
});
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(country: newValue.title));
|
||||
},
|
||||
),
|
||||
SizedBox(height: 22.v),
|
||||
Text("Населенный пункт", style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 2.v),
|
||||
TypeAheadField(
|
||||
controller: cityController,
|
||||
itemBuilder: (BuildContext context, String item) {
|
||||
return Text(item);
|
||||
},
|
||||
onSelected: (item) {
|
||||
setState(() {
|
||||
cityController.text = item;
|
||||
});
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(city: item));
|
||||
},
|
||||
suggestionsCallback: (query) {
|
||||
return citiesList.where((country) => country.toLowerCase().contains(query.toLowerCase())).toList();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class _HeightScreenState extends State<HeightScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
heightController.text = widget.sheet.height;
|
||||
if (widget.sheet.height != 0) heightController.text = widget.sheet.height.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -54,7 +54,7 @@ class _HeightScreenState extends State<HeightScreen> {
|
||||
],
|
||||
onChanged: (newValue) {
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(height: newValue));
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(height: int.parse(newValue)));
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -1,22 +1,22 @@
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_state.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/allergies_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/city_of_living_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/favorite_foods_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/height_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/name_screen.dart';
|
||||
import 'package:eatvio_app/locator_service.dart';
|
||||
import 'package:eatvio_app/presentation/registration/additional_information_screen/additional_information_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/allergies_screen/allergies_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/blood_pressure_screen/blood_pressure_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/body_circumferences_screen/body_circumferences_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/city_of_living_screen/city_of_living_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/credentials_screen/credentials_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/date_of_birth_screen/date_of_birth_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/favorite_foods_screen/favorite_foods_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/favorite_sports_screen/favorite_sports_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/gender_screen/gender_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/height_screen/height_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/language_select_screen/language_select_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/name_screen/name_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/weight_screen/weight_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/additional_information_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/blood_pressure_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/body_circumferences_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/credentials_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/date_of_birth_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/favorite_sports_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/gender_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/language_select_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/medicine_intake_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/weight_screen.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -34,6 +34,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
||||
double progressValue = 1 / 15;
|
||||
int step = 1;
|
||||
final pageController = PageController();
|
||||
final RegistrationCubit registrationCubit = sl<RegistrationCubit>();
|
||||
|
||||
_showPopDialog() {
|
||||
showDialog(
|
||||
@@ -63,7 +64,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider<RegistrationCubit>(
|
||||
create: (BuildContext context) => sl<RegistrationCubit>(),
|
||||
create: (BuildContext context) => registrationCubit,
|
||||
child: BlocBuilder<RegistrationCubit, RegistrationState>(
|
||||
builder: (BuildContext context, RegistrationState state) {
|
||||
return PopScope(
|
||||
@@ -225,7 +226,10 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
||||
return false;
|
||||
}
|
||||
case 3:
|
||||
List<String> errors = validateNameFields(state.sheet.firstName, state.sheet.lastName);
|
||||
List<String> errors = validateNameFields(
|
||||
state.sheet.firstName.toString(),
|
||||
state.sheet.lastName.toString(),
|
||||
);
|
||||
if (errors.isEmpty) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -251,7 +255,11 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
||||
return false;
|
||||
}
|
||||
case 7:
|
||||
List<String> errors = validateCircumferencesFields(state.sheet.chestCircumference, state.sheet.waistCircumference, state.sheet.hipCircumference);
|
||||
List<String> errors = validateCircumferencesFields(
|
||||
state.sheet.chestCircumference.toString(),
|
||||
state.sheet.waistCircumference.toString(),
|
||||
state.sheet.hipCircumference.toString(),
|
||||
);
|
||||
if (errors.isEmpty) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -277,7 +285,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
||||
return false;
|
||||
}
|
||||
case 15:
|
||||
context.read<RegistrationCubit>().tryRegistration();
|
||||
registrationCubit.tryRegistration();
|
||||
return true;
|
||||
default:
|
||||
return true;
|
||||
|
||||
@@ -20,7 +20,7 @@ class _WeightScreenState extends State<WeightScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
weightController.text = widget.sheet.weight;
|
||||
if (widget.sheet.weight != 0) weightController.text = widget.sheet.weight.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -54,7 +54,7 @@ class _WeightScreenState extends State<WeightScreen> {
|
||||
],
|
||||
onChanged: (newValue) {
|
||||
final registrationCubit = context.read<RegistrationCubit>();
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(weight: newValue));
|
||||
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(weight: int.parse(newValue)));
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -8,9 +8,9 @@ class RegistrationRepository {
|
||||
|
||||
tryRegister(UserRegistrationSheet sheet) async {
|
||||
try {
|
||||
return await registrationService.register(sheet: sheet);
|
||||
return await registrationService.register(sheet: sheet.copyWith(country: 'Россия', city: 'Москва').toJson());
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
import 'package:retrofit/retrofit.dart';
|
||||
|
||||
part 'registration_service.g.dart';
|
||||
@@ -10,6 +9,6 @@ abstract class RegistrationService {
|
||||
|
||||
@POST('/register')
|
||||
Future<void> register({
|
||||
@Body() required UserRegistrationSheet sheet,
|
||||
@Body() required Map<String, dynamic> sheet,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,11 +19,12 @@ class _RegistrationService implements RegistrationService {
|
||||
String? baseUrl;
|
||||
|
||||
@override
|
||||
Future<void> register({required UserRegistrationSheet sheet}) async {
|
||||
Future<void> register({required Map<String, dynamic> sheet}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = sheet;
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(sheet);
|
||||
await _dio.fetch<void>(_setStreamType<void>(Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:eatvio_app/core/token_storage.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import 'bloc/auth_bloc.dart';
|
||||
import 'models/auth_model.dart';
|
||||
@@ -33,43 +34,46 @@ class AuthScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(children: [
|
||||
SizedBox(height: 36.v),
|
||||
Text("user_authorization".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 60.v),
|
||||
Text("email".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<AuthBloc, AuthState, TextEditingController?>(
|
||||
selector: (state) => state.emailController,
|
||||
builder: (context, emailController) {
|
||||
return CustomTextFormField(controller: emailController, textInputAction: TextInputAction.done);
|
||||
},),
|
||||
SizedBox(height: 22.v),
|
||||
Text("password".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 5.v),
|
||||
BlocSelector<AuthBloc, AuthState, TextEditingController?>(
|
||||
selector: (state) => state.passwordController,
|
||||
builder: (context, passwordController) {
|
||||
return CustomTextFormField(
|
||||
obscureText: true,
|
||||
controller: passwordController,
|
||||
);
|
||||
},),
|
||||
SizedBox(height: 50.v),
|
||||
NextStepButton(
|
||||
text: "no_account".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapNoAccount(context),
|
||||
),
|
||||
/*NextStepButton(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 36.v),
|
||||
Text("user_authorization".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 60.v),
|
||||
Text("email".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<AuthBloc, AuthState, TextEditingController?>(
|
||||
selector: (state) => state.emailController,
|
||||
builder: (context, emailController) {
|
||||
return CustomTextFormField(controller: emailController, textInputAction: TextInputAction.done);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 22.v),
|
||||
Text("password".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 5.v),
|
||||
BlocSelector<AuthBloc, AuthState, TextEditingController?>(
|
||||
selector: (state) => state.passwordController,
|
||||
builder: (context, passwordController) {
|
||||
return CustomTextFormField(
|
||||
obscureText: true,
|
||||
controller: passwordController,
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 50.v),
|
||||
NextStepButton(
|
||||
text: "no_account".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapNoAccount(context),
|
||||
),
|
||||
/*NextStepButton(
|
||||
text: "Тест дневника".toUpperCase(),
|
||||
margin:
|
||||
EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
@@ -81,14 +85,27 @@ class AuthScreen extends StatelessWidget {
|
||||
EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapProfileTest(context)),*/
|
||||
BlocBuilder<AuthBloc, AuthState>(builder: (context, state) {
|
||||
return NextStepButton(
|
||||
text: "authentificate".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapAuth(state, context),);
|
||||
},),
|
||||
],),),),);
|
||||
BlocBuilder<AuthBloc, AuthState>(
|
||||
builder: (context, state) {
|
||||
return NextStepButton(
|
||||
text: "authentificate".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 16.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapAuth(state, context),
|
||||
);
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
await launchUrl(Uri.parse(dotenv.env['OFERTA']!));
|
||||
},
|
||||
child: Text('Пользовательское соглашение'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
onTapAuth(AuthState state, BuildContext context) {
|
||||
@@ -99,8 +116,12 @@ class AuthScreen extends StatelessWidget {
|
||||
'email': state.emailController!.text,
|
||||
'password': state.passwordController!.text,
|
||||
};
|
||||
final response = await http.post(Uri.parse(dotenv.env['SERVER_ROOT']! + '/login'),
|
||||
headers: {'Content-Type': 'application/json'}, body: json.encode(credentials), encoding: utf8,);
|
||||
final response = await http.post(
|
||||
Uri.parse(dotenv.env['SERVER_ROOT']! + '/login'),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: json.encode(credentials),
|
||||
encoding: utf8,
|
||||
);
|
||||
print(response.statusCode);
|
||||
if (response.statusCode == 200) {
|
||||
var res = await jsonDecode(response.body);
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/additional_information_screen/models/additional_information_model.dart';
|
||||
part 'additional_information_event.dart';
|
||||
part 'additional_information_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a AdditionalInformation according to the event that is dispatched to it.
|
||||
class AdditionalInformationBloc
|
||||
extends Bloc<AdditionalInformationEvent, AdditionalInformationState> {
|
||||
AdditionalInformationBloc(AdditionalInformationState initialState)
|
||||
: super(initialState) {
|
||||
on<AdditionalInformationInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
AdditionalInformationInitialEvent event,
|
||||
Emitter<AdditionalInformationState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(editTextController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'additional_information_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///AdditionalInformation widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class AdditionalInformationEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the AdditionalInformation widget is first created.
|
||||
class AdditionalInformationInitialEvent extends AdditionalInformationEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'additional_information_bloc.dart';
|
||||
|
||||
/// Represents the state of AdditionalInformation in the application.
|
||||
class AdditionalInformationState extends Equatable {
|
||||
AdditionalInformationState({
|
||||
this.editTextController,
|
||||
this.additionalInformationModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? editTextController;
|
||||
|
||||
AdditionalInformationModel? additionalInformationModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
editTextController,
|
||||
additionalInformationModelObj,
|
||||
];
|
||||
AdditionalInformationState copyWith({
|
||||
TextEditingController? editTextController,
|
||||
AdditionalInformationModel? additionalInformationModelObj,
|
||||
}) {
|
||||
return AdditionalInformationState(
|
||||
editTextController: editTextController ?? this.editTextController,
|
||||
additionalInformationModelObj:
|
||||
additionalInformationModelObj ?? this.additionalInformationModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [additional_information_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class AdditionalInformationModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
AdditionalInformationModel({required this.userRegistrationSheet});
|
||||
|
||||
AdditionalInformationModel copyWith() {
|
||||
return AdditionalInformationModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [userRegistrationSheet];
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/allergies_screen/models/allergies_model.dart';
|
||||
part 'allergies_event.dart';
|
||||
part 'allergies_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Allergies according to the event that is dispatched to it.
|
||||
class AllergiesBloc extends Bloc<AllergiesEvent, AllergiesState> {
|
||||
AllergiesBloc(AllergiesState initialState) : super(initialState) {
|
||||
on<AllergiesInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
AllergiesInitialEvent event,
|
||||
Emitter<AllergiesState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(enterInformationController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'allergies_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Allergies widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class AllergiesEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Allergies widget is first created.
|
||||
class AllergiesInitialEvent extends AllergiesEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'allergies_bloc.dart';
|
||||
|
||||
/// Represents the state of Allergies in the application.
|
||||
class AllergiesState extends Equatable {
|
||||
AllergiesState({
|
||||
this.enterInformationController,
|
||||
this.allergiesModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? enterInformationController;
|
||||
|
||||
AllergiesModel? allergiesModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
enterInformationController,
|
||||
allergiesModelObj,
|
||||
];
|
||||
AllergiesState copyWith({
|
||||
TextEditingController? enterInformationController,
|
||||
AllergiesModel? allergiesModelObj,
|
||||
}) {
|
||||
return AllergiesState(
|
||||
enterInformationController:
|
||||
enterInformationController ?? this.enterInformationController,
|
||||
allergiesModelObj: allergiesModelObj ?? this.allergiesModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [allergies_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class AllergiesModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
AllergiesModel({required this.userRegistrationSheet});
|
||||
|
||||
AllergiesModel copyWith() {
|
||||
return AllergiesModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [userRegistrationSheet];
|
||||
}
|
||||
@@ -1,233 +0,0 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'bloc/app_navigation_bloc.dart';
|
||||
import 'models/app_navigation_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppNavigationScreen extends StatefulWidget {
|
||||
const AppNavigationScreen({Key? key})
|
||||
: super(
|
||||
key: key,
|
||||
);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<AppNavigationBloc>(
|
||||
create: (context) => AppNavigationBloc(AppNavigationState(
|
||||
appNavigationModelObj: AppNavigationModel(),
|
||||
),)
|
||||
..add(AppNavigationInitialEvent()),
|
||||
child: AppNavigationScreen(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
State<AppNavigationScreen> createState() => _AppNavigationScreenState();
|
||||
}
|
||||
|
||||
class _AppNavigationScreenState extends State<AppNavigationScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
|
||||
return BlocBuilder<AppNavigationBloc, AppNavigationState>(
|
||||
builder: (context, state) {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor: Color(0XFFFFFFFF),
|
||||
body: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
children: [
|
||||
_buildAppNavigation(context),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFFFFFFFF),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "date_of_birth".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('dateOfBirthScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "city_of_living".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('cityOfLivingScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "body_circumferences".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('bodyCircumferencesScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "weight".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('weightScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "allergies".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('allergiesScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "medicine_intake".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('medicineIntakeScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "splash_screen".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('splashScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "gender".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('genderScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "blood_pressure".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('bloodPressureScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "favorite_sports".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('favoriteSportsScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "favorite_foods".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('favoriteFoodsScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "schedule".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('scheduleScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "additional_information".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('additionalInformationScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "language_select".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('languageSelectScreen'),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "auth".tr,
|
||||
onTapScreenTitle: () => GoRouter.of(context).goNamed('authScreen'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
_buildAppNavigation(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFFFFFFFF),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 10.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.h),
|
||||
child: Text(
|
||||
"App Navigation".tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF000000),
|
||||
fontSize: 20.fSize,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 20.h),
|
||||
child: Text(
|
||||
"Check your app's UI from the below demo screens of your app.".tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF888888),
|
||||
fontSize: 16.fSize,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 5.v),
|
||||
Divider(
|
||||
height: 1.v,
|
||||
thickness: 1.v,
|
||||
color: Color(0XFF000000),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Common widget
|
||||
_buildScreenTitle(
|
||||
BuildContext context, {
|
||||
required String screenTitle,
|
||||
Function? onTapScreenTitle,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: onTapScreenTitle!.call(),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFFFFFFFF),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 10.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.h),
|
||||
child: Text(
|
||||
screenTitle,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF000000),
|
||||
fontSize: 20.fSize,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.v),
|
||||
SizedBox(height: 5.v),
|
||||
Divider(
|
||||
height: 1.v,
|
||||
thickness: 1.v,
|
||||
color: Color(0XFF888888),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/app_navigation_screen/models/app_navigation_model.dart';
|
||||
part 'app_navigation_event.dart';
|
||||
part 'app_navigation_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a AppNavigation according to the event that is dispatched to it.
|
||||
class AppNavigationBloc extends Bloc<AppNavigationEvent, AppNavigationState> {
|
||||
AppNavigationBloc(AppNavigationState initialState) : super(initialState) {
|
||||
on<AppNavigationInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
AppNavigationInitialEvent event,
|
||||
Emitter<AppNavigationState> emit,
|
||||
) async {}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'app_navigation_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///AppNavigation widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class AppNavigationEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the AppNavigation widget is first created.
|
||||
class AppNavigationInitialEvent extends AppNavigationEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'app_navigation_bloc.dart';
|
||||
|
||||
/// Represents the state of AppNavigation in the application.
|
||||
class AppNavigationState extends Equatable {
|
||||
AppNavigationState({this.appNavigationModelObj});
|
||||
|
||||
AppNavigationModel? appNavigationModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
appNavigationModelObj,
|
||||
];
|
||||
AppNavigationState copyWith({AppNavigationModel? appNavigationModelObj}) {
|
||||
return AppNavigationState(
|
||||
appNavigationModelObj:
|
||||
appNavigationModelObj ?? this.appNavigationModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [app_navigation_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class AppNavigationModel extends Equatable {
|
||||
AppNavigationModel();
|
||||
|
||||
AppNavigationModel copyWith() {
|
||||
return AppNavigationModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/blood_pressure_screen/models/blood_pressure_model.dart';
|
||||
|
||||
part 'blood_pressure_event.dart';
|
||||
|
||||
part 'blood_pressure_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a BloodPressure according to the event that is dispatched to it.
|
||||
class BloodPressureBloc extends Bloc<BloodPressureEvent, BloodPressureState> {
|
||||
BloodPressureBloc(BloodPressureState initialState) : super(initialState) {
|
||||
on<BloodPressureInitialEvent>(_onInitialize);
|
||||
on<ChangeHypoDownEvent>(_changeHypoDropDown);
|
||||
on<ChangeHyperDropDownEvent>(_changeHyperDropDown);
|
||||
}
|
||||
|
||||
_changeHyperDropDown(
|
||||
ChangeHyperDropDownEvent event,
|
||||
Emitter<BloodPressureState> emit,
|
||||
) {
|
||||
if (event.value.id == 1) {
|
||||
// state.bloodPressureModelObj!.userRegistrationSheet.hasHyper = '1';
|
||||
} else {
|
||||
// state.bloodPressureModelObj!.userRegistrationSheet.hasHyper = '0';
|
||||
}
|
||||
emit(state.copyWith(selectedHyperValue: event.value));
|
||||
}
|
||||
|
||||
_changeHypoDropDown(
|
||||
ChangeHypoDownEvent event,
|
||||
Emitter<BloodPressureState> emit,
|
||||
) {
|
||||
if (event.value.id == 1) {
|
||||
// state.bloodPressureModelObj!.userRegistrationSheet.hasHypo = '1';
|
||||
} else {
|
||||
// state.bloodPressureModelObj!.userRegistrationSheet.hasHypo = '0';
|
||||
}
|
||||
emit(state.copyWith(selectedHypoValue: event.value));
|
||||
}
|
||||
|
||||
List<SelectionPopupModel> fillDropdownItemList() {
|
||||
return [
|
||||
SelectionPopupModel(
|
||||
id: 1,
|
||||
title: "Да",
|
||||
),
|
||||
SelectionPopupModel(
|
||||
id: 2,
|
||||
title: "Нет",
|
||||
isSelected: true,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
BloodPressureInitialEvent event,
|
||||
Emitter<BloodPressureState> emit,
|
||||
) async {
|
||||
emit(
|
||||
state.copyWith(
|
||||
upPressureController: TextEditingController(),
|
||||
downPressureController: TextEditingController(),
|
||||
),
|
||||
);
|
||||
emit(
|
||||
state.copyWith(
|
||||
bloodPressureModelObj: state.bloodPressureModelObj?.copyWith(dropdownItemList: fillDropdownItemList()),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'blood_pressure_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///BloodPressure widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class BloodPressureEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the BloodPressure widget is first created.
|
||||
class BloodPressureInitialEvent extends BloodPressureEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
///event for dropdown selection
|
||||
class ChangeHyperDropDownEvent extends BloodPressureEvent {
|
||||
ChangeHyperDropDownEvent({required this.value});
|
||||
|
||||
SelectionPopupModel value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
|
||||
class ChangeHypoDownEvent extends BloodPressureEvent {
|
||||
ChangeHypoDownEvent({required this.value});
|
||||
|
||||
SelectionPopupModel value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'blood_pressure_bloc.dart';
|
||||
|
||||
/// Represents the state of BloodPressure in the application.
|
||||
class BloodPressureState extends Equatable {
|
||||
BloodPressureState({
|
||||
this.upPressureController,
|
||||
this.downPressureController,
|
||||
this.selectedHyperValue,
|
||||
this.selectedHypoValue,
|
||||
this.bloodPressureModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? upPressureController;
|
||||
|
||||
TextEditingController? downPressureController;
|
||||
|
||||
SelectionPopupModel? selectedHypoValue;
|
||||
|
||||
SelectionPopupModel? selectedHyperValue;
|
||||
|
||||
BloodPressureModel? bloodPressureModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
upPressureController,
|
||||
downPressureController,
|
||||
selectedHyperValue,
|
||||
selectedHypoValue,
|
||||
bloodPressureModelObj,
|
||||
];
|
||||
BloodPressureState copyWith({
|
||||
TextEditingController? upPressureController,
|
||||
TextEditingController? downPressureController,
|
||||
SelectionPopupModel? selectedHyperValue,
|
||||
SelectionPopupModel? selectedHypoValue,
|
||||
BloodPressureModel? bloodPressureModelObj,
|
||||
}) {
|
||||
return BloodPressureState(
|
||||
upPressureController: upPressureController ?? this.upPressureController,
|
||||
downPressureController:
|
||||
downPressureController ?? this.downPressureController,
|
||||
selectedHyperValue: selectedHyperValue ?? this.selectedHyperValue,
|
||||
selectedHypoValue: selectedHypoValue ?? this.selectedHypoValue,
|
||||
bloodPressureModelObj:
|
||||
bloodPressureModelObj ?? this.bloodPressureModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [blood_pressure_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class BloodPressureModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
BloodPressureModel(
|
||||
{required this.userRegistrationSheet, this.dropdownItemList = const [],});
|
||||
|
||||
List<SelectionPopupModel> dropdownItemList;
|
||||
|
||||
BloodPressureModel copyWith({List<SelectionPopupModel>? dropdownItemList}) {
|
||||
return BloodPressureModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
dropdownItemList: dropdownItemList ?? this.dropdownItemList,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [dropdownItemList, userRegistrationSheet];
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/body_circumferences_screen/models/body_circumferences_model.dart';
|
||||
part 'body_circumferences_event.dart';
|
||||
part 'body_circumferences_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a BodyCircumferences according to the event that is dispatched to it.
|
||||
class BodyCircumferencesBloc
|
||||
extends Bloc<BodyCircumferencesEvent, BodyCircumferencesState> {
|
||||
BodyCircumferencesBloc(BodyCircumferencesState initialState)
|
||||
: super(initialState) {
|
||||
on<BodyCircumferencesInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
BodyCircumferencesInitialEvent event,
|
||||
Emitter<BodyCircumferencesState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
chestCircumferenceController: TextEditingController(),
|
||||
waistCircumferenceController: TextEditingController(),
|
||||
hipCircumferenceController: TextEditingController(),),);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'body_circumferences_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///BodyCircumferences widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class BodyCircumferencesEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the BodyCircumferences widget is first created.
|
||||
class BodyCircumferencesInitialEvent extends BodyCircumferencesEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'body_circumferences_bloc.dart';
|
||||
|
||||
/// Represents the state of BodyCircumferences in the application.
|
||||
class BodyCircumferencesState extends Equatable {
|
||||
BodyCircumferencesState({
|
||||
this.chestCircumferenceController,
|
||||
this.waistCircumferenceController,
|
||||
this.hipCircumferenceController,
|
||||
this.bodyCircumferencesModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? chestCircumferenceController;
|
||||
|
||||
TextEditingController? waistCircumferenceController;
|
||||
|
||||
TextEditingController? hipCircumferenceController;
|
||||
|
||||
BodyCircumferencesModel? bodyCircumferencesModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
chestCircumferenceController,
|
||||
waistCircumferenceController,
|
||||
hipCircumferenceController,
|
||||
bodyCircumferencesModelObj,
|
||||
];
|
||||
BodyCircumferencesState copyWith({
|
||||
TextEditingController? chestCircumferenceController,
|
||||
TextEditingController? waistCircumferenceController,
|
||||
TextEditingController? hipCircumferenceController,
|
||||
BodyCircumferencesModel? bodyCircumferencesModelObj,
|
||||
}) {
|
||||
return BodyCircumferencesState(
|
||||
chestCircumferenceController:
|
||||
chestCircumferenceController ?? this.chestCircumferenceController,
|
||||
waistCircumferenceController:
|
||||
waistCircumferenceController ?? this.waistCircumferenceController,
|
||||
hipCircumferenceController:
|
||||
hipCircumferenceController ?? this.hipCircumferenceController,
|
||||
bodyCircumferencesModelObj:
|
||||
bodyCircumferencesModelObj ?? this.bodyCircumferencesModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [body_circumferences_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class BodyCircumferencesModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
BodyCircumferencesModel({required this.userRegistrationSheet});
|
||||
|
||||
BodyCircumferencesModel copyWith() {
|
||||
return BodyCircumferencesModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [userRegistrationSheet];
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/city_of_living_screen/models/city_of_living_model.dart';
|
||||
part 'city_of_living_event.dart';
|
||||
part 'city_of_living_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a CityOfLiving according to the event that is dispatched to it.
|
||||
class CityOfLivingBloc extends Bloc<CityOfLivingEvent, CityOfLivingState> {
|
||||
CityOfLivingBloc(CityOfLivingState initialState) : super(initialState) {
|
||||
on<CityOfLivingInitialEvent>(_onInitialize);
|
||||
on<ChangeDropDownEvent>(_changeDropDown);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
CityOfLivingInitialEvent event,
|
||||
Emitter<CityOfLivingState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
cityOfLivingModelObj: state.cityOfLivingModelObj?.copyWith(
|
||||
dropdownItemList: fillDropdownItemList(),
|
||||
),),);
|
||||
}
|
||||
|
||||
_changeDropDown(
|
||||
ChangeDropDownEvent event,
|
||||
Emitter<CityOfLivingState> emit,
|
||||
) {
|
||||
emit(state.copyWith(selectedDropDownValue: event.value));
|
||||
// state.cityOfLivingModelObj?.userRegistrationSheet.country =
|
||||
event.value.title;
|
||||
}
|
||||
|
||||
List<SelectionPopupModel> fillDropdownItemList() {
|
||||
return [SelectionPopupModel(id: 1, title: "Россия", isSelected: true)];
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'city_of_living_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///CityOfLiving widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class CityOfLivingEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the CityOfLiving widget is first created.
|
||||
class CityOfLivingInitialEvent extends CityOfLivingEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
///event for dropdown selection
|
||||
class ChangeDropDownEvent extends CityOfLivingEvent {
|
||||
ChangeDropDownEvent({required this.value});
|
||||
|
||||
SelectionPopupModel value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'city_of_living_bloc.dart';
|
||||
|
||||
/// Represents the state of CityOfLiving in the application.
|
||||
class CityOfLivingState extends Equatable {
|
||||
CityOfLivingState({
|
||||
this.selectedDropDownValue,
|
||||
this.cityController,
|
||||
this.cityOfLivingModelObj,
|
||||
});
|
||||
|
||||
SelectionPopupModel? selectedDropDownValue;
|
||||
|
||||
TextEditingController? cityController;
|
||||
|
||||
CityOfLivingModel? cityOfLivingModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
selectedDropDownValue,
|
||||
cityController,
|
||||
cityOfLivingModelObj,
|
||||
];
|
||||
CityOfLivingState copyWith({
|
||||
SelectionPopupModel? selectedDropDownValue,
|
||||
SelectionPopupModel? selectedDropDownValue1,
|
||||
CityOfLivingModel? cityOfLivingModelObj,
|
||||
}) {
|
||||
return CityOfLivingState(
|
||||
selectedDropDownValue:
|
||||
selectedDropDownValue ?? this.selectedDropDownValue,
|
||||
cityController: cityController ?? this.cityController,
|
||||
cityOfLivingModelObj: cityOfLivingModelObj ?? this.cityOfLivingModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,24 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/credentials_screen/models/credentials_model.dart';
|
||||
part 'credentials_event.dart';
|
||||
part 'credentials_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Credentials according to the event that is dispatched to it.
|
||||
class CredentialsBloc extends Bloc<CredentialsEvent, CredentialsState> {
|
||||
CredentialsBloc(CredentialsState initialState) : super(initialState) {
|
||||
on<CredentialsInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
CredentialsInitialEvent event,
|
||||
Emitter<CredentialsState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
emailController: TextEditingController(),
|
||||
nameController: TextEditingController(),
|
||||
passwordController: TextEditingController(),
|
||||
passwordConfirmationController: TextEditingController(),),);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'credentials_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Credentials widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class CredentialsEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Credentials widget is first created.
|
||||
class CredentialsInitialEvent extends CredentialsEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'credentials_bloc.dart';
|
||||
|
||||
/// Represents the state of Credentials in the application.
|
||||
class CredentialsState extends Equatable {
|
||||
CredentialsState({
|
||||
this.emailController,
|
||||
this.nameController,
|
||||
this.passwordController,
|
||||
this.passwordConfirmationController,
|
||||
this.credentialsModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? emailController;
|
||||
|
||||
TextEditingController? nameController;
|
||||
|
||||
TextEditingController? passwordController;
|
||||
|
||||
TextEditingController? passwordConfirmationController;
|
||||
|
||||
CredentialsModel? credentialsModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
emailController,
|
||||
nameController,
|
||||
passwordController,
|
||||
passwordConfirmationController,
|
||||
credentialsModelObj,
|
||||
];
|
||||
CredentialsState copyWith({
|
||||
TextEditingController? nameController,
|
||||
TextEditingController? emailController,
|
||||
TextEditingController? passwordController,
|
||||
TextEditingController? passwordConfirmationController,
|
||||
CredentialsModel? credentialsModelObj,
|
||||
}) {
|
||||
return CredentialsState(
|
||||
emailController: emailController ?? this.emailController,
|
||||
nameController: nameController ?? this.nameController,
|
||||
passwordController: passwordController ?? this.passwordController,
|
||||
passwordConfirmationController:
|
||||
passwordConfirmationController ?? this.passwordConfirmationController,
|
||||
credentialsModelObj: credentialsModelObj ?? this.credentialsModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [credentials_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class CredentialsModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
|
||||
CredentialsModel({required this.userRegistrationSheet});
|
||||
|
||||
CredentialsModel copyWith({UserRegistrationSheet? userRegistrationSheet}) {
|
||||
return CredentialsModel(
|
||||
userRegistrationSheet:
|
||||
userRegistrationSheet ?? this.userRegistrationSheet,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [userRegistrationSheet];
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/date_of_birth_screen/models/date_of_birth_model.dart';
|
||||
part 'date_of_birth_event.dart';
|
||||
part 'date_of_birth_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a DateOfBirth according to the event that is dispatched to it.
|
||||
class DateOfBirthBloc extends Bloc<DateOfBirthEvent, DateOfBirthState> {
|
||||
DateOfBirthBloc(DateOfBirthState initialState) : super(initialState) {
|
||||
on<DateOfBirthInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
DateOfBirthInitialEvent event,
|
||||
Emitter<DateOfBirthState> emit,
|
||||
) async {}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'date_of_birth_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///DateOfBirth widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class DateOfBirthEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the DateOfBirth widget is first created.
|
||||
class DateOfBirthInitialEvent extends DateOfBirthEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'date_of_birth_bloc.dart';
|
||||
|
||||
/// Represents the state of DateOfBirth in the application.
|
||||
class DateOfBirthState extends Equatable {
|
||||
DateOfBirthState({this.dateOfBirthModelObj});
|
||||
|
||||
DateOfBirthModel? dateOfBirthModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
dateOfBirthModelObj,
|
||||
];
|
||||
DateOfBirthState copyWith({DateOfBirthModel? dateOfBirthModelObj}) {
|
||||
return DateOfBirthState(
|
||||
dateOfBirthModelObj: dateOfBirthModelObj ?? this.dateOfBirthModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [date_of_birth_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class DateOfBirthModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
|
||||
DateOfBirthModel({required this.userRegistrationSheet});
|
||||
|
||||
DateOfBirthModel copyWith() {
|
||||
return DateOfBirthModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [userRegistrationSheet];
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/favorite_foods_screen/models/favorite_foods_model.dart';
|
||||
part 'favorite_foods_event.dart';
|
||||
part 'favorite_foods_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a FavoriteFoods according to the event that is dispatched to it.
|
||||
class FavoriteFoodsBloc extends Bloc<FavoriteFoodsEvent, FavoriteFoodsState> {
|
||||
FavoriteFoodsBloc(FavoriteFoodsState initialState) : super(initialState) {
|
||||
on<FavoriteFoodsInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
FavoriteFoodsInitialEvent event,
|
||||
Emitter<FavoriteFoodsState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
favoriteFoodsController: TextEditingController(),
|
||||
unfavoriteFoodsController: TextEditingController(),),);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'favorite_foods_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///FavoriteFoods widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class FavoriteFoodsEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the FavoriteFoods widget is first created.
|
||||
class FavoriteFoodsInitialEvent extends FavoriteFoodsEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'favorite_foods_bloc.dart';
|
||||
|
||||
/// Represents the state of FavoriteFoods in the application.
|
||||
class FavoriteFoodsState extends Equatable {
|
||||
FavoriteFoodsState({
|
||||
this.favoriteFoodsController,
|
||||
this.unfavoriteFoodsController,
|
||||
this.favoriteFoodsModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? favoriteFoodsController;
|
||||
|
||||
TextEditingController? unfavoriteFoodsController;
|
||||
|
||||
FavoriteFoodsModel? favoriteFoodsModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
favoriteFoodsController,
|
||||
unfavoriteFoodsController,
|
||||
favoriteFoodsModelObj,
|
||||
];
|
||||
FavoriteFoodsState copyWith({
|
||||
TextEditingController? favoriteFoodsController,
|
||||
TextEditingController? unfavoriteFoodsController,
|
||||
FavoriteFoodsModel? favoriteFoodsModelObj,
|
||||
}) {
|
||||
return FavoriteFoodsState(
|
||||
favoriteFoodsController:
|
||||
favoriteFoodsController ?? this.favoriteFoodsController,
|
||||
unfavoriteFoodsController:
|
||||
unfavoriteFoodsController ?? this.unfavoriteFoodsController,
|
||||
favoriteFoodsModelObj:
|
||||
favoriteFoodsModelObj ?? this.favoriteFoodsModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [favorite_foods_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class FavoriteFoodsModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
FavoriteFoodsModel({required this.userRegistrationSheet});
|
||||
|
||||
FavoriteFoodsModel copyWith() {
|
||||
return FavoriteFoodsModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [userRegistrationSheet];
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/favorite_sports_screen/models/favorite_sports_model.dart';
|
||||
part 'favorite_sports_event.dart';
|
||||
part 'favorite_sports_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a FavoriteSports according to the event that is dispatched to it.
|
||||
class FavoriteSportsBloc
|
||||
extends Bloc<FavoriteSportsEvent, FavoriteSportsState> {
|
||||
FavoriteSportsBloc(FavoriteSportsState initialState) : super(initialState) {
|
||||
on<FavoriteSportsInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
FavoriteSportsInitialEvent event,
|
||||
Emitter<FavoriteSportsState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(enterinformationController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'favorite_sports_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///FavoriteSports widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class FavoriteSportsEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the FavoriteSports widget is first created.
|
||||
class FavoriteSportsInitialEvent extends FavoriteSportsEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'favorite_sports_bloc.dart';
|
||||
|
||||
/// Represents the state of FavoriteSports in the application.
|
||||
class FavoriteSportsState extends Equatable {
|
||||
FavoriteSportsState({
|
||||
this.enterinformationController,
|
||||
this.favoriteSportsModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? enterinformationController;
|
||||
|
||||
FavoriteSportsModel? favoriteSportsModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
enterinformationController,
|
||||
favoriteSportsModelObj,
|
||||
];
|
||||
FavoriteSportsState copyWith({
|
||||
TextEditingController? enterinformationController,
|
||||
FavoriteSportsModel? favoriteSportsModelObj,
|
||||
}) {
|
||||
return FavoriteSportsState(
|
||||
enterinformationController:
|
||||
enterinformationController ?? this.enterinformationController,
|
||||
favoriteSportsModelObj:
|
||||
favoriteSportsModelObj ?? this.favoriteSportsModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [favorite_sports_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class FavoriteSportsModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
FavoriteSportsModel({required this.userRegistrationSheet});
|
||||
|
||||
FavoriteSportsModel copyWith() {
|
||||
return FavoriteSportsModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [userRegistrationSheet];
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/gender_screen/models/gender_model.dart';
|
||||
part 'gender_event.dart';
|
||||
part 'gender_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Gender according to the event that is dispatched to it.
|
||||
class GenderBloc extends Bloc<GenderEvent, GenderState> {
|
||||
GenderBloc(GenderState initialState) : super(initialState) {
|
||||
on<GenderInitialEvent>(_onInitialize);
|
||||
on<GenderSelectEvent>(_genderSelect);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
GenderInitialEvent event,
|
||||
Emitter<GenderState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(genderModelObj: state.genderModelObj));
|
||||
}
|
||||
|
||||
_genderSelect(
|
||||
GenderSelectEvent event,
|
||||
Emitter<GenderState> emit,
|
||||
) {
|
||||
emit(state.copyWith(selectedRadioValue: event.value));
|
||||
// state.genderModelObj?.userRegistrationSheet.gender = event.value;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'gender_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Gender widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class GenderEvent extends Equatable {}
|
||||
|
||||
class GenderInitialEvent extends GenderEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class GenderSelectEvent extends GenderEvent {
|
||||
GenderSelectEvent({required this.value});
|
||||
|
||||
String value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'gender_bloc.dart';
|
||||
|
||||
/// Represents the state of Gender in the application.
|
||||
class GenderState extends Equatable {
|
||||
GenderState({
|
||||
this.selectedRadioValue,
|
||||
this.genderModelObj,
|
||||
});
|
||||
|
||||
String? selectedRadioValue;
|
||||
|
||||
GenderModel? genderModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
selectedRadioValue,
|
||||
genderModelObj,
|
||||
];
|
||||
GenderState copyWith({
|
||||
String? selectedRadioValue,
|
||||
GenderModel? genderModelObj,
|
||||
}) {
|
||||
return GenderState(
|
||||
selectedRadioValue: selectedRadioValue ?? this.selectedRadioValue,
|
||||
genderModelObj: genderModelObj ?? this.genderModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [gender_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class GenderModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
GenderModel({required this.userRegistrationSheet});
|
||||
|
||||
GenderModel copyWith({UserRegistrationSheet? userRegistrationSheet, gender}) {
|
||||
return GenderModel(
|
||||
userRegistrationSheet:
|
||||
userRegistrationSheet ?? this.userRegistrationSheet,);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [userRegistrationSheet];
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/height_screen/models/height_model.dart';
|
||||
part 'height_event.dart';
|
||||
part 'height_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Height according to the event that is dispatched to it.
|
||||
class HeightBloc extends Bloc<HeightEvent, HeightState> {
|
||||
HeightBloc(HeightState initialState) : super(initialState) {
|
||||
on<HeightInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
HeightInitialEvent event,
|
||||
Emitter<HeightState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
heightModelObj: state.heightModelObj?.copyWith(),
|
||||
heightController: state.heightController,),);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'height_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Height widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class HeightEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Height widget is first created.
|
||||
class HeightInitialEvent extends HeightEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'height_bloc.dart';
|
||||
|
||||
/// Represents the state of Height in the application.
|
||||
class HeightState extends Equatable {
|
||||
HeightState({
|
||||
this.heightController,
|
||||
this.heightModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? heightController;
|
||||
|
||||
HeightModel? heightModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
heightController,
|
||||
heightModelObj,
|
||||
];
|
||||
HeightState copyWith({
|
||||
TextEditingController? heightController,
|
||||
HeightModel? heightModelObj,
|
||||
}) {
|
||||
return HeightState(
|
||||
heightController: heightController ?? this.heightController,
|
||||
heightModelObj: heightModelObj ?? this.heightModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [height_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class HeightModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
HeightModel(
|
||||
{this.dropdownItemList = const [], required this.userRegistrationSheet,});
|
||||
|
||||
List<SelectionPopupModel> dropdownItemList;
|
||||
|
||||
HeightModel copyWith({List<SelectionPopupModel>? dropdownItemList}) {
|
||||
return HeightModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
dropdownItemList: dropdownItemList ?? this.dropdownItemList,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [dropdownItemList, userRegistrationSheet];
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/language_select_screen/models/language_select_model.dart';
|
||||
|
||||
part 'language_select_event.dart';
|
||||
|
||||
part 'language_select_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a LanguageSelect according to the event that is dispatched to it.
|
||||
class LanguageSelectBloc extends Bloc<LanguageSelectEvent, LanguageSelectState> {
|
||||
LanguageSelectBloc(LanguageSelectState initialState) : super(initialState) {
|
||||
on<LanguageSelectInitialEvent>(_onInitialize);
|
||||
on<ChangeDropDownEvent>(_changeDropDown);
|
||||
}
|
||||
|
||||
_onInitialize(LanguageSelectInitialEvent event, Emitter<LanguageSelectState> emit) async {
|
||||
emit(
|
||||
state.copyWith(
|
||||
languageSelectModelObj: state.languageSelectModelObj?.copyWith(dropdownItemList: fillDropdownItemList()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_changeDropDown(ChangeDropDownEvent event, Emitter<LanguageSelectState> emit) {
|
||||
emit(state.copyWith(selectedDropDownValue: event.value));
|
||||
// state.languageSelectModelObj?.userRegistrationSheet.lang = event.value.title;
|
||||
}
|
||||
|
||||
List<SelectionPopupModel> fillDropdownItemList() {
|
||||
return [
|
||||
SelectionPopupModel(id: 1, title: "Русский", isSelected: true),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'language_select_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///LanguageSelect widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class LanguageSelectEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the LanguageSelect widget is first created.
|
||||
class LanguageSelectInitialEvent extends LanguageSelectEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
///event for dropdown selection
|
||||
class ChangeDropDownEvent extends LanguageSelectEvent {
|
||||
ChangeDropDownEvent({required this.value});
|
||||
|
||||
SelectionPopupModel value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'language_select_bloc.dart';
|
||||
|
||||
/// Represents the state of LanguageSelect in the application.
|
||||
class LanguageSelectState extends Equatable {
|
||||
LanguageSelectState({
|
||||
this.selectedDropDownValue,
|
||||
this.languageSelectModelObj,
|
||||
});
|
||||
|
||||
SelectionPopupModel? selectedDropDownValue;
|
||||
|
||||
LanguageSelectModel? languageSelectModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
selectedDropDownValue,
|
||||
languageSelectModelObj,
|
||||
];
|
||||
LanguageSelectState copyWith({
|
||||
SelectionPopupModel? selectedDropDownValue,
|
||||
LanguageSelectModel? languageSelectModelObj,
|
||||
}) {
|
||||
return LanguageSelectState(
|
||||
selectedDropDownValue:
|
||||
selectedDropDownValue ?? this.selectedDropDownValue,
|
||||
languageSelectModelObj:
|
||||
languageSelectModelObj ?? this.languageSelectModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [language_select_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class LanguageSelectModel extends Equatable {
|
||||
LanguageSelectModel({this.dropdownItemList = const []});
|
||||
|
||||
UserRegistrationSheet userRegistrationSheet = UserRegistrationSheet(
|
||||
name: '',
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
email: '',
|
||||
password: '',
|
||||
passwordConfirmation: '',
|
||||
termsAccepted: 'accepted',
|
||||
birthdate: DateTime.now().toString(),
|
||||
gender: '',
|
||||
country: '',
|
||||
city: '',
|
||||
lang: '',
|
||||
weight: '',
|
||||
height: '',
|
||||
chestCircumference: '',
|
||||
waistCircumference: '',
|
||||
hipCircumference: '',
|
||||
bloodPressureUp: '',
|
||||
bloodPressureDown: '',
|
||||
hasHypo: '',
|
||||
hasHyper: '',
|
||||
aboutAllergy: '',
|
||||
aboutTakingPils: '',
|
||||
aboutSportHobbies: '',
|
||||
favoriteFoods: '',
|
||||
unfavoriteFoods: '',
|
||||
additionalInfo: '',
|
||||
);
|
||||
List<SelectionPopupModel> dropdownItemList;
|
||||
|
||||
LanguageSelectModel copyWith({List<SelectionPopupModel>? dropdownItemList}) {
|
||||
return LanguageSelectModel(
|
||||
dropdownItemList: dropdownItemList ?? this.dropdownItemList,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [dropdownItemList];
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/medicine_intake_screen/models/medicine_intake_model.dart';
|
||||
part 'medicine_intake_event.dart';
|
||||
part 'medicine_intake_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a MedicineIntake according to the event that is dispatched to it.
|
||||
class MedicineIntakeBloc
|
||||
extends Bloc<MedicineIntakeEvent, MedicineIntakeState> {
|
||||
MedicineIntakeBloc(MedicineIntakeState initialState) : super(initialState) {
|
||||
on<MedicineIntakeInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
MedicineIntakeInitialEvent event,
|
||||
Emitter<MedicineIntakeState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(enterInformationController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'medicine_intake_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///MedicineIntake widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class MedicineIntakeEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the MedicineIntake widget is first created.
|
||||
class MedicineIntakeInitialEvent extends MedicineIntakeEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'medicine_intake_bloc.dart';
|
||||
|
||||
/// Represents the state of MedicineIntake in the application.
|
||||
class MedicineIntakeState extends Equatable {
|
||||
MedicineIntakeState({
|
||||
this.enterInformationController,
|
||||
this.medicineIntakeModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? enterInformationController;
|
||||
|
||||
MedicineIntakeModel? medicineIntakeModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
enterInformationController,
|
||||
medicineIntakeModelObj,
|
||||
];
|
||||
MedicineIntakeState copyWith({
|
||||
TextEditingController? enterInformationController,
|
||||
MedicineIntakeModel? medicineIntakeModelObj,
|
||||
}) {
|
||||
return MedicineIntakeState(
|
||||
enterInformationController:
|
||||
enterInformationController ?? this.enterInformationController,
|
||||
medicineIntakeModelObj:
|
||||
medicineIntakeModelObj ?? this.medicineIntakeModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [medicine_intake_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class MedicineIntakeModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
MedicineIntakeModel({required this.userRegistrationSheet});
|
||||
|
||||
MedicineIntakeModel copyWith() {
|
||||
return MedicineIntakeModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [userRegistrationSheet];
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/name_screen/models/name_model.dart';
|
||||
part 'name_event.dart';
|
||||
part 'name_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Name according to the event that is dispatched to it.
|
||||
class NameBloc extends Bloc<NameEvent, NameState> {
|
||||
NameBloc(NameState initialState) : super(initialState) {
|
||||
on<NameInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
NameInitialEvent event,
|
||||
Emitter<NameState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
firstNameController: TextEditingController(),
|
||||
lastNameController: TextEditingController(),),);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'name_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Name widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class NameEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Name widget is first created.
|
||||
class NameInitialEvent extends NameEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'name_bloc.dart';
|
||||
|
||||
/// Represents the state of Name in the application.
|
||||
class NameState extends Equatable {
|
||||
NameState({
|
||||
this.firstNameController,
|
||||
this.lastNameController,
|
||||
this.nameModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? firstNameController;
|
||||
|
||||
TextEditingController? lastNameController;
|
||||
|
||||
NameModel? nameModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
firstNameController,
|
||||
lastNameController,
|
||||
nameModelObj,
|
||||
];
|
||||
NameState copyWith({
|
||||
TextEditingController? firstNameController,
|
||||
TextEditingController? lastNameController,
|
||||
NameModel? nameModelObj,
|
||||
}) {
|
||||
return NameState(
|
||||
firstNameController: firstNameController ?? this.firstNameController,
|
||||
lastNameController: lastNameController ?? this.lastNameController,
|
||||
nameModelObj: nameModelObj ?? this.nameModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [name_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class NameModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
NameModel({required this.userRegistrationSheet});
|
||||
|
||||
NameModel copyWith({UserRegistrationSheet? userRegistrationSheet}) {
|
||||
return NameModel(
|
||||
userRegistrationSheet:
|
||||
userRegistrationSheet ?? this.userRegistrationSheet,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import 'package:eatvio_app/app_router.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/splash_screen/models/splash_model.dart';
|
||||
|
||||
part 'splash_event.dart';
|
||||
|
||||
part 'splash_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Splash according to the event that is dispatched to it.
|
||||
class SplashBloc extends Bloc<SplashEvent, SplashState> {
|
||||
SplashBloc(SplashState initialState) : super(initialState) {
|
||||
on<SplashInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
SplashInitialEvent event,
|
||||
Emitter<SplashState> emit,
|
||||
) async {
|
||||
Future.delayed(const Duration(milliseconds: 3000), () {
|
||||
AppRouter.navigatorKey.currentContext?.goNamed('myProfileScreen');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'splash_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Splash widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class SplashEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Splash widget is first created.
|
||||
class SplashInitialEvent extends SplashEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'splash_bloc.dart';
|
||||
|
||||
/// Represents the state of Splash in the application.
|
||||
class SplashState extends Equatable {
|
||||
SplashState({this.splashModelObj});
|
||||
|
||||
SplashModel? splashModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
splashModelObj,
|
||||
];
|
||||
SplashState copyWith({SplashModel? splashModelObj}) {
|
||||
return SplashState(
|
||||
splashModelObj: splashModelObj ?? this.splashModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [splash_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class SplashModel extends Equatable {
|
||||
SplashModel();
|
||||
|
||||
SplashModel copyWith() {
|
||||
return SplashModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
import 'bloc/splash_bloc.dart';
|
||||
import 'models/splash_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SplashScreen extends StatelessWidget {
|
||||
const SplashScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<SplashBloc>(
|
||||
create: (context) =>
|
||||
SplashBloc(SplashState(splashModelObj: SplashModel()))
|
||||
..add(SplashInitialEvent()),
|
||||
child: SplashScreen(),);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return BlocBuilder<SplashBloc, SplashState>(builder: (context, state) {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
body: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 16.v),
|
||||
CustomImageView(
|
||||
imagePath: ImageConstant.img2456927096976,
|
||||
height: 137.adaptSize,
|
||||
width: 137.adaptSize,),
|
||||
],),),),);
|
||||
},);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/registration/weight_screen/models/weight_model.dart';
|
||||
part 'weight_event.dart';
|
||||
part 'weight_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Weight according to the event that is dispatched to it.
|
||||
class WeightBloc extends Bloc<WeightEvent, WeightState> {
|
||||
WeightBloc(WeightState initialState) : super(initialState) {
|
||||
on<WeightInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
WeightInitialEvent event,
|
||||
Emitter<WeightState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
weightModelObj: state.weightModelObj?.copyWith(),
|
||||
weightController: state.weightController,),);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'weight_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Weight widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class WeightEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Weight widget is first created.
|
||||
class WeightInitialEvent extends WeightEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'weight_bloc.dart';
|
||||
|
||||
/// Represents the state of Weight in the application.
|
||||
class WeightState extends Equatable {
|
||||
WeightState({
|
||||
this.weightController,
|
||||
this.weightModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? weightController;
|
||||
|
||||
WeightModel? weightModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
weightController,
|
||||
weightModelObj,
|
||||
];
|
||||
WeightState copyWith({
|
||||
TextEditingController? weightController,
|
||||
WeightModel? weightModelObj,
|
||||
}) {
|
||||
return WeightState(
|
||||
weightController: weightController ?? this.weightController,
|
||||
weightModelObj: weightModelObj ?? this.weightModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [weight_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class WeightModel extends Equatable {
|
||||
UserRegistrationSheet userRegistrationSheet;
|
||||
WeightModel(
|
||||
{this.dropdownItemList = const [], required this.userRegistrationSheet,});
|
||||
|
||||
List<SelectionPopupModel> dropdownItemList;
|
||||
|
||||
WeightModel copyWith({List<SelectionPopupModel>? dropdownItemList}) {
|
||||
return WeightModel(
|
||||
userRegistrationSheet: userRegistrationSheet,
|
||||
dropdownItemList: dropdownItemList ?? this.dropdownItemList,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [dropdownItemList, userRegistrationSheet];
|
||||
}
|
||||
Reference in New Issue
Block a user