feature(registration): refactor i 4
This commit is contained in:
97
flutter_01.log
Normal file
97
flutter_01.log
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
Flutter crash report.
|
||||||
|
Please report a bug at https://github.com/flutter/flutter/issues.
|
||||||
|
|
||||||
|
## command
|
||||||
|
|
||||||
|
flutter analyze
|
||||||
|
|
||||||
|
## exception
|
||||||
|
|
||||||
|
PathNotFoundException: PathNotFoundException: Cannot open file, path = '/home/alex/snap/flutter/common/flutter/version' (OS Error: No such file or directory, errno = 2)
|
||||||
|
|
||||||
|
```
|
||||||
|
#0 _File.throwIfError (dart:io/file_impl.dart:675:7)
|
||||||
|
#1 _File.openSync (dart:io/file_impl.dart:490:5)
|
||||||
|
#2 _File.readAsBytesSync (dart:io/file_impl.dart:574:18)
|
||||||
|
#3 _File.readAsStringSync (dart:io/file_impl.dart:624:18)
|
||||||
|
#4 ForwardingFile.readAsStringSync (package:file/src/forwarding/forwarding_file.dart:99:16)
|
||||||
|
#5 ErrorHandlingFile.readAsStringSync.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:217:22)
|
||||||
|
#6 _runSync (package:flutter_tools/src/base/error_handling_io.dart:587:14)
|
||||||
|
#7 ErrorHandlingFile.readAsStringSync (package:flutter_tools/src/base/error_handling_io.dart:216:12)
|
||||||
|
#8 _DefaultPub.get (package:flutter_tools/src/dart/pub.dart:302:58)
|
||||||
|
#9 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1724:17)
|
||||||
|
<asynchronous suspension>
|
||||||
|
#10 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1394:27)
|
||||||
|
<asynchronous suspension>
|
||||||
|
#11 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
|
||||||
|
<asynchronous suspension>
|
||||||
|
#12 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
|
||||||
|
<asynchronous suspension>
|
||||||
|
#13 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9)
|
||||||
|
<asynchronous suspension>
|
||||||
|
#14 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
|
||||||
|
<asynchronous suspension>
|
||||||
|
#15 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5)
|
||||||
|
<asynchronous suspension>
|
||||||
|
#16 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
|
||||||
|
<asynchronous suspension>
|
||||||
|
#17 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
|
||||||
|
<asynchronous suspension>
|
||||||
|
#18 main (package:flutter_tools/executable.dart:93:3)
|
||||||
|
<asynchronous suspension>
|
||||||
|
```
|
||||||
|
|
||||||
|
## flutter doctor
|
||||||
|
|
||||||
|
```
|
||||||
|
[!] Flutter (Channel [user-branch], 0.0.0-unknown, on Ubuntu 24.04 LTS 6.8.0-38-generic, locale ru_RU.UTF-8)
|
||||||
|
! Flutter version 0.0.0-unknown on channel [user-branch] at /home/alex/snap/flutter/common/flutter
|
||||||
|
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
|
||||||
|
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
|
||||||
|
Cannot resolve current version, possibly due to local changes.
|
||||||
|
Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
|
||||||
|
! Upstream repository unknown source is not a standard remote.
|
||||||
|
Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
|
||||||
|
• Framework revision (), 1970-01-01 03:00:00.000
|
||||||
|
• Engine revision edd8546116
|
||||||
|
• Dart version 3.4.3
|
||||||
|
• DevTools version 2.34.3
|
||||||
|
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
|
||||||
|
|
||||||
|
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
|
||||||
|
• Android SDK at /home/alex/Android/Sdk
|
||||||
|
• Platform android-35, build-tools 35.0.0
|
||||||
|
• Java binary at: /snap/android-studio/161/jbr/bin/java
|
||||||
|
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
|
||||||
|
• All Android licenses accepted.
|
||||||
|
|
||||||
|
[✓] Chrome - develop for the web
|
||||||
|
• Chrome at google-chrome
|
||||||
|
|
||||||
|
[✓] Linux toolchain - develop for Linux desktop
|
||||||
|
• clang version 10.0.0-4ubuntu1
|
||||||
|
• cmake version 3.16.3
|
||||||
|
• ninja version 1.10.0
|
||||||
|
• pkg-config version 0.29.1
|
||||||
|
|
||||||
|
[✓] Android Studio (version 2024.1)
|
||||||
|
• Android Studio at /snap/android-studio/161
|
||||||
|
• Flutter plugin version 80.0.2
|
||||||
|
• Dart plugin can be installed from:
|
||||||
|
🔨 https://plugins.jetbrains.com/plugin/6351-dart
|
||||||
|
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
|
||||||
|
|
||||||
|
[✓] VS Code (version 1.91.1)
|
||||||
|
• VS Code at /usr/share/code
|
||||||
|
• Flutter extension version 3.92.0
|
||||||
|
|
||||||
|
[✓] Connected device (3 available)
|
||||||
|
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 15 (API 35) (emulator)
|
||||||
|
• Linux (desktop) • linux • linux-x64 • Ubuntu 24.04 LTS 6.8.0-38-generic
|
||||||
|
• Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.126
|
||||||
|
|
||||||
|
[✓] Network resources
|
||||||
|
• All expected network resources are available.
|
||||||
|
|
||||||
|
! Doctor found issues in 1 category.
|
||||||
|
```
|
||||||
@@ -176,16 +176,16 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
|||||||
NameScreen(sheet: state.sheet),
|
NameScreen(sheet: state.sheet),
|
||||||
GenderScreen(sheet: state.sheet),
|
GenderScreen(sheet: state.sheet),
|
||||||
DateOfBirthScreen(sheet: state.sheet),
|
DateOfBirthScreen(sheet: state.sheet),
|
||||||
CityOfLivingScreen(),
|
CityOfLivingScreen(sheet: state.sheet), // todo refactor
|
||||||
BodyCircumferencesScreen(),
|
BodyCircumferencesScreen(sheet: state.sheet),
|
||||||
WeightScreen(),
|
WeightScreen(sheet: state.sheet),
|
||||||
HeightScreen(),
|
HeightScreen(sheet: state.sheet),
|
||||||
BloodPressureScreen(),
|
BloodPressureScreen(sheet: state.sheet),
|
||||||
AllergiesScreen(),
|
AllergiesScreen(sheet: state.sheet),
|
||||||
MedicineIntakeScreen(),
|
MedicineIntakeScreen(sheet: state.sheet),
|
||||||
FavoriteSportsScreen(),
|
FavoriteSportsScreen(sheet: state.sheet),
|
||||||
FavoriteFoodsScreen(),
|
FavoriteFoodsScreen(sheet: state.sheet),
|
||||||
AdditionalInformationScreen(),
|
AdditionalInformationScreen(sheet: state.sheet),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -234,6 +234,32 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
|||||||
errorMessage += error + '\n\n';
|
errorMessage += error + '\n\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AlertDialog(
|
||||||
|
title: Text('Ошибка'),
|
||||||
|
content: Text(errorMessage),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
child: Text('OK'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
case 7:
|
||||||
|
List<String> errors = validateCircumferencesFields(state.sheet.chestCircumference, state.sheet.waistCircumference, state.sheet.hipCircumference);
|
||||||
|
if (errors.isEmpty) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
String errorMessage = '';
|
||||||
|
|
||||||
|
for (var error in errors) {
|
||||||
|
errorMessage += error + '\n\n';
|
||||||
|
}
|
||||||
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
@@ -254,6 +280,24 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> validateCircumferencesFields(
|
||||||
|
String chestCircumference,
|
||||||
|
String waistCircumference,
|
||||||
|
String hipCircumference,
|
||||||
|
) {
|
||||||
|
List<String> errors = [];
|
||||||
|
|
||||||
|
if (chestCircumference.isEmpty | waistCircumference.isEmpty | hipCircumference.isEmpty) {
|
||||||
|
errors.add('circumference_empty'.tr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![chestCircumference, waistCircumference, hipCircumference].every((circumference) => int.tryParse(circumference) != null)) {
|
||||||
|
errors.add('circumference_is_not_a_number'.tr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return errors;
|
||||||
|
}
|
||||||
|
|
||||||
List<String> validateCredentialsFields(String email, String name, String password, String passwordConfirmation) {
|
List<String> validateCredentialsFields(String email, String name, String password, String passwordConfirmation) {
|
||||||
List<String> errors = [];
|
List<String> errors = [];
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import 'bloc/additional_information_bloc.dart';
|
import 'bloc/additional_information_bloc.dart';
|
||||||
import 'models/additional_information_model.dart';
|
|
||||||
import 'package:eatvio_app/core/app_export.dart';
|
import 'package:eatvio_app/core/app_export.dart';
|
||||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||||
@@ -11,18 +10,16 @@ import 'dart:convert';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
|
||||||
class AdditionalInformationScreen extends StatelessWidget {
|
class AdditionalInformationScreen extends StatefulWidget {
|
||||||
const AdditionalInformationScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const AdditionalInformationScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<AdditionalInformationBloc>(
|
|
||||||
create: (context) =>
|
|
||||||
AdditionalInformationBloc(AdditionalInformationState(additionalInformationModelObj: AdditionalInformationModel(userRegistrationSheet: sheet)))
|
|
||||||
..add(AdditionalInformationInitialEvent()),
|
|
||||||
child: AdditionalInformationScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AdditionalInformationScreen> createState() => _AdditionalInformationScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AdditionalInformationScreenState extends State<AdditionalInformationScreen> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import 'bloc/allergies_bloc.dart';
|
import 'bloc/allergies_bloc.dart';
|
||||||
|
// ignore: unused_import
|
||||||
import 'models/allergies_model.dart';
|
import 'models/allergies_model.dart';
|
||||||
import 'package:eatvio_app/core/app_export.dart';
|
import 'package:eatvio_app/core/app_export.dart';
|
||||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||||
@@ -8,14 +9,9 @@ import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class AllergiesScreen extends StatefulWidget {
|
class AllergiesScreen extends StatefulWidget {
|
||||||
const AllergiesScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const AllergiesScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<AllergiesBloc>(
|
|
||||||
create: (context) => AllergiesBloc(AllergiesState(allergiesModelObj: AllergiesModel(userRegistrationSheet: sheet)))..add(AllergiesInitialEvent()),
|
|
||||||
child: AllergiesScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AllergiesScreen> createState() => _AllergiesScreenState();
|
State<AllergiesScreen> createState() => _AllergiesScreenState();
|
||||||
@@ -27,33 +23,33 @@ class _AllergiesScreenState extends State<AllergiesScreen> {
|
|||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
padding: EdgeInsets.only(bottom: 80),
|
padding: EdgeInsets.only(bottom: 80),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text("allergies_presence".tr, style: theme.textTheme.headlineSmall),
|
Text("allergies_presence".tr, style: theme.textTheme.headlineSmall),
|
||||||
SizedBox(height: 22.v),
|
SizedBox(height: 22.v),
|
||||||
_buildTextFormField(context),
|
_buildTextFormField(context),
|
||||||
// BlocBuilder<AllergiesBloc, AllergiesState>(
|
// BlocBuilder<AllergiesBloc, AllergiesState>(
|
||||||
// builder: (context, state) {
|
// builder: (context, state) {
|
||||||
// return NextStepButton(
|
// return NextStepButton(
|
||||||
// text: "continue".tr.toUpperCase(),
|
// text: "continue".tr.toUpperCase(),
|
||||||
// margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
// margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
||||||
// buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
// buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||||
// onPressed: onTapContinue(state, context),
|
// onPressed: onTapContinue(state, context),
|
||||||
// );
|
// );
|
||||||
// },
|
// },
|
||||||
// ),
|
// ),
|
||||||
// BlocBuilder<AllergiesBloc, AllergiesState>(
|
// BlocBuilder<AllergiesBloc, AllergiesState>(
|
||||||
// builder: (context, state) {
|
// builder: (context, state) {
|
||||||
// return GestureDetector(
|
// return GestureDetector(
|
||||||
// onTap: onTapSkip(state, context),
|
// onTap: onTapSkip(state, context),
|
||||||
// child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
// child: Text("skip".tr, style: theme.textTheme.bodyLarge),
|
||||||
// );
|
// );
|
||||||
// },
|
// },
|
||||||
// ),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,15 +11,9 @@ import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_m
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class BloodPressureScreen extends StatefulWidget {
|
class BloodPressureScreen extends StatefulWidget {
|
||||||
const BloodPressureScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const BloodPressureScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<BloodPressureBloc>(
|
|
||||||
create: (context) =>
|
|
||||||
BloodPressureBloc(BloodPressureState(bloodPressureModelObj: BloodPressureModel(userRegistrationSheet: sheet)))..add(BloodPressureInitialEvent()),
|
|
||||||
child: BloodPressureScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BloodPressureScreen> createState() => _BloodPressureScreenState();
|
State<BloodPressureScreen> createState() => _BloodPressureScreenState();
|
||||||
|
|||||||
@@ -1,23 +1,15 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart';
|
||||||
|
|
||||||
import 'bloc/body_circumferences_bloc.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'models/body_circumferences_model.dart';
|
|
||||||
import 'package:eatvio_app/core/app_export.dart';
|
import 'package:eatvio_app/core/app_export.dart';
|
||||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class BodyCircumferencesScreen extends StatefulWidget {
|
class BodyCircumferencesScreen extends StatefulWidget {
|
||||||
const BodyCircumferencesScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const BodyCircumferencesScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<BodyCircumferencesBloc>(
|
|
||||||
create: (context) => BodyCircumferencesBloc(BodyCircumferencesState(bodyCircumferencesModelObj: BodyCircumferencesModel(userRegistrationSheet: sheet)))
|
|
||||||
..add(BodyCircumferencesInitialEvent()),
|
|
||||||
child: BodyCircumferencesScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BodyCircumferencesScreen> createState() => _BodyCircumferencesScreenState();
|
State<BodyCircumferencesScreen> createState() => _BodyCircumferencesScreenState();
|
||||||
@@ -25,139 +17,72 @@ class BodyCircumferencesScreen extends StatefulWidget {
|
|||||||
|
|
||||||
class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
|
class _BodyCircumferencesScreenState extends State<BodyCircumferencesScreen> {
|
||||||
final digitsOnly = FilteringTextInputFormatter.digitsOnly;
|
final digitsOnly = FilteringTextInputFormatter.digitsOnly;
|
||||||
|
final chestCircumferenceController = TextEditingController();
|
||||||
|
final waistCircumferenceController = TextEditingController();
|
||||||
|
final hipCircumferenceController = TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
chestCircumferenceController.text = widget.sheet.chestCircumference;
|
||||||
|
waistCircumferenceController.text = widget.sheet.waistCircumference;
|
||||||
|
hipCircumferenceController.text = widget.sheet.hipCircumference;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
padding: EdgeInsets.only(bottom: 80),
|
padding: EdgeInsets.only(bottom: 80),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text("initial_measurements".tr, style: theme.textTheme.headlineSmall),
|
Text("initial_measurements".tr, style: theme.textTheme.headlineSmall),
|
||||||
SizedBox(height: 16.v),
|
SizedBox(height: 16.v),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
Text("chest_circumference".tr, style: theme.textTheme.bodyLarge),
|
Text("chest_circumference".tr, style: theme.textTheme.bodyLarge),
|
||||||
SizedBox(height: 3.v),
|
SizedBox(height: 3.v),
|
||||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState, TextEditingController?>(
|
CustomTextFormField(
|
||||||
selector: (state) => state.chestCircumferenceController,
|
inputFormatters: [digitsOnly],
|
||||||
builder: (context, chestCircumferenceController) {
|
controller: chestCircumferenceController,
|
||||||
return CustomTextFormField(inputFormatters: [digitsOnly], controller: chestCircumferenceController, hintText: "90".tr);
|
hintText: "90".tr,
|
||||||
},
|
onChanged: (value) {
|
||||||
),
|
final registrationCubit = context.read<RegistrationCubit>();
|
||||||
],
|
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(chestCircumference: value));
|
||||||
),
|
},
|
||||||
SizedBox(height: 19.v),
|
),
|
||||||
Text("waist_circumference".tr, style: theme.textTheme.bodyLarge),
|
],
|
||||||
SizedBox(height: 5.v),
|
),
|
||||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState, TextEditingController?>(
|
SizedBox(height: 19.v),
|
||||||
selector: (state) => state.waistCircumferenceController,
|
Text("waist_circumference".tr, style: theme.textTheme.bodyLarge),
|
||||||
builder: (context, waistCircumferenceController) {
|
SizedBox(height: 5.v),
|
||||||
return CustomTextFormField(inputFormatters: [digitsOnly], controller: waistCircumferenceController, hintText: "60".tr);
|
CustomTextFormField(
|
||||||
},
|
inputFormatters: [digitsOnly],
|
||||||
),
|
controller: waistCircumferenceController,
|
||||||
SizedBox(height: 21.v),
|
hintText: "60".tr,
|
||||||
Text("hip_circumference".tr, style: theme.textTheme.bodyLarge),
|
onChanged: (value) {
|
||||||
SizedBox(height: 3.v),
|
final registrationCubit = context.read<RegistrationCubit>();
|
||||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState, TextEditingController?>(
|
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(waistCircumference: value));
|
||||||
selector: (state) => state.hipCircumferenceController,
|
},
|
||||||
builder: (context, hipCircumferenceController) {
|
),
|
||||||
return CustomTextFormField(
|
SizedBox(height: 21.v),
|
||||||
inputFormatters: [digitsOnly],
|
Text("hip_circumference".tr, style: theme.textTheme.bodyLarge),
|
||||||
controller: hipCircumferenceController,
|
SizedBox(height: 3.v),
|
||||||
hintText: "90".tr,
|
CustomTextFormField(
|
||||||
textInputAction: TextInputAction.done,
|
inputFormatters: [digitsOnly],
|
||||||
);
|
controller: hipCircumferenceController,
|
||||||
},
|
hintText: "90".tr,
|
||||||
),
|
textInputAction: TextInputAction.done,
|
||||||
// BlocBuilder<BodyCircumferencesBloc, BodyCircumferencesState>(
|
onChanged: (value) {
|
||||||
// builder: (context, state) {
|
final registrationCubit = context.read<RegistrationCubit>();
|
||||||
// return NextStepButton(
|
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(hipCircumference: value));
|
||||||
// text: "continue".tr.toUpperCase(),
|
},
|
||||||
// margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
|
),
|
||||||
// buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
],
|
||||||
// onPressed: onTapContinue(state, context),
|
),
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onTapContinue(BodyCircumferencesState state, BuildContext context) {
|
|
||||||
return () {
|
|
||||||
List<String> errors =
|
|
||||||
validateFields(state.chestCircumferenceController!.text, state.waistCircumferenceController!.text, state.hipCircumferenceController!.text);
|
|
||||||
if (errors.isEmpty) {
|
|
||||||
UserRegistrationSheet sheet = state.bodyCircumferencesModelObj!.userRegistrationSheet;
|
|
||||||
// sheet.chestCircumference = state.chestCircumferenceController!.text;
|
|
||||||
// sheet.waistCircumference = state.waistCircumferenceController!.text;
|
|
||||||
// sheet.hipCircumference = state.hipCircumferenceController!.text;
|
|
||||||
GoRouter.of(context).goNamed('weightScreen', extra: sheet);
|
|
||||||
} else {
|
|
||||||
String errorMessage = '';
|
|
||||||
|
|
||||||
for (var error in errors) {
|
|
||||||
errorMessage += error + '\n\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => AlertDialog(
|
|
||||||
title: Text('Ошибка'),
|
|
||||||
content: Text(errorMessage),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: onTapOk(context),
|
|
||||||
child: Text('OK'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
onTapOk(BuildContext context) {
|
|
||||||
return () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Function onTapBack(BuildContext context) {
|
|
||||||
return () {
|
|
||||||
onTapArrowLeft(context);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Navigates to the previous screen.
|
|
||||||
onTapArrowLeft(BuildContext context) {
|
|
||||||
GoRouter.of(context).pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Navigates to the weightScreen when the action is triggered.
|
|
||||||
navigateToWeight(BuildContext context) => GoRouter.of(context).goNamed('weightScreen');
|
|
||||||
|
|
||||||
List<String> validateFields(
|
|
||||||
String chestCircumference,
|
|
||||||
String waistCircumference,
|
|
||||||
String hipCircumference,
|
|
||||||
) {
|
|
||||||
List<String> errors = [];
|
|
||||||
|
|
||||||
if (chestCircumference.isEmpty | waistCircumference.isEmpty | hipCircumference.isEmpty) {
|
|
||||||
errors.add('circumference_empty'.tr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (![chestCircumference, waistCircumference, hipCircumference].every((circumference) => int.tryParse(circumference) != null)) {
|
|
||||||
errors.add('circumference_is_not_a_number'.tr);
|
|
||||||
}
|
|
||||||
|
|
||||||
return errors;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import 'bloc/city_of_living_bloc.dart';
|
import 'bloc/city_of_living_bloc.dart';
|
||||||
@@ -8,108 +9,101 @@ import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
|||||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class CityOfLivingScreen extends StatelessWidget {
|
class CityOfLivingScreen extends StatefulWidget {
|
||||||
const CityOfLivingScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const CityOfLivingScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<CityOfLivingBloc>(
|
|
||||||
create: (context) =>
|
|
||||||
CityOfLivingBloc(CityOfLivingState(cityOfLivingModelObj: CityOfLivingModel(userRegistrationSheet: sheet)))..add(CityOfLivingInitialEvent()),
|
|
||||||
child: CityOfLivingScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CityOfLivingScreen> createState() => _CityOfLivingScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CityOfLivingScreenState extends State<CityOfLivingScreen> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SingleChildScrollView(
|
return BlocProvider<CityOfLivingBloc>(
|
||||||
padding: EdgeInsets.only(bottom: 80),
|
create: (BuildContext context) =>
|
||||||
child: Container(
|
CityOfLivingBloc(CityOfLivingState(cityOfLivingModelObj: CityOfLivingModel(userRegistrationSheet: widget.sheet)))..add(CityOfLivingInitialEvent()),
|
||||||
width: double.maxFinite,
|
child: SingleChildScrollView(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
padding: EdgeInsets.only(bottom: 80),
|
||||||
child: Column(
|
child: Container(
|
||||||
children: [
|
width: double.maxFinite,
|
||||||
Text("place_of_living".tr, style: theme.textTheme.headlineSmall),
|
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||||
SizedBox(height: 39.v),
|
child: Column(
|
||||||
Text("country".tr, style: theme.textTheme.bodyLarge),
|
children: [
|
||||||
SizedBox(height: 2.v),
|
Text("place_of_living".tr, style: theme.textTheme.headlineSmall),
|
||||||
BlocSelector<CityOfLivingBloc, CityOfLivingState, CityOfLivingModel?>(
|
SizedBox(height: 39.v),
|
||||||
selector: (state) => state.cityOfLivingModelObj,
|
Text("country".tr, style: theme.textTheme.bodyLarge),
|
||||||
builder: (context, cityOfLivingModelObj) {
|
SizedBox(height: 2.v),
|
||||||
return CustomDropDown(
|
BlocSelector<CityOfLivingBloc, CityOfLivingState, CityOfLivingModel?>(
|
||||||
icon: Container(
|
selector: (state) => state.cityOfLivingModelObj,
|
||||||
margin: EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
|
builder: (context, cityOfLivingModelObj) {
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)),
|
return CustomDropDown(
|
||||||
child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),
|
icon: Container(
|
||||||
),
|
margin: EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
|
||||||
hintText: "Не выбрано".tr,
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)),
|
||||||
items: cityOfLivingModelObj?.dropdownItemList ?? [],
|
child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),
|
||||||
onChanged: onDropDownChange(context),
|
),
|
||||||
);
|
hintText: "Не выбрано".tr,
|
||||||
},
|
items: cityOfLivingModelObj?.dropdownItemList ?? [],
|
||||||
),
|
onChanged: onDropDownChange(context),
|
||||||
SizedBox(height: 22.v),
|
);
|
||||||
Text("Населенный пункт", style: theme.textTheme.bodyLarge),
|
},
|
||||||
SizedBox(height: 2.v),
|
),
|
||||||
BlocBuilder<CityOfLivingBloc, CityOfLivingState>(
|
SizedBox(height: 22.v),
|
||||||
builder: (context, state) {
|
Text("Населенный пункт", style: theme.textTheme.bodyLarge),
|
||||||
return RawAutocomplete<String>(
|
SizedBox(height: 2.v),
|
||||||
optionsBuilder: (TextEditingValue textEditingValue) => _options.where((String option) {
|
BlocBuilder<CityOfLivingBloc, CityOfLivingState>(
|
||||||
return option.toLowerCase().startsWith(textEditingValue.text.toLowerCase());
|
builder: (context, state) {
|
||||||
}),
|
return RawAutocomplete<String>(
|
||||||
fieldViewBuilder: (
|
optionsBuilder: (TextEditingValue textEditingValue) => _options.where((String option) {
|
||||||
BuildContext context,
|
return option.toLowerCase().startsWith(textEditingValue.text.toLowerCase());
|
||||||
TextEditingController textEditingController,
|
}),
|
||||||
FocusNode focusNode,
|
fieldViewBuilder: (
|
||||||
VoidCallback onFieldSubmitted,
|
BuildContext context,
|
||||||
) {
|
TextEditingController textEditingController,
|
||||||
return CustomTextFormField(
|
FocusNode focusNode,
|
||||||
controller: textEditingController,
|
VoidCallback onFieldSubmitted,
|
||||||
focusNode: focusNode,
|
) {
|
||||||
onFieldSubmitted: (String value) => onFieldSubmitted(),
|
return CustomTextFormField(
|
||||||
);
|
controller: textEditingController,
|
||||||
},
|
focusNode: focusNode,
|
||||||
optionsViewBuilder: (
|
onFieldSubmitted: (String value) => onFieldSubmitted(),
|
||||||
BuildContext context,
|
);
|
||||||
AutocompleteOnSelected<String> onSelected,
|
},
|
||||||
Iterable<String> options,
|
optionsViewBuilder: (
|
||||||
) {
|
BuildContext context,
|
||||||
return Align(
|
AutocompleteOnSelected<String> onSelected,
|
||||||
alignment: Alignment.topLeft,
|
Iterable<String> options,
|
||||||
child: Material(
|
) {
|
||||||
elevation: 4.0,
|
return Align(
|
||||||
child: SizedBox(
|
alignment: Alignment.topLeft,
|
||||||
height: 200.0,
|
child: Material(
|
||||||
child: ListView.builder(
|
elevation: 4.0,
|
||||||
padding: const EdgeInsets.all(8.0),
|
child: SizedBox(
|
||||||
itemCount: options.length,
|
height: 200.0,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
child: ListView.builder(
|
||||||
final String option = options.elementAt(index);
|
padding: const EdgeInsets.all(8.0),
|
||||||
return GestureDetector(
|
itemCount: options.length,
|
||||||
onTap: () => onSelected(option),
|
itemBuilder: (BuildContext context, int index) {
|
||||||
child: ListTile(
|
final String option = options.elementAt(index);
|
||||||
title: Text(option),
|
return GestureDetector(
|
||||||
),
|
onTap: () => onSelected(option),
|
||||||
);
|
child: ListTile(
|
||||||
},
|
title: Text(option),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
},
|
||||||
},
|
);
|
||||||
);
|
},
|
||||||
},
|
),
|
||||||
),
|
],
|
||||||
// BlocBuilder<CityOfLivingBloc, CityOfLivingState>(
|
),
|
||||||
// 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),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -125,10 +119,11 @@ class CityOfLivingScreen extends StatelessWidget {
|
|||||||
onDropDownChange(BuildContext context) {
|
onDropDownChange(BuildContext context) {
|
||||||
return (value) {
|
return (value) {
|
||||||
context.read<CityOfLivingBloc>().add(ChangeDropDownEvent(value: 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) {
|
Function onTapBack(BuildContext context) {
|
||||||
return () {
|
return () {
|
||||||
onTapArrowLeft(context);
|
onTapArrowLeft(context);
|
||||||
@@ -141,8 +136,10 @@ class CityOfLivingScreen extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectProduct(AutocompleteOnSelected<String> onSelected, String option, CityOfLivingState state) {
|
selectProduct(AutocompleteOnSelected<String> onSelected, String option, CityOfLivingState state, BuildContext context) {
|
||||||
state.cityController?.text = option;
|
state.cityController?.text = option;
|
||||||
|
final registrationCubit = context.read<RegistrationCubit>();
|
||||||
|
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(city: option));
|
||||||
return () {
|
return () {
|
||||||
onSelected(option);
|
onSelected(option);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,22 +1,15 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import 'bloc/favorite_foods_bloc.dart';
|
import 'bloc/favorite_foods_bloc.dart';
|
||||||
import 'models/favorite_foods_model.dart';
|
|
||||||
import 'package:eatvio_app/core/app_export.dart';
|
import 'package:eatvio_app/core/app_export.dart';
|
||||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class FavoriteFoodsScreen extends StatefulWidget {
|
class FavoriteFoodsScreen extends StatefulWidget {
|
||||||
const FavoriteFoodsScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const FavoriteFoodsScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<FavoriteFoodsBloc>(
|
|
||||||
create: (context) =>
|
|
||||||
FavoriteFoodsBloc(FavoriteFoodsState(favoriteFoodsModelObj: FavoriteFoodsModel(userRegistrationSheet: sheet)))..add(FavoriteFoodsInitialEvent()),
|
|
||||||
child: FavoriteFoodsScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FavoriteFoodsScreen> createState() => _FavoriteFoodsScreenState();
|
State<FavoriteFoodsScreen> createState() => _FavoriteFoodsScreenState();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import 'bloc/favorite_sports_bloc.dart';
|
import 'bloc/favorite_sports_bloc.dart';
|
||||||
|
// ignore: unused_import
|
||||||
import 'models/favorite_sports_model.dart';
|
import 'models/favorite_sports_model.dart';
|
||||||
import 'package:eatvio_app/core/app_export.dart';
|
import 'package:eatvio_app/core/app_export.dart';
|
||||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||||
@@ -8,15 +9,9 @@ import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class FavoriteSportsScreen extends StatefulWidget {
|
class FavoriteSportsScreen extends StatefulWidget {
|
||||||
const FavoriteSportsScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const FavoriteSportsScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<FavoriteSportsBloc>(
|
|
||||||
create: (context) =>
|
|
||||||
FavoriteSportsBloc(FavoriteSportsState(favoriteSportsModelObj: FavoriteSportsModel(userRegistrationSheet: sheet)))..add(FavoriteSportsInitialEvent()),
|
|
||||||
child: FavoriteSportsScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FavoriteSportsScreen> createState() => _FavoriteSportsScreenState();
|
State<FavoriteSportsScreen> createState() => _FavoriteSportsScreenState();
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import 'bloc/height_bloc.dart';
|
import 'bloc/height_bloc.dart';
|
||||||
import 'models/height_model.dart';
|
|
||||||
import 'package:eatvio_app/core/app_export.dart';
|
import 'package:eatvio_app/core/app_export.dart';
|
||||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class HeightScreen extends StatelessWidget {
|
class HeightScreen extends StatefulWidget {
|
||||||
const HeightScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const HeightScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<HeightBloc>(
|
|
||||||
create: (context) => HeightBloc(HeightState(heightModelObj: HeightModel(userRegistrationSheet: sheet)))..add(HeightInitialEvent()),
|
|
||||||
child: HeightScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<HeightScreen> createState() => _HeightScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HeightScreenState extends State<HeightScreen> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
@@ -67,7 +66,6 @@ class HeightScreen extends StatelessWidget {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Function onTapBack(BuildContext context) {
|
Function onTapBack(BuildContext context) {
|
||||||
return () {
|
return () {
|
||||||
onTapArrowLeft(context);
|
onTapArrowLeft(context);
|
||||||
|
|||||||
@@ -1,22 +1,15 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import 'bloc/medicine_intake_bloc.dart';
|
import 'bloc/medicine_intake_bloc.dart';
|
||||||
import 'models/medicine_intake_model.dart';
|
|
||||||
import 'package:eatvio_app/core/app_export.dart';
|
import 'package:eatvio_app/core/app_export.dart';
|
||||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||||
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class MedicineIntakeScreen extends StatefulWidget {
|
class MedicineIntakeScreen extends StatefulWidget {
|
||||||
const MedicineIntakeScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const MedicineIntakeScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<MedicineIntakeBloc>(
|
|
||||||
create: (context) =>
|
|
||||||
MedicineIntakeBloc(MedicineIntakeState(medicineIntakeModelObj: MedicineIntakeModel(userRegistrationSheet: sheet)))..add(MedicineIntakeInitialEvent()),
|
|
||||||
child: MedicineIntakeScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MedicineIntakeScreen> createState() => _MedicineIntakeScreenState();
|
State<MedicineIntakeScreen> createState() => _MedicineIntakeScreenState();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import 'bloc/weight_bloc.dart';
|
import 'bloc/weight_bloc.dart';
|
||||||
import 'models/weight_model.dart';
|
|
||||||
import 'package:eatvio_app/core/app_export.dart';
|
import 'package:eatvio_app/core/app_export.dart';
|
||||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -9,14 +8,9 @@ import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_m
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class WeightScreen extends StatelessWidget {
|
class WeightScreen extends StatelessWidget {
|
||||||
const WeightScreen({Key? key}) : super(key: key);
|
final UserRegistrationSheet sheet;
|
||||||
|
|
||||||
static Widget builder(BuildContext context, sheet) {
|
const WeightScreen({super.key, required this.sheet});
|
||||||
return BlocProvider<WeightBloc>(
|
|
||||||
create: (context) => WeightBloc(WeightState(weightModelObj: WeightModel(userRegistrationSheet: sheet)))..add(WeightInitialEvent()),
|
|
||||||
child: WeightScreen(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
Reference in New Issue
Block a user