forked from eatvio/eatvio_app
feature(registration): new registration flow
This commit is contained in:
@@ -168,8 +168,11 @@ class AuthScreen extends StatelessWidget {
|
||||
|
||||
onTapNoAccount(BuildContext context) {
|
||||
return () {
|
||||
GoRouter.of(context).goNamed('languageSelectScreen');
|
||||
GoRouter.of(context).goNamed('registrationScreen');
|
||||
};
|
||||
// return () {
|
||||
// GoRouter.of(context).goNamed('languageSelectScreen');
|
||||
// };
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
|
||||
@@ -29,46 +29,24 @@ class AdditionalInformationScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (14 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.v),
|
||||
SizedBox(height: 73.v),
|
||||
_buildTextFormField(context),
|
||||
Spacer(),
|
||||
BlocBuilder<AdditionalInformationBloc, AdditionalInformationState>(
|
||||
builder: (context, state) {
|
||||
return NextStepButton(
|
||||
text: "finish".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapFinish(state, context),
|
||||
);
|
||||
},
|
||||
),
|
||||
// BlocBuilder<AdditionalInformationBloc, AdditionalInformationState>(
|
||||
// builder: (context, state) {
|
||||
// return NextStepButton(
|
||||
// text: "finish".tr.toUpperCase(),
|
||||
// margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||
// buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
// onPressed: onTapFinish(state, context),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -28,57 +28,36 @@ class AllergiesScreen extends StatefulWidget {
|
||||
class _AllergiesScreenState extends State<AllergiesScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (10 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 22.v),
|
||||
Text("allergies_presence".tr, style: theme.textTheme.headlineSmall),
|
||||
Spacer(flex: 36),
|
||||
_buildTextFormField(context),
|
||||
Spacer(flex: 54),
|
||||
BlocBuilder<AllergiesBloc, AllergiesState>(
|
||||
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<AllergiesBloc, AllergiesState>(
|
||||
builder: (context, state) {
|
||||
return GestureDetector(
|
||||
onTap: onTapSkip(state, context),
|
||||
child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
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("allergies_presence".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 22.v),
|
||||
_buildTextFormField(context),
|
||||
// BlocBuilder<AllergiesBloc, AllergiesState>(
|
||||
// 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<AllergiesBloc, AllergiesState>(
|
||||
// builder: (context, state) {
|
||||
// return GestureDetector(
|
||||
// onTap: onTapSkip(state, context),
|
||||
// child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_m
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BodyCircumferencesScreen extends StatelessWidget {
|
||||
class BodyCircumferencesScreen extends StatefulWidget {
|
||||
const BodyCircumferencesScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context, sheet) {
|
||||
@@ -23,87 +23,71 @@ class BodyCircumferencesScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
State<BodyCircumferencesScreen> createState() => _BodyCircumferencesScreenState();
|
||||
}
|
||||
|
||||
class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
|
||||
final digitsOnly = FilteringTextInputFormatter.digitsOnly;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final digitsOnly = FilteringTextInputFormatter.digitsOnly;
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
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: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
Text("initial_measurements".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 93.v),
|
||||
Column(
|
||||
children: [
|
||||
Text("chest_circumference".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState, TextEditingController?>(
|
||||
selector: (state) => state.chestCircumferenceController,
|
||||
builder: (context, chestCircumferenceController) {
|
||||
return CustomTextFormField(inputFormatters: [digitsOnly], controller: chestCircumferenceController, hintText: "90".tr);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (6 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
SizedBox(height: 19.v),
|
||||
Text("waist_circumference".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 5.v),
|
||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState, TextEditingController?>(
|
||||
selector: (state) => state.waistCircumferenceController,
|
||||
builder: (context, waistCircumferenceController) {
|
||||
return CustomTextFormField(inputFormatters: [digitsOnly], controller: waistCircumferenceController, hintText: "60".tr);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(height: 39.v),
|
||||
Text("initial_measurements".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 93.v),
|
||||
Column(
|
||||
children: [
|
||||
Text("chest_circumference".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState, TextEditingController?>(
|
||||
selector: (state) => state.chestCircumferenceController,
|
||||
builder: (context, chestCircumferenceController) {
|
||||
return CustomTextFormField(inputFormatters: [digitsOnly], controller: chestCircumferenceController, hintText: "90".tr);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 19.v),
|
||||
Text("waist_circumference".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 5.v),
|
||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState, TextEditingController?>(
|
||||
selector: (state) => state.waistCircumferenceController,
|
||||
builder: (context, waistCircumferenceController) {
|
||||
return CustomTextFormField(inputFormatters: [digitsOnly], controller: waistCircumferenceController, hintText: "60".tr);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 21.v),
|
||||
Text("hip_circumference".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState, TextEditingController?>(
|
||||
selector: (state) => state.hipCircumferenceController,
|
||||
builder: (context, hipCircumferenceController) {
|
||||
return CustomTextFormField(
|
||||
inputFormatters: [digitsOnly],
|
||||
controller: hipCircumferenceController,
|
||||
hintText: "90".tr,
|
||||
textInputAction: TextInputAction.done,
|
||||
);
|
||||
},
|
||||
),
|
||||
Spacer(),
|
||||
BlocBuilder<BodyCircumferencesBloc, BodyCircumferencesState>(
|
||||
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),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 21.v),
|
||||
Text("hip_circumference".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState, TextEditingController?>(
|
||||
selector: (state) => state.hipCircumferenceController,
|
||||
builder: (context, hipCircumferenceController) {
|
||||
return CustomTextFormField(
|
||||
inputFormatters: [digitsOnly],
|
||||
controller: hipCircumferenceController,
|
||||
hintText: "90".tr,
|
||||
textInputAction: TextInputAction.done,
|
||||
);
|
||||
},
|
||||
),
|
||||
// BlocBuilder<BodyCircumferencesBloc, BodyCircumferencesState>(
|
||||
// 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),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,6 @@ import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart';
|
||||
import 'package:validators/validators.dart';
|
||||
import 'package:eatvio_app/widgets/next_step_button.dart';
|
||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -25,34 +24,14 @@ class CredentialsScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (1 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 39.v),
|
||||
Text("user_registration".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 16.v),
|
||||
Text("email".tr, style: theme.textTheme.bodyLarge),
|
||||
@@ -93,17 +72,16 @@ class CredentialsScreen extends StatelessWidget {
|
||||
return CustomTextFormField(obscureText: true, controller: passwordConfirmationController, textInputAction: TextInputAction.done);
|
||||
},
|
||||
),
|
||||
Spacer(),
|
||||
BlocBuilder<CredentialsBloc, CredentialsState>(
|
||||
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<CredentialsBloc, CredentialsState>(
|
||||
// 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),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'bloc/date_of_birth_bloc.dart';
|
||||
@@ -35,53 +36,33 @@ class _DateOfBirthScreenState extends State<DateOfBirthScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return BlocBuilder<DateOfBirthBloc, DateOfBirthState>(
|
||||
builder: (context, state) {
|
||||
return Scaffold(
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: BlocBuilder<DateOfBirthBloc, DateOfBirthState>(
|
||||
builder: (context, state) {
|
||||
return Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (4 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 38.v),
|
||||
Text("date_of_birth".tr, style: theme.textTheme.headlineSmall),
|
||||
Spacer(flex: 39),
|
||||
const SizedBox(height: 32),
|
||||
_buildDateInput(context),
|
||||
Spacer(flex: 60),
|
||||
BlocBuilder<DateOfBirthBloc, DateOfBirthState>(
|
||||
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<DateOfBirthBloc, DateOfBirthState>(
|
||||
// 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),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -138,10 +119,43 @@ class _DateOfBirthScreenState extends State<DateOfBirthScreen> {
|
||||
|
||||
onTapCalendar(BuildContext context) {
|
||||
return () {
|
||||
openDatePickerDialog(context);
|
||||
// openDatePickerDialog(context);
|
||||
_showDialog(
|
||||
CupertinoDatePicker(
|
||||
initialDateTime: DateTime.now(),
|
||||
mode: CupertinoDatePickerMode.date,
|
||||
onDateTimeChanged: (DateTime newTime) {
|
||||
setState(() {
|
||||
selectedDate = newTime;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
void _showDialog(Widget child) {
|
||||
showCupertinoModalPopup<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) => Container(
|
||||
height: 216,
|
||||
padding: const EdgeInsets.only(top: 6.0),
|
||||
// The Bottom margin is provided to align the popup above the system
|
||||
// navigation bar.
|
||||
margin: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).viewInsets.bottom,
|
||||
),
|
||||
// Provide a background color for the popup.
|
||||
color: CupertinoColors.systemBackground.resolveFrom(context),
|
||||
// Use a SafeArea widget to avoid system overlaps.
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
GoRouter.of(context).pop();
|
||||
|
||||
@@ -29,33 +29,13 @@ class FavoriteFoodsScreen extends StatefulWidget {
|
||||
class _FavoriteFoodsScreenState extends State<FavoriteFoodsScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (13 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 19.v),
|
||||
Container(
|
||||
width: 327.h,
|
||||
margin: EdgeInsets.only(left: 8.h, right: 7.h),
|
||||
@@ -71,25 +51,24 @@ class _FavoriteFoodsScreenState extends State<FavoriteFoodsScreen> {
|
||||
_buildTextFormFieldFav(context),
|
||||
SizedBox(height: 12.v),
|
||||
_buildTextFormFieldUnfav(context),
|
||||
Spacer(),
|
||||
BlocBuilder<FavoriteFoodsBloc, FavoriteFoodsState>(
|
||||
builder: (context, state) {
|
||||
return NextStepButton(
|
||||
text: "continue".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 40.v),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapContinue(state, context),
|
||||
);
|
||||
},
|
||||
),
|
||||
BlocBuilder<FavoriteFoodsBloc, FavoriteFoodsState>(
|
||||
builder: (context, state) {
|
||||
return GestureDetector(
|
||||
onTap: onTapSkip(state, context),
|
||||
child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
||||
);
|
||||
},
|
||||
),
|
||||
// BlocBuilder<FavoriteFoodsBloc, FavoriteFoodsState>(
|
||||
// builder: (context, state) {
|
||||
// return NextStepButton(
|
||||
// text: "continue".tr.toUpperCase(),
|
||||
// margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 40.v),
|
||||
// buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
// onPressed: onTapContinue(state, context),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// BlocBuilder<FavoriteFoodsBloc, FavoriteFoodsState>(
|
||||
// builder: (context, state) {
|
||||
// return GestureDetector(
|
||||
// onTap: onTapSkip(state, context),
|
||||
// child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -29,56 +29,35 @@ class FavoriteSportsScreen extends StatefulWidget {
|
||||
class _FavoriteSportsScreenState extends State<FavoriteSportsScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 5.v),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 20.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (12 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 38.v),
|
||||
Text("your_favorite_sports".tr, style: theme.textTheme.headlineSmall),
|
||||
Spacer(flex: 32),
|
||||
SizedBox(height: 22.v),
|
||||
_buildTextFormFieldSection(context),
|
||||
Spacer(flex: 67),
|
||||
BlocBuilder<FavoriteSportsBloc, FavoriteSportsState>(
|
||||
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<FavoriteSportsBloc, FavoriteSportsState>(
|
||||
builder: (context, state) {
|
||||
return GestureDetector(
|
||||
onTap: onTapSkip(state, context),
|
||||
child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
||||
);
|
||||
},
|
||||
),
|
||||
// BlocBuilder<FavoriteSportsBloc, FavoriteSportsState>(
|
||||
// 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<FavoriteSportsBloc, FavoriteSportsState>(
|
||||
// builder: (context, state) {
|
||||
// return GestureDetector(
|
||||
// onTap: onTapSkip(state, context),
|
||||
// child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -31,35 +31,15 @@ class GenderScreen extends StatefulWidget {
|
||||
class _GenderScreenState extends State<GenderScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return BlocBuilder<GenderBloc, GenderState>(
|
||||
builder: (context, state) {
|
||||
return Scaffold(
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: BlocBuilder<GenderBloc, GenderState>(
|
||||
builder: (context, state) {
|
||||
return Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (3 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 36.v),
|
||||
Text("your_gender".tr, style: theme.textTheme.headlineSmall),
|
||||
RadioListTile(
|
||||
title: Text('Мужской'),
|
||||
@@ -83,22 +63,21 @@ class _GenderScreenState extends State<GenderScreen> {
|
||||
height: 40,
|
||||
),
|
||||
),
|
||||
Spacer(flex: 66),
|
||||
BlocBuilder<GenderBloc, GenderState>(
|
||||
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: onTapNext(state, context),
|
||||
);
|
||||
},
|
||||
),
|
||||
// BlocBuilder<GenderBloc, GenderState>(
|
||||
// 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: onTapNext(state, context),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,84 +24,40 @@ class HeightScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return Scaffold(
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.primary,
|
||||
width: 1.h,
|
||||
),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (8 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
appTheme.blueA400,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"height_measurements".tr,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
),
|
||||
SizedBox(height: 39.v),
|
||||
SizedBox(height: 174.v),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
"height_measurements".tr,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
"your_height".tr,
|
||||
style: theme.textTheme.bodyLarge,
|
||||
),
|
||||
SizedBox(height: 174.v),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
"your_height".tr,
|
||||
style: theme.textTheme.bodyLarge,
|
||||
),
|
||||
SizedBox(height: 4.v),
|
||||
BlocBuilder<HeightBloc, HeightState>(
|
||||
builder: (context, state) {
|
||||
return CustomTextFormField(
|
||||
width: 150.h,
|
||||
textInputAction: TextInputAction.done,
|
||||
controller: state.heightController,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
SizedBox(height: 4.v),
|
||||
BlocBuilder<HeightBloc, HeightState>(
|
||||
builder: (context, state) {
|
||||
return CustomTextFormField(
|
||||
width: 150.h,
|
||||
textInputAction: TextInputAction.done,
|
||||
controller: state.heightController,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
BlocBuilder<HeightBloc, HeightState>(
|
||||
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: onTapNext(state, context),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -2,33 +2,29 @@ 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> {
|
||||
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()),),);
|
||||
_onInitialize(LanguageSelectInitialEvent event, Emitter<LanguageSelectState> emit) async {
|
||||
emit(
|
||||
state.copyWith(
|
||||
languageSelectModelObj: state.languageSelectModelObj?.copyWith(dropdownItemList: fillDropdownItemList()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_changeDropDown(
|
||||
ChangeDropDownEvent event,
|
||||
Emitter<LanguageSelectState> emit,
|
||||
) {
|
||||
_changeDropDown(ChangeDropDownEvent event, Emitter<LanguageSelectState> emit) {
|
||||
emit(state.copyWith(selectedDropDownValue: event.value));
|
||||
state.languageSelectModelObj?.userRegistrationSheet.lang =
|
||||
event.value.title;
|
||||
state.languageSelectModelObj?.userRegistrationSheet.lang = event.value.title;
|
||||
}
|
||||
|
||||
List<SelectionPopupModel> fillDropdownItemList() {
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'bloc/language_select_bloc.dart';
|
||||
import 'models/language_select_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/custom_drop_down.dart';
|
||||
import 'package:eatvio_app/widgets/next_step_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LanguageSelectScreen extends StatelessWidget {
|
||||
@@ -24,84 +23,57 @@ class LanguageSelectScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 5.v),
|
||||
child: Column(
|
||||
children: [
|
||||
CustomImageView(imagePath: ImageConstant.imgLogoEatvio, height: 50.adaptSize, width: 50.adaptSize),
|
||||
SizedBox(height: 20.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.primary,
|
||||
width: 1.h,
|
||||
),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (0 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 262.h,
|
||||
margin: EdgeInsets.only(left: 41.h, right: 39.h),
|
||||
child: Text(
|
||||
"preferred_language".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
),
|
||||
SizedBox(height: 20.v),
|
||||
Container(
|
||||
width: 262.h,
|
||||
margin: EdgeInsets.only(left: 41.h, right: 39.h),
|
||||
child: Text(
|
||||
"preferred_language".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
),
|
||||
),
|
||||
Spacer(flex: 36),
|
||||
BlocSelector<LanguageSelectBloc, LanguageSelectState, LanguageSelectModel?>(
|
||||
selector: (state) => state.languageSelectModelObj,
|
||||
builder: (
|
||||
context,
|
||||
languageSelectModelObj,
|
||||
) {
|
||||
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,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
BlocSelector<LanguageSelectBloc, LanguageSelectState, LanguageSelectModel?>(
|
||||
selector: (state) => state.languageSelectModelObj,
|
||||
builder: (
|
||||
context,
|
||||
languageSelectModelObj,
|
||||
) {
|
||||
return CustomDropDown(
|
||||
icon: Container(
|
||||
margin: EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(1.h),
|
||||
),
|
||||
hintText: "Не выбрано".tr,
|
||||
items: languageSelectModelObj?.dropdownItemList ?? [],
|
||||
onChanged: (value) => _onDropDownChanged(context, value),
|
||||
);
|
||||
},
|
||||
),
|
||||
Spacer(flex: 63),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: BlocBuilder<LanguageSelectBloc, LanguageSelectState>(
|
||||
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: _saveAndPush(state, context),
|
||||
);
|
||||
},
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imgFavorite,
|
||||
height: 12.adaptSize,
|
||||
width: 12.adaptSize,
|
||||
),
|
||||
),
|
||||
hintText: "Не выбрано".tr,
|
||||
items: languageSelectModelObj?.dropdownItemList ?? [],
|
||||
onChanged: (value) => _onDropDownChanged(context, value),
|
||||
);
|
||||
},
|
||||
),
|
||||
// bottomNavigationBar: BlocBuilder<LanguageSelectBloc, LanguageSelectState>(
|
||||
// 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: _saveAndPush(state, context),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,34 +29,13 @@ class MedicineIntakeScreen extends StatefulWidget {
|
||||
class _MedicineIntakeScreenState extends State<MedicineIntakeScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (11 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.v),
|
||||
Container(
|
||||
width: 271.h,
|
||||
margin: EdgeInsets.only(left: 35.h, right: 36.h),
|
||||
@@ -70,25 +49,24 @@ class _MedicineIntakeScreenState extends State<MedicineIntakeScreen> {
|
||||
),
|
||||
SizedBox(height: 86.v),
|
||||
_buildTextFormField(context),
|
||||
Spacer(),
|
||||
BlocBuilder<MedicineIntakeBloc, MedicineIntakeState>(
|
||||
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: onTapNext(state, context),
|
||||
);
|
||||
},
|
||||
),
|
||||
BlocBuilder<MedicineIntakeBloc, MedicineIntakeState>(
|
||||
builder: (context, state) {
|
||||
return GestureDetector(
|
||||
onTap: onTapSkip(state, context),
|
||||
child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
||||
);
|
||||
},
|
||||
),
|
||||
// BlocBuilder<MedicineIntakeBloc, MedicineIntakeState>(
|
||||
// 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: onTapNext(state, context),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// BlocBuilder<MedicineIntakeBloc, MedicineIntakeState>(
|
||||
// builder: (context, state) {
|
||||
// return GestureDetector(
|
||||
// onTap: onTapSkip(state, context),
|
||||
// child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -28,34 +28,13 @@ class NameScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.only(bottom: 80),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
border: Border.all(color: theme.colorScheme.primary, width: 1.h),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (2 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 39.v),
|
||||
Text("what_is_your_name".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 93.v),
|
||||
Text("first_name".tr, style: theme.textTheme.bodyLarge),
|
||||
@@ -77,17 +56,16 @@ class NameScreen extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
Spacer(),
|
||||
BlocBuilder<NameBloc, NameState>(
|
||||
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: () => _onTapNext(context, state), // Assign callback function here
|
||||
);
|
||||
},
|
||||
),
|
||||
// BlocBuilder<NameBloc, NameState>(
|
||||
// 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: () => _onTapNext(context, state), // Assign callback function here
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -24,85 +24,42 @@ class WeightScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 7.v),
|
||||
Container(
|
||||
height: 16.v,
|
||||
width: 343.h,
|
||||
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: 16.h, vertical: 9.v),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"weight_measurements".tr,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: (7 / 15).toDouble(),
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
appTheme.blueA400,
|
||||
SizedBox(height: 174.v),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
"your_weight".tr,
|
||||
style: theme.textTheme.bodyLarge,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 4.v),
|
||||
BlocBuilder<WeightBloc, WeightState>(
|
||||
builder: (context, state) {
|
||||
return CustomTextFormField(
|
||||
width: 150.h,
|
||||
textInputAction: TextInputAction.done,
|
||||
controller: state.weightController,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 39.v),
|
||||
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),
|
||||
BlocBuilder<WeightBloc, WeightState>(
|
||||
builder: (context, state) {
|
||||
return CustomTextFormField(
|
||||
width: 150.h,
|
||||
textInputAction: TextInputAction.done,
|
||||
controller: state.weightController,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
BlocBuilder<WeightBloc, WeightState>(
|
||||
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: onTapNext(state, context),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user