remoced Skip btton from reuired fields screens and removed excess section widgets

This commit is contained in:
2023-12-21 12:37:31 +03:00
parent ac0f649069
commit 88a5e2d151
8 changed files with 74 additions and 137 deletions

View File

@@ -56,7 +56,18 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
Text("initial_measurements".tr,
style: theme.textTheme.headlineSmall),
SizedBox(height: 93.v),
_buildTwentySeven(context),
Column(children: [
Text("chest_circumference".tr,
style: theme.textTheme.bodyLarge),
SizedBox(height: 3.v),
BlocSelector<BodyCircumferencesBloc,
BodyCircumferencesState, TextEditingController?>(
selector: (state) => state.valueController,
builder: (context, valueController) {
return CustomTextFormField(
controller: valueController, hintText: "90".tr);
})
]),
SizedBox(height: 19.v),
Text("waist_circumference".tr,
style: theme.textTheme.bodyLarge),
@@ -89,7 +100,6 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
navigateToWeight(context);
}),
SizedBox(height: 17.v),
Text("skip".tr, style: theme.textTheme.bodyLarge)
]))));
}
@@ -107,21 +117,6 @@ class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
}
/// Section Widget
Widget _buildTwentySeven(BuildContext context) {
return Column(children: [
Text("chest_circumference".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 3.v),
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState,
TextEditingController?>(
selector: (state) => state.valueController,
builder: (context, valueController) {
return CustomTextFormField(
controller: valueController, hintText: "90".tr);
})
]);
}
/// Navigates to the previous screen.
onTapArrowLeft(BuildContext context) {
NavigatorService.goBack();

View File

@@ -106,7 +106,6 @@ class CityOfLivingScreen extends StatelessWidget {
navigateToCircumferences(context);
}),
SizedBox(height: 17.v),
Text("skip".tr, style: theme.textTheme.bodyLarge)
]))));
}

View File

@@ -98,7 +98,6 @@ class _CredentialsScreenState extends State<CredentialsScreen> {
navigateToName(context);
}),
SizedBox(height: 17.v),
Text("skip".tr, style: theme.textTheme.bodyLarge)
]))));
}

View File

