feature(registration): new registration flow

This commit is contained in:
mso7nueh
2024-07-11 14:49:50 +03:00
parent c3f7853d0e
commit aacba077b7
23 changed files with 2176 additions and 1967 deletions

View File

@@ -30,148 +30,123 @@ class BloodPressureScreen extends StatefulWidget {
}
class _BloodPressureScreenState extends State<BloodPressureScreen> {
final digitsOnly = FilteringTextInputFormatter.digitsOnly;
@override
Widget build(BuildContext context) {
final digitsOnly = FilteringTextInputFormatter.digitsOnly;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: _buildAppBar(context),
body: Container(
width: double.maxFinite,
padding: EdgeInsets.symmetric(horizontal: 12.h, vertical: 9.v),
child: Column(
children: [
SizedBox(height: 7.v),
Container(
height: 16.v,
width: 343.h,
padding: EdgeInsets.symmetric(horizontal: 4.h),
// Apply padding directly to the Container
decoration: BoxDecoration(
color: theme.colorScheme.onPrimary,
borderRadius: BorderRadius.circular(8.h),
border: Border.all(
color: theme.colorScheme.primary,
width: 1.h,
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80),
child: Container(
width: double.maxFinite,
padding: EdgeInsets.symmetric(horizontal: 12.h, vertical: 9.v),
child: Column(
children: [
SizedBox(
width: 224.h,
child: Text(
"your_blood_pressure".tr,
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: theme.textTheme.headlineSmall,
),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(8.h),
child: LinearProgressIndicator(
value: (9 / 15).toDouble(),
backgroundColor: theme.colorScheme.onPrimary,
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
SizedBox(height: 21.v),
Container(
margin: EdgeInsets.only(right: 1.h),
padding: EdgeInsets.symmetric(horizontal: 3.h),
child: Column(
children: [
Text("up_pressure".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 2.v),
BlocSelector<BloodPressureBloc, BloodPressureState, TextEditingController?>(
selector: (state) => state.upPressureController,
builder: (context, upPressureController) {
return CustomTextFormField(inputFormatters: [digitsOnly], controller: upPressureController, hintText: "90".tr);
},
),
],
),
),
),
SizedBox(height: 21.v),
SizedBox(
width: 224.h,
child: Text(
"your_blood_pressure".tr,
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: theme.textTheme.headlineSmall,
),
),
SizedBox(height: 21.v),
Container(
margin: EdgeInsets.only(right: 1.h),
padding: EdgeInsets.symmetric(horizontal: 3.h),
child: Column(
children: [
Text("up_pressure".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 2.v),
BlocSelector<BloodPressureBloc, BloodPressureState, TextEditingController?>(
selector: (state) => state.upPressureController,
builder: (context, upPressureController) {
return CustomTextFormField(inputFormatters: [digitsOnly], controller: upPressureController, hintText: "90".tr);
},
),
],
),
),
SizedBox(height: 21.v),
Container(
margin: EdgeInsets.only(right: 1.h),
padding: EdgeInsets.symmetric(horizontal: 3.h),
child: Column(
children: [
Text("down_pressure".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 2.v),
BlocSelector<BloodPressureBloc, BloodPressureState, TextEditingController?>(
selector: (state) => state.downPressureController,
builder: (context, downPressureController) {
return CustomTextFormField(inputFormatters: [digitsOnly], controller: downPressureController, hintText: "90".tr);
},
),
],
),
),
SizedBox(height: 22.v),
Text("do_you_have_hypotension_tendency".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 2.v),
Padding(
padding: EdgeInsets.symmetric(horizontal: 4.h),
child: BlocSelector<BloodPressureBloc, BloodPressureState, BloodPressureModel?>(
selector: (state) => state.bloodPressureModelObj,
builder: (context, bloodPressureModelObj) {
return CustomDropDown(
icon: Container(
margin: EdgeInsets.fromLTRB(30.h, 11.v, 13.h, 11.v),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)),
child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),
SizedBox(height: 21.v),
Container(
margin: EdgeInsets.only(right: 1.h),
padding: EdgeInsets.symmetric(horizontal: 3.h),
child: Column(
children: [
Text("down_pressure".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 2.v),
BlocSelector<BloodPressureBloc, BloodPressureState, TextEditingController?>(
selector: (state) => state.downPressureController,
builder: (context, downPressureController) {
return CustomTextFormField(inputFormatters: [digitsOnly], controller: downPressureController, hintText: "90".tr);
},
),
hintText: "Не выбрано".tr,
items: bloodPressureModelObj?.dropdownItemList ?? [],
onChanged: onChangeHyper(context),
);
},
],
),
),
),
SizedBox(height: 22.v),
Text("do_you_have_hypertension_tendency".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 2.v),
Padding(
padding: EdgeInsets.symmetric(horizontal: 4.h),
child: BlocSelector<BloodPressureBloc, BloodPressureState, BloodPressureModel?>(
selector: (state) => state.bloodPressureModelObj,
builder: (context, bloodPressureModelObj) {
return CustomDropDown(
icon: Container(
margin: EdgeInsets.fromLTRB(30.h, 11.v, 13.h, 11.v),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)),
child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),
),
hintText: "Не выбрано".tr,
items: bloodPressureModelObj?.dropdownItemList ?? [],
onChanged: onChangeHypo(context),
);
},
SizedBox(height: 22.v),
Text("do_you_have_hypotension_tendency".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 2.v),
Padding(
padding: EdgeInsets.symmetric(horizontal: 4.h),
child: BlocSelector<BloodPressureBloc, BloodPressureState, BloodPressureModel?>(
selector: (state) => state.bloodPressureModelObj,
builder: (context, bloodPressureModelObj) {
return CustomDropDown(
icon: Container(
margin: EdgeInsets.fromLTRB(30.h, 11.v, 13.h, 11.v),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)),
child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),
),
hintText: "Не выбрано".tr,
items: bloodPressureModelObj?.dropdownItemList ?? [],
onChanged: onChangeHyper(context),
);
},
),
),
),
Spacer(),
BlocBuilder<BloodPressureBloc, BloodPressureState>(
builder: (context, state) {
return NextStepButton(
text: "continue".tr.toUpperCase(),
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
onPressed: onTapContinue(state, context),
);
},
),
BlocBuilder<BloodPressureBloc, BloodPressureState>(
builder: (context, state) {
return GestureDetector(
onTap: onTapSkip(state, context),
child: Text("skip".tr, style: theme.textTheme.bodyLarge),
);
},
),
],
),
SizedBox(height: 22.v),
Text("do_you_have_hypertension_tendency".tr, style: theme.textTheme.bodyLarge),
SizedBox(height: 2.v),
Padding(
padding: EdgeInsets.symmetric(horizontal: 4.h),
child: BlocSelector<BloodPressureBloc, BloodPressureState, BloodPressureModel?>(
selector: (state) => state.bloodPressureModelObj,
builder: (context, bloodPressureModelObj) {
return CustomDropDown(
icon: Container(
margin: EdgeInsets.fromLTRB(30.h, 11.v, 13.h, 11.v),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)),
child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),
),
hintText: "Не выбрано".tr,
items: bloodPressureModelObj?.dropdownItemList ?? [],
onChanged: onChangeHypo(context),
);
},
),
),
// BlocBuilder<BloodPressureBloc, BloodPressureState>(
// builder: (context, state) {
// return NextStepButton(
// text: "continue".tr.toUpperCase(),
// margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
// buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
// onPressed: onTapContinue(state, context),
// );
// },
// ),
// BlocBuilder<BloodPressureBloc, BloodPressureState>(
// builder: (context, state) {
// return GestureDetector(
// onTap: onTapSkip(state, context),
// child: Text("skip".tr, style: theme.textTheme.bodyLarge),
// );
// },
// ),
],
),
),
);
}