@@ -65,10 +65,6 @@ class _DateOfBirthScreenState extends State<DateOfBirthScreen> {
navigateToCity(context);
}),
SizedBox(height: 17.v),
Padding(
padding: EdgeInsets.only(left: 8.h),
child:
Text("skip".tr, style: theme.textTheme.bodyLarge))
]))));
});
}
@@ -87,23 +83,6 @@ class _DateOfBirthScreenState extends State<DateOfBirthScreen> {
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
}
/// Section Widget
Widget _buildProgressIndicator(BuildContext context) {
return Container(
width: 343.h,
padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v),
decoration: AppDecoration.outlinePrimary
.copyWith(borderRadius: BorderRadiusStyle.circleBorder8),
child: Container(
height: 8.v,
width: 60.h,
decoration: BoxDecoration(
color: appTheme.blueA400,
borderRadius: BorderRadius.circular(4.h),
border:
Border.all(color: theme.colorScheme.primary, width: 1.h))));
}
/// Section Widget
Widget _buildDateInput(BuildContext context) {
return Container(

View File

@@ -99,7 +99,6 @@ class _GenderScreenState extends State<GenderScreen> {
navigateToDate(context);
}),
SizedBox(height: 17.v),
Text("skip".tr, style: theme.textTheme.bodyLarge)
]))));
});
}
@@ -118,23 +117,6 @@ class _GenderScreenState extends State<GenderScreen> {
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
}
/// Section Widget
Widget _buildProgressIndicator(BuildContext context) {
return Container(
width: 343.h,
padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v),
decoration: AppDecoration.outlinePrimary
.copyWith(borderRadius: BorderRadiusStyle.circleBorder8),
child: Container(
height: 8.v,
width: 40.h,
decoration: BoxDecoration(
color: appTheme.blueA400,
borderRadius: BorderRadius.circular(4.h),
border:
Border.all(color: theme.colorScheme.primary, width: 1.h))));
}
/// Navigates to the previous screen.
onTapArrowLeft(BuildContext context) {
NavigatorService.goBack();

View File

@@ -51,7 +51,37 @@ class _HeightScreenState extends State<HeightScreen> {
valueColor: AlwaysStoppedAnimation<Color>(
appTheme.blueA400)))),
SizedBox(height: 39.v),
_buildTwentySix(context),
Column(children: [
Text("height_measurements".tr,
style: theme.textTheme.headlineSmall),
SizedBox(height: 174.v),
Column(children: [
Text("your_height".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 4.v),
BlocSelector<HeightBloc, HeightState, HeightModel?>(
selector: (state) => state.heightModelObj,
builder: (context, heightModelObj) {
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: "170",
items: heightModelObj?.dropdownItemList ?? [],
onChanged: (value) {
context
.read<HeightBloc>()
.add(ChangeDropDownEvent(value: value));
});
})
])
]),
Spacer(),
CustomOutlinedButton(
text: "continue".tr.toUpperCase(),
@@ -60,7 +90,6 @@ class _HeightScreenState extends State<HeightScreen> {
navigateToAllergies(context);
}),
SizedBox(height: 17.v),
Text("skip".tr, style: theme.textTheme.bodyLarge)
]))));
}
@@ -78,43 +107,6 @@ class _HeightScreenState extends State<HeightScreen> {
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
}
/// Section Widget
Widget _buildWeight(BuildContext context) {
return Column(children: [
Text("your_height".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 4.v),
BlocSelector<HeightBloc, HeightState, HeightModel?>(
selector: (state) => state.heightModelObj,
builder: (context, heightModelObj) {
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: "170",
items: heightModelObj?.dropdownItemList ?? [],
onChanged: (value) {
context
.read<HeightBloc>()
.add(ChangeDropDownEvent(value: value));
});
})
]);
}
/// Section Widget
Widget _buildTwentySix(BuildContext context) {
return Column(children: [
Text("height_measurements".tr, style: theme.textTheme.headlineSmall),
SizedBox(height: 174.v),
_buildWeight(context)
]);
}
/// Navigates to the previous screen.
onTapArrowLeft(BuildContext context) {
NavigatorService.goBack();

View File

@@ -82,7 +82,6 @@ class _NameScreenState extends State<NameScreen> {
navigateToGender(context);
}),
SizedBox(height: 17.v),
Text("skip".tr, style: theme.textTheme.bodyLarge)
]))));
}

View File

@@ -51,7 +51,37 @@ class _WeightScreenState extends State<WeightScreen> {
valueColor: AlwaysStoppedAnimation<Color>(
appTheme.blueA400)))),
SizedBox(height: 39.v),
_buildTwentySix(context),
Column(children: [
Text("weight_measurements".tr,
style: theme.textTheme.headlineSmall),
SizedBox(height: 174.v),
Column(children: [
Text("your_weight".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 4.v),
BlocSelector<WeightBloc, WeightState, WeightModel?>(
selector: (state) => state.weightModelObj,
builder: (context, weightModelObj) {
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: "70",
items: weightModelObj?.dropdownItemList ?? [],
onChanged: (value) {
context
.read<WeightBloc>()
.add(ChangeDropDownEvent(value: value));
});
})
])
]),
Spacer(),
CustomOutlinedButton(
text: "continue".tr.toUpperCase(),
@@ -60,7 +90,6 @@ class _WeightScreenState extends State<WeightScreen> {
navigateToHeight(context);
}),
SizedBox(height: 17.v),
Text("skip".tr, style: theme.textTheme.bodyLarge)
]))));
}
@@ -78,43 +107,6 @@ class _WeightScreenState extends State<WeightScreen> {
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
}
/// Section Widget
Widget _buildWeight(BuildContext context) {
return Column(children: [
Text("your_weight".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 4.v),
BlocSelector<WeightBloc, WeightState, WeightModel?>(
selector: (state) => state.weightModelObj,
builder: (context, weightModelObj) {
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: "70",
items: weightModelObj?.dropdownItemList ?? [],
onChanged: (value) {
context
.read<WeightBloc>()
.add(ChangeDropDownEvent(value: value));
});
})
]);
}
/// Section Widget
Widget _buildTwentySix(BuildContext context) {
return Column(children: [
Text("weight_measurements".tr, style: theme.textTheme.headlineSmall),
SizedBox(height: 174.v),
_buildWeight(context)
]);
}
/// Navigates to the previous screen.
onTapArrowLeft(BuildContext context) {
NavigatorService.goBack();