forked from eatvio/eatvio_app
New screen names
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
import 'bloc/additional_information_bloc.dart';
|
||||
import 'models/additional_information_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AdditionalInformationScreen extends StatelessWidget {
|
||||
const AdditionalInformationScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<AdditionalInformationBloc>(
|
||||
create: (context) => AdditionalInformationBloc(
|
||||
AdditionalInformationState(
|
||||
additionalInformationModelObj: AdditionalInformationModel()))
|
||||
..add(AdditionalInformationInitialEvent()),
|
||||
child: AdditionalInformationScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: 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),
|
||||
_buildProgressIndicator(context),
|
||||
SizedBox(height: 20.v),
|
||||
SizedBox(
|
||||
width: 192.h,
|
||||
child: Text("msg15".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: theme.textTheme.headlineSmall)),
|
||||
SizedBox(height: 73.v),
|
||||
_buildNinetyThree(context),
|
||||
Spacer(),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 31.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildProgressIndicator(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v),
|
||||
decoration: AppDecoration.outlinePrimary
|
||||
.copyWith(borderRadius: BorderRadiusStyle.circleBorder8),
|
||||
child: Container(
|
||||
height: 8.v,
|
||||
width: 332.h,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(4.h),
|
||||
border:
|
||||
Border.all(color: theme.colorScheme.primary, width: 1.h))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildNinetyThree(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 257.v,
|
||||
width: 343.h,
|
||||
child: Stack(alignment: Alignment.center, children: [
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 10.h, top: 69.v),
|
||||
child: Text("msg5".tr, style: theme.textTheme.bodyLarge))),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
Container(
|
||||
width: 294.h,
|
||||
margin: EdgeInsets.only(left: 24.h, right: 23.h),
|
||||
child: Text("msg16".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: CustomTextStyles.titleMediumSegoeUI)),
|
||||
SizedBox(height: 10.v),
|
||||
BlocSelector<AdditionalInformationBloc,
|
||||
AdditionalInformationState, TextEditingController?>(
|
||||
selector: (state) => state.editTextController,
|
||||
builder: (context, editTextController) {
|
||||
return CustomTextFormField(
|
||||
controller: editTextController,
|
||||
textInputAction: TextInputAction.done);
|
||||
})
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/additional_information_screen/models/additional_information_model.dart';
|
||||
part 'additional_information_event.dart';
|
||||
part 'additional_information_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a AdditionalInformation according to the event that is dispatched to it.
|
||||
class AdditionalInformationBloc
|
||||
extends Bloc<AdditionalInformationEvent, AdditionalInformationState> {
|
||||
AdditionalInformationBloc(AdditionalInformationState initialState)
|
||||
: super(initialState) {
|
||||
on<AdditionalInformationInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
AdditionalInformationInitialEvent event,
|
||||
Emitter<AdditionalInformationState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(editTextController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'additional_information_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///AdditionalInformation widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class AdditionalInformationEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the AdditionalInformation widget is first created.
|
||||
class AdditionalInformationInitialEvent extends AdditionalInformationEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'additional_information_bloc.dart';
|
||||
|
||||
/// Represents the state of AdditionalInformation in the application.
|
||||
class AdditionalInformationState extends Equatable {
|
||||
AdditionalInformationState({
|
||||
this.editTextController,
|
||||
this.additionalInformationModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? editTextController;
|
||||
|
||||
AdditionalInformationModel? additionalInformationModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
editTextController,
|
||||
additionalInformationModelObj,
|
||||
];
|
||||
AdditionalInformationState copyWith({
|
||||
TextEditingController? editTextController,
|
||||
AdditionalInformationModel? additionalInformationModelObj,
|
||||
}) {
|
||||
return AdditionalInformationState(
|
||||
editTextController: editTextController ?? this.editTextController,
|
||||
additionalInformationModelObj:
|
||||
additionalInformationModelObj ?? this.additionalInformationModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [additional_information_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class AdditionalInformationModel extends Equatable {
|
||||
AdditionalInformationModel() {}
|
||||
|
||||
AdditionalInformationModel copyWith() {
|
||||
return AdditionalInformationModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
95
lib/presentation/allergies_screen/allergies_screen.dart
Normal file
95
lib/presentation/allergies_screen/allergies_screen.dart
Normal file
@@ -0,0 +1,95 @@
|
||||
import 'bloc/allergies_bloc.dart';
|
||||
import 'models/allergies_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AllergiesScreen extends StatelessWidget {
|
||||
const AllergiesScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<AllergiesBloc>(
|
||||
create: (context) =>
|
||||
AllergiesBloc(AllergiesState(allergiesModelObj: AllergiesModel()))
|
||||
..add(AllergiesInitialEvent()),
|
||||
child: AllergiesScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: 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: 0.41,
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
appTheme.blueA400)))),
|
||||
SizedBox(height: 22.v),
|
||||
Text("msg3".tr, style: CustomTextStyles.headlineSmallMulish),
|
||||
Spacer(flex: 36),
|
||||
_buildNinetyThree(context),
|
||||
Spacer(flex: 63),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 31.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildNinetyThree(BuildContext context) {
|
||||
return Column(children: [
|
||||
Text("msg4".tr, style: CustomTextStyles.titleMediumSegoeUI),
|
||||
SizedBox(height: 2.v),
|
||||
BlocSelector<AllergiesBloc, AllergiesState, TextEditingController?>(
|
||||
selector: (state) => state.enterInformationController,
|
||||
builder: (context, enterInformationController) {
|
||||
return CustomTextFormField(
|
||||
controller: enterInformationController,
|
||||
hintText: "msg5".tr,
|
||||
textInputAction: TextInputAction.done,
|
||||
maxLines: 8);
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
20
lib/presentation/allergies_screen/bloc/allergies_bloc.dart
Normal file
20
lib/presentation/allergies_screen/bloc/allergies_bloc.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/allergies_screen/models/allergies_model.dart';
|
||||
part 'allergies_event.dart';
|
||||
part 'allergies_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Allergies according to the event that is dispatched to it.
|
||||
class AllergiesBloc extends Bloc<AllergiesEvent, AllergiesState> {
|
||||
AllergiesBloc(AllergiesState initialState) : super(initialState) {
|
||||
on<AllergiesInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
AllergiesInitialEvent event,
|
||||
Emitter<AllergiesState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(enterInformationController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
16
lib/presentation/allergies_screen/bloc/allergies_event.dart
Normal file
16
lib/presentation/allergies_screen/bloc/allergies_event.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'allergies_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Allergies widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class AllergiesEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Allergies widget is first created.
|
||||
class AllergiesInitialEvent extends AllergiesEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
31
lib/presentation/allergies_screen/bloc/allergies_state.dart
Normal file
31
lib/presentation/allergies_screen/bloc/allergies_state.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'allergies_bloc.dart';
|
||||
|
||||
/// Represents the state of Allergies in the application.
|
||||
class AllergiesState extends Equatable {
|
||||
AllergiesState({
|
||||
this.enterInformationController,
|
||||
this.allergiesModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? enterInformationController;
|
||||
|
||||
AllergiesModel? allergiesModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
enterInformationController,
|
||||
allergiesModelObj,
|
||||
];
|
||||
AllergiesState copyWith({
|
||||
TextEditingController? enterInformationController,
|
||||
AllergiesModel? allergiesModelObj,
|
||||
}) {
|
||||
return AllergiesState(
|
||||
enterInformationController:
|
||||
enterInformationController ?? this.enterInformationController,
|
||||
allergiesModelObj: allergiesModelObj ?? this.allergiesModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [allergies_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class AllergiesModel extends Equatable {
|
||||
AllergiesModel() {}
|
||||
|
||||
AllergiesModel copyWith() {
|
||||
return AllergiesModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
import 'bloc/app_navigation_bloc.dart';
|
||||
import 'models/app_navigation_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppNavigationScreen extends StatelessWidget {
|
||||
const AppNavigationScreen({Key? key})
|
||||
: super(
|
||||
key: key,
|
||||
);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<AppNavigationBloc>(
|
||||
create: (context) => AppNavigationBloc(AppNavigationState(
|
||||
appNavigationModelObj: AppNavigationModel(),
|
||||
))
|
||||
..add(AppNavigationInitialEvent()),
|
||||
child: AppNavigationScreen(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
|
||||
return BlocBuilder<AppNavigationBloc, AppNavigationState>(
|
||||
builder: (context, state) {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor: Color(0XFFFFFFFF),
|
||||
body: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
children: [
|
||||
_buildAppNavigation(context),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFFFFFFFF),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "date_of_birth".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.dateOfBirthScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "city_of_living".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.cityOfLivingScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "body_circumferences".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.bodyCircumferencesScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "weight".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.weightScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "allergies".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.allergiesScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "medicine_intake".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.medicineIntakeScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "splash_screen".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.splashScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "gender".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.genderScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "blood_pressure".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.bloodPressureScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "favorite_sports".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.favoriteSportsScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "favorite_foods".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.favoriteFoodsScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "schedule".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.scheduleScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "additional_information".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.additionalInformationScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "language_select".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.languageSelectScreen),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildAppNavigation(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFFFFFFFF),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 10.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.h),
|
||||
child: Text(
|
||||
"App Navigation".tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF000000),
|
||||
fontSize: 20.fSize,
|
||||
fontFamily: 'Roboto',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 20.h),
|
||||
child: Text(
|
||||
"Check your app's UI from the below demo screens of your app."
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF888888),
|
||||
fontSize: 16.fSize,
|
||||
fontFamily: 'Roboto',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 5.v),
|
||||
Divider(
|
||||
height: 1.v,
|
||||
thickness: 1.v,
|
||||
color: Color(0XFF000000),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Common widget
|
||||
Widget _buildScreenTitle(
|
||||
BuildContext context, {
|
||||
required String screenTitle,
|
||||
Function? onTapScreenTitle,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTapScreenTitle!.call();
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFFFFFFFF),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 10.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.h),
|
||||
child: Text(
|
||||
screenTitle,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF000000),
|
||||
fontSize: 20.fSize,
|
||||
fontFamily: 'Roboto',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.v),
|
||||
SizedBox(height: 5.v),
|
||||
Divider(
|
||||
height: 1.v,
|
||||
thickness: 1.v,
|
||||
color: Color(0XFF888888),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Common click event
|
||||
void onTapScreenTitle(String routeName) {
|
||||
NavigatorService.pushNamed(routeName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/app_navigation_screen/models/app_navigation_model.dart';
|
||||
part 'app_navigation_event.dart';
|
||||
part 'app_navigation_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a AppNavigation according to the event that is dispatched to it.
|
||||
class AppNavigationBloc extends Bloc<AppNavigationEvent, AppNavigationState> {
|
||||
AppNavigationBloc(AppNavigationState initialState) : super(initialState) {
|
||||
on<AppNavigationInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
AppNavigationInitialEvent event,
|
||||
Emitter<AppNavigationState> emit,
|
||||
) async {}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'app_navigation_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///AppNavigation widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class AppNavigationEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the AppNavigation widget is first created.
|
||||
class AppNavigationInitialEvent extends AppNavigationEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'app_navigation_bloc.dart';
|
||||
|
||||
/// Represents the state of AppNavigation in the application.
|
||||
class AppNavigationState extends Equatable {
|
||||
AppNavigationState({this.appNavigationModelObj});
|
||||
|
||||
AppNavigationModel? appNavigationModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
appNavigationModelObj,
|
||||
];
|
||||
AppNavigationState copyWith({AppNavigationModel? appNavigationModelObj}) {
|
||||
return AppNavigationState(
|
||||
appNavigationModelObj:
|
||||
appNavigationModelObj ?? this.appNavigationModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [app_navigation_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class AppNavigationModel extends Equatable {
|
||||
AppNavigationModel() {}
|
||||
|
||||
AppNavigationModel copyWith() {
|
||||
return AppNavigationModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/blood_pressure_screen/models/blood_pressure_model.dart';
|
||||
part 'blood_pressure_event.dart';
|
||||
part 'blood_pressure_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a BloodPressure according to the event that is dispatched to it.
|
||||
class BloodPressureBloc extends Bloc<BloodPressureEvent, BloodPressureState> {
|
||||
BloodPressureBloc(BloodPressureState initialState) : super(initialState) {
|
||||
on<BloodPressureInitialEvent>(_onInitialize);
|
||||
on<ChangeDropDownEvent>(_changeDropDown);
|
||||
}
|
||||
|
||||
_changeDropDown(
|
||||
ChangeDropDownEvent event,
|
||||
Emitter<BloodPressureState> emit,
|
||||
) {
|
||||
emit(state.copyWith(selectedDropDownValue: event.value));
|
||||
}
|
||||
|
||||
List<SelectionPopupModel> fillDropdownItemList() {
|
||||
return [
|
||||
SelectionPopupModel(id: 1, title: "Item One", isSelected: true),
|
||||
SelectionPopupModel(id: 2, title: "Item Two"),
|
||||
SelectionPopupModel(id: 3, title: "Item Three")
|
||||
];
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
BloodPressureInitialEvent event,
|
||||
Emitter<BloodPressureState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
valueController: TextEditingController(),
|
||||
valueController1: TextEditingController()));
|
||||
emit(state.copyWith(
|
||||
bloodPressureModelObj: state.bloodPressureModelObj
|
||||
?.copyWith(dropdownItemList: fillDropdownItemList())));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'blood_pressure_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///BloodPressure widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class BloodPressureEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the BloodPressure widget is first created.
|
||||
class BloodPressureInitialEvent extends BloodPressureEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
///event for dropdown selection
|
||||
class ChangeDropDownEvent extends BloodPressureEvent {
|
||||
ChangeDropDownEvent({required this.value});
|
||||
|
||||
SelectionPopupModel value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'blood_pressure_bloc.dart';
|
||||
|
||||
/// Represents the state of BloodPressure in the application.
|
||||
class BloodPressureState extends Equatable {
|
||||
BloodPressureState({
|
||||
this.valueController,
|
||||
this.valueController1,
|
||||
this.selectedDropDownValue,
|
||||
this.bloodPressureModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? valueController;
|
||||
|
||||
TextEditingController? valueController1;
|
||||
|
||||
SelectionPopupModel? selectedDropDownValue;
|
||||
|
||||
BloodPressureModel? bloodPressureModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
valueController,
|
||||
valueController1,
|
||||
selectedDropDownValue,
|
||||
bloodPressureModelObj,
|
||||
];
|
||||
BloodPressureState copyWith({
|
||||
TextEditingController? valueController,
|
||||
TextEditingController? valueController1,
|
||||
SelectionPopupModel? selectedDropDownValue,
|
||||
BloodPressureModel? bloodPressureModelObj,
|
||||
}) {
|
||||
return BloodPressureState(
|
||||
valueController: valueController ?? this.valueController,
|
||||
valueController1: valueController1 ?? this.valueController1,
|
||||
selectedDropDownValue:
|
||||
selectedDropDownValue ?? this.selectedDropDownValue,
|
||||
bloodPressureModelObj:
|
||||
bloodPressureModelObj ?? this.bloodPressureModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
import 'bloc/blood_pressure_bloc.dart';
|
||||
import 'models/blood_pressure_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_drop_down.dart';
|
||||
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BloodPressureScreen extends StatelessWidget {
|
||||
const BloodPressureScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<BloodPressureBloc>(
|
||||
create: (context) => BloodPressureBloc(
|
||||
BloodPressureState(bloodPressureModelObj: BloodPressureModel()))
|
||||
..add(BloodPressureInitialEvent()),
|
||||
child: BloodPressureScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: 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),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.h),
|
||||
child: 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.63,
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
appTheme.blueA400))))),
|
||||
SizedBox(height: 21.v),
|
||||
SizedBox(
|
||||
width: 224.h,
|
||||
child: Text("msg7".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: theme.textTheme.headlineSmall)),
|
||||
SizedBox(height: 77.v),
|
||||
_buildThirtyThree(context),
|
||||
SizedBox(height: 22.v),
|
||||
Text("msg9".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 2.v),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.h),
|
||||
child: BlocSelector<BloodPressureBloc, BloodPressureState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.valueController1,
|
||||
builder: (context, valueController1) {
|
||||
return CustomTextFormField(
|
||||
controller: valueController1,
|
||||
hintText: "lbl_60".tr,
|
||||
textInputAction: TextInputAction.done);
|
||||
})),
|
||||
SizedBox(height: 22.v),
|
||||
Text("msg10".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: "lbl14".tr,
|
||||
items:
|
||||
bloodPressureModelObj?.dropdownItemList ??
|
||||
[],
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<BloodPressureBloc>()
|
||||
.add(ChangeDropDownEvent(value: value));
|
||||
});
|
||||
})),
|
||||
Spacer(),
|
||||
CustomOutlinedButton(
|
||||
text: "lbl2".tr.toUpperCase(),
|
||||
margin: EdgeInsets.symmetric(horizontal: 4.h)),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 29.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildThirtyThree(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(right: 1.h),
|
||||
padding: EdgeInsets.symmetric(horizontal: 3.h),
|
||||
child: Column(children: [
|
||||
Text("msg8".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 2.v),
|
||||
BlocSelector<BloodPressureBloc, BloodPressureState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.valueController,
|
||||
builder: (context, valueController) {
|
||||
return CustomTextFormField(
|
||||
controller: valueController, hintText: "lbl_90".tr);
|
||||
})
|
||||
]));
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [blood_pressure_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class BloodPressureModel extends Equatable {
|
||||
BloodPressureModel({this.dropdownItemList = const []}) {}
|
||||
|
||||
List<SelectionPopupModel> dropdownItemList;
|
||||
|
||||
BloodPressureModel copyWith({List<SelectionPopupModel>? dropdownItemList}) {
|
||||
return BloodPressureModel(
|
||||
dropdownItemList: dropdownItemList ?? this.dropdownItemList,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [dropdownItemList];
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/body_circumferences_screen/models/body_circumferences_model.dart';
|
||||
part 'body_circumferences_event.dart';
|
||||
part 'body_circumferences_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a BodyCircumferences according to the event that is dispatched to it.
|
||||
class BodyCircumferencesBloc
|
||||
extends Bloc<BodyCircumferencesEvent, BodyCircumferencesState> {
|
||||
BodyCircumferencesBloc(BodyCircumferencesState initialState)
|
||||
: super(initialState) {
|
||||
on<BodyCircumferencesInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
BodyCircumferencesInitialEvent event,
|
||||
Emitter<BodyCircumferencesState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
valueController: TextEditingController(),
|
||||
valueController1: TextEditingController(),
|
||||
valueController2: TextEditingController()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'body_circumferences_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///BodyCircumferences widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class BodyCircumferencesEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the BodyCircumferences widget is first created.
|
||||
class BodyCircumferencesInitialEvent extends BodyCircumferencesEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'body_circumferences_bloc.dart';
|
||||
|
||||
/// Represents the state of BodyCircumferences in the application.
|
||||
class BodyCircumferencesState extends Equatable {
|
||||
BodyCircumferencesState({
|
||||
this.valueController,
|
||||
this.valueController1,
|
||||
this.valueController2,
|
||||
this.bodyCircumferencesModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? valueController;
|
||||
|
||||
TextEditingController? valueController1;
|
||||
|
||||
TextEditingController? valueController2;
|
||||
|
||||
BodyCircumferencesModel? bodyCircumferencesModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
valueController,
|
||||
valueController1,
|
||||
valueController2,
|
||||
bodyCircumferencesModelObj,
|
||||
];
|
||||
BodyCircumferencesState copyWith({
|
||||
TextEditingController? valueController,
|
||||
TextEditingController? valueController1,
|
||||
TextEditingController? valueController2,
|
||||
BodyCircumferencesModel? bodyCircumferencesModelObj,
|
||||
}) {
|
||||
return BodyCircumferencesState(
|
||||
valueController: valueController ?? this.valueController,
|
||||
valueController1: valueController1 ?? this.valueController1,
|
||||
valueController2: valueController2 ?? this.valueController2,
|
||||
bodyCircumferencesModelObj:
|
||||
bodyCircumferencesModelObj ?? this.bodyCircumferencesModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
import 'bloc/body_circumferences_bloc.dart';
|
||||
import 'models/body_circumferences_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BodyCircumferencesScreen extends StatelessWidget {
|
||||
const BodyCircumferencesScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<BodyCircumferencesBloc>(
|
||||
create: (context) => BodyCircumferencesBloc(BodyCircumferencesState(
|
||||
bodyCircumferencesModelObj: BodyCircumferencesModel()))
|
||||
..add(BodyCircumferencesInitialEvent()),
|
||||
child: BodyCircumferencesScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: 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: 0.29,
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
appTheme.blueA400)))),
|
||||
SizedBox(height: 39.v),
|
||||
Text("msg2".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 93.v),
|
||||
_buildTwentySeven(context),
|
||||
SizedBox(height: 19.v),
|
||||
Text("lbl9".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 5.v),
|
||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.valueController1,
|
||||
builder: (context, valueController1) {
|
||||
return CustomTextFormField(
|
||||
controller: valueController1,
|
||||
hintText: "lbl_60".tr);
|
||||
}),
|
||||
SizedBox(height: 21.v),
|
||||
Text("lbl10".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.valueController2,
|
||||
builder: (context, valueController2) {
|
||||
return CustomTextFormField(
|
||||
controller: valueController2,
|
||||
hintText: "lbl_90".tr,
|
||||
textInputAction: TextInputAction.done);
|
||||
}),
|
||||
Spacer(),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 29.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildTwentySeven(BuildContext context) {
|
||||
return Column(children: [
|
||||
Text("lbl8".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 3.v),
|
||||
BlocSelector<BodyCircumferencesBloc, BodyCircumferencesState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.valueController,
|
||||
builder: (context, valueController) {
|
||||
return CustomTextFormField(
|
||||
controller: valueController, hintText: "lbl_90".tr);
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [body_circumferences_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class BodyCircumferencesModel extends Equatable {
|
||||
BodyCircumferencesModel() {}
|
||||
|
||||
BodyCircumferencesModel copyWith() {
|
||||
return BodyCircumferencesModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/city_of_living_screen/models/city_of_living_model.dart';
|
||||
part 'city_of_living_event.dart';
|
||||
part 'city_of_living_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a CityOfLiving according to the event that is dispatched to it.
|
||||
class CityOfLivingBloc extends Bloc<CityOfLivingEvent, CityOfLivingState> {
|
||||
CityOfLivingBloc(CityOfLivingState initialState) : super(initialState) {
|
||||
on<CityOfLivingInitialEvent>(_onInitialize);
|
||||
on<ChangeDropDownEvent>(_changeDropDown);
|
||||
on<ChangeDropDown1Event>(_changeDropDown1);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
CityOfLivingInitialEvent event,
|
||||
Emitter<CityOfLivingState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
cityOfLivingModelObj: state.cityOfLivingModelObj?.copyWith(
|
||||
dropdownItemList: fillDropdownItemList(),
|
||||
dropdownItemList1: fillDropdownItemList1())));
|
||||
}
|
||||
|
||||
_changeDropDown(
|
||||
ChangeDropDownEvent event,
|
||||
Emitter<CityOfLivingState> emit,
|
||||
) {
|
||||
emit(state.copyWith(selectedDropDownValue: event.value));
|
||||
}
|
||||
|
||||
_changeDropDown1(
|
||||
ChangeDropDown1Event event,
|
||||
Emitter<CityOfLivingState> emit,
|
||||
) {
|
||||
emit(state.copyWith(selectedDropDownValue1: event.value));
|
||||
}
|
||||
|
||||
List<SelectionPopupModel> fillDropdownItemList() {
|
||||
return [
|
||||
SelectionPopupModel(id: 1, title: "Item One", isSelected: true),
|
||||
SelectionPopupModel(id: 2, title: "Item Two"),
|
||||
SelectionPopupModel(id: 3, title: "Item Three")
|
||||
];
|
||||
}
|
||||
|
||||
List<SelectionPopupModel> fillDropdownItemList1() {
|
||||
return [
|
||||
SelectionPopupModel(id: 1, title: "Item One", isSelected: true),
|
||||
SelectionPopupModel(id: 2, title: "Item Two"),
|
||||
SelectionPopupModel(id: 3, title: "Item Three")
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'city_of_living_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///CityOfLiving widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class CityOfLivingEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the CityOfLiving widget is first created.
|
||||
class CityOfLivingInitialEvent extends CityOfLivingEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
///event for dropdown selection
|
||||
class ChangeDropDownEvent extends CityOfLivingEvent {
|
||||
ChangeDropDownEvent({required this.value});
|
||||
|
||||
SelectionPopupModel value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
|
||||
///event for dropdown selection
|
||||
class ChangeDropDown1Event extends CityOfLivingEvent {
|
||||
ChangeDropDown1Event({required this.value});
|
||||
|
||||
SelectionPopupModel value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'city_of_living_bloc.dart';
|
||||
|
||||
/// Represents the state of CityOfLiving in the application.
|
||||
class CityOfLivingState extends Equatable {
|
||||
CityOfLivingState({
|
||||
this.selectedDropDownValue,
|
||||
this.selectedDropDownValue1,
|
||||
this.cityOfLivingModelObj,
|
||||
});
|
||||
|
||||
SelectionPopupModel? selectedDropDownValue;
|
||||
|
||||
SelectionPopupModel? selectedDropDownValue1;
|
||||
|
||||
CityOfLivingModel? cityOfLivingModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
selectedDropDownValue,
|
||||
selectedDropDownValue1,
|
||||
cityOfLivingModelObj,
|
||||
];
|
||||
CityOfLivingState copyWith({
|
||||
SelectionPopupModel? selectedDropDownValue,
|
||||
SelectionPopupModel? selectedDropDownValue1,
|
||||
CityOfLivingModel? cityOfLivingModelObj,
|
||||
}) {
|
||||
return CityOfLivingState(
|
||||
selectedDropDownValue:
|
||||
selectedDropDownValue ?? this.selectedDropDownValue,
|
||||
selectedDropDownValue1:
|
||||
selectedDropDownValue1 ?? this.selectedDropDownValue1,
|
||||
cityOfLivingModelObj: cityOfLivingModelObj ?? this.cityOfLivingModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import 'bloc/city_of_living_bloc.dart';
|
||||
import 'models/city_of_living_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_drop_down.dart';
|
||||
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CityOfLivingScreen extends StatelessWidget {
|
||||
const CityOfLivingScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<CityOfLivingBloc>(
|
||||
create: (context) => CityOfLivingBloc(
|
||||
CityOfLivingState(cityOfLivingModelObj: CityOfLivingModel()))
|
||||
..add(CityOfLivingInitialEvent()),
|
||||
child: CityOfLivingScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: 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)),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: 0.23,
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
appTheme.blueA400)))),
|
||||
SizedBox(height: 39.v),
|
||||
Text("msg".tr, style: theme.textTheme.headlineSmall),
|
||||
Spacer(flex: 34),
|
||||
Text("lbl4".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 2.v),
|
||||
BlocSelector<CityOfLivingBloc, CityOfLivingState,
|
||||
CityOfLivingModel?>(
|
||||
selector: (state) => state.cityOfLivingModelObj,
|
||||
builder: (context, cityOfLivingModelObj) {
|
||||
return CustomDropDown(
|
||||
icon: Container(
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(1.h)),
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imgFavorite,
|
||||
height: 12.adaptSize,
|
||||
width: 12.adaptSize)),
|
||||
hintText: "lbl5".tr,
|
||||
items: cityOfLivingModelObj?.dropdownItemList ?? [],
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<CityOfLivingBloc>()
|
||||
.add(ChangeDropDownEvent(value: value));
|
||||
});
|
||||
}),
|
||||
SizedBox(height: 22.v),
|
||||
Text("lbl6".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 2.v),
|
||||
BlocSelector<CityOfLivingBloc, CityOfLivingState,
|
||||
CityOfLivingModel?>(
|
||||
selector: (state) => state.cityOfLivingModelObj,
|
||||
builder: (context, cityOfLivingModelObj) {
|
||||
return CustomDropDown(
|
||||
icon: Container(
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(1.h)),
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imgFavorite,
|
||||
height: 12.adaptSize,
|
||||
width: 12.adaptSize)),
|
||||
hintText: "lbl7".tr,
|
||||
items:
|
||||
cityOfLivingModelObj?.dropdownItemList1 ?? [],
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<CityOfLivingBloc>()
|
||||
.add(ChangeDropDown1Event(value: value));
|
||||
});
|
||||
}),
|
||||
Spacer(flex: 65),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 29.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [city_of_living_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class CityOfLivingModel extends Equatable {
|
||||
CityOfLivingModel({
|
||||
this.dropdownItemList = const [],
|
||||
this.dropdownItemList1 = const [],
|
||||
}) {}
|
||||
|
||||
List<SelectionPopupModel> dropdownItemList;
|
||||
|
||||
List<SelectionPopupModel> dropdownItemList1;
|
||||
|
||||
CityOfLivingModel copyWith({
|
||||
List<SelectionPopupModel>? dropdownItemList,
|
||||
List<SelectionPopupModel>? dropdownItemList1,
|
||||
}) {
|
||||
return CityOfLivingModel(
|
||||
dropdownItemList: dropdownItemList ?? this.dropdownItemList,
|
||||
dropdownItemList1: dropdownItemList1 ?? this.dropdownItemList1,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [dropdownItemList, dropdownItemList1];
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/date_of_birth_screen/models/date_of_birth_model.dart';
|
||||
part 'date_of_birth_event.dart';
|
||||
part 'date_of_birth_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a DateOfBirth according to the event that is dispatched to it.
|
||||
class DateOfBirthBloc extends Bloc<DateOfBirthEvent, DateOfBirthState> {
|
||||
DateOfBirthBloc(DateOfBirthState initialState) : super(initialState) {
|
||||
on<DateOfBirthInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
DateOfBirthInitialEvent event,
|
||||
Emitter<DateOfBirthState> emit,
|
||||
) async {}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'date_of_birth_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///DateOfBirth widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class DateOfBirthEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the DateOfBirth widget is first created.
|
||||
class DateOfBirthInitialEvent extends DateOfBirthEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'date_of_birth_bloc.dart';
|
||||
|
||||
/// Represents the state of DateOfBirth in the application.
|
||||
class DateOfBirthState extends Equatable {
|
||||
DateOfBirthState({this.dateOfBirthModelObj});
|
||||
|
||||
DateOfBirthModel? dateOfBirthModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
dateOfBirthModelObj,
|
||||
];
|
||||
DateOfBirthState copyWith({DateOfBirthModel? dateOfBirthModelObj}) {
|
||||
return DateOfBirthState(
|
||||
dateOfBirthModelObj: dateOfBirthModelObj ?? this.dateOfBirthModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
114
lib/presentation/date_of_birth_screen/date_of_birth_screen.dart
Normal file
114
lib/presentation/date_of_birth_screen/date_of_birth_screen.dart
Normal file
@@ -0,0 +1,114 @@
|
||||
import 'bloc/date_of_birth_bloc.dart';
|
||||
import 'models/date_of_birth_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DateOfBirthScreen extends StatelessWidget {
|
||||
const DateOfBirthScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<DateOfBirthBloc>(
|
||||
create: (context) => DateOfBirthBloc(
|
||||
DateOfBirthState(dateOfBirthModelObj: DateOfBirthModel()))
|
||||
..add(DateOfBirthInitialEvent()),
|
||||
child: DateOfBirthScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return BlocBuilder<DateOfBirthBloc, DateOfBirthState>(
|
||||
builder: (context, state) {
|
||||
return SafeArea(
|
||||
child: 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),
|
||||
_buildProgressIndicator(context),
|
||||
SizedBox(height: 38.v),
|
||||
Text("lbl".tr, style: theme.textTheme.headlineSmall),
|
||||
Spacer(flex: 39),
|
||||
_buildDateInput(context),
|
||||
Spacer(flex: 60),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 8.h),
|
||||
child: Text("lbl3".tr,
|
||||
style: theme.textTheme.bodyLarge)))
|
||||
]))));
|
||||
});
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 29.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildProgressIndicator(BuildContext context) {
|
||||
return Container(
|
||||
width: 343.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v),
|
||||
decoration: AppDecoration.outlinePrimary
|
||||
.copyWith(borderRadius: BorderRadiusStyle.circleBorder8),
|
||||
child: Container(
|
||||
height: 8.v,
|
||||
width: 60.h,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(4.h),
|
||||
border:
|
||||
Border.all(color: theme.colorScheme.primary, width: 1.h))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildDateInput(BuildContext context) {
|
||||
return Container(
|
||||
width: 343.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 1.v),
|
||||
decoration: AppDecoration.outlineBlueA
|
||||
.copyWith(borderRadius: BorderRadiusStyle.circleBorder8),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CustomImageView(
|
||||
imagePath: ImageConstant.imgFavorite,
|
||||
height: 12.adaptSize,
|
||||
width: 12.adaptSize,
|
||||
radius: BorderRadius.circular(1.h)),
|
||||
SizedBox(height: 6.v),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text("lbl_01_01_2000".tr,
|
||||
style: theme.textTheme.titleMedium)),
|
||||
SizedBox(height: 4.v)
|
||||
]));
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [date_of_birth_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class DateOfBirthModel extends Equatable {
|
||||
DateOfBirthModel() {}
|
||||
|
||||
DateOfBirthModel copyWith() {
|
||||
return DateOfBirthModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/favorite_foods_screen/models/favorite_foods_model.dart';
|
||||
part 'favorite_foods_event.dart';
|
||||
part 'favorite_foods_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a FavoriteFoods according to the event that is dispatched to it.
|
||||
class FavoriteFoodsBloc extends Bloc<FavoriteFoodsEvent, FavoriteFoodsState> {
|
||||
FavoriteFoodsBloc(FavoriteFoodsState initialState) : super(initialState) {
|
||||
on<FavoriteFoodsInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
FavoriteFoodsInitialEvent event,
|
||||
Emitter<FavoriteFoodsState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
enterinformationController: TextEditingController(),
|
||||
enterinformationController1: TextEditingController()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'favorite_foods_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///FavoriteFoods widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class FavoriteFoodsEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the FavoriteFoods widget is first created.
|
||||
class FavoriteFoodsInitialEvent extends FavoriteFoodsEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'favorite_foods_bloc.dart';
|
||||
|
||||
/// Represents the state of FavoriteFoods in the application.
|
||||
class FavoriteFoodsState extends Equatable {
|
||||
FavoriteFoodsState({
|
||||
this.enterinformationController,
|
||||
this.enterinformationController1,
|
||||
this.favoriteFoodsModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? enterinformationController;
|
||||
|
||||
TextEditingController? enterinformationController1;
|
||||
|
||||
FavoriteFoodsModel? favoriteFoodsModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
enterinformationController,
|
||||
enterinformationController1,
|
||||
favoriteFoodsModelObj,
|
||||
];
|
||||
FavoriteFoodsState copyWith({
|
||||
TextEditingController? enterinformationController,
|
||||
TextEditingController? enterinformationController1,
|
||||
FavoriteFoodsModel? favoriteFoodsModelObj,
|
||||
}) {
|
||||
return FavoriteFoodsState(
|
||||
enterinformationController:
|
||||
enterinformationController ?? this.enterinformationController,
|
||||
enterinformationController1:
|
||||
enterinformationController1 ?? this.enterinformationController1,
|
||||
favoriteFoodsModelObj:
|
||||
favoriteFoodsModelObj ?? this.favoriteFoodsModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
import 'bloc/favorite_foods_bloc.dart';
|
||||
import 'models/favorite_foods_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FavoriteFoodsScreen extends StatelessWidget {
|
||||
const FavoriteFoodsScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<FavoriteFoodsBloc>(
|
||||
create: (context) => FavoriteFoodsBloc(
|
||||
FavoriteFoodsState(favoriteFoodsModelObj: FavoriteFoodsModel()))
|
||||
..add(FavoriteFoodsInitialEvent()),
|
||||
child: FavoriteFoodsScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: 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),
|
||||
_buildProgressIndicator(context),
|
||||
SizedBox(height: 19.v),
|
||||
Container(
|
||||
width: 327.h,
|
||||
margin: EdgeInsets.only(left: 8.h, right: 7.h),
|
||||
child: Text("msg12".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: theme.textTheme.headlineSmall)),
|
||||
SizedBox(height: 23.v),
|
||||
_buildNinetyThree(context),
|
||||
SizedBox(height: 22.v),
|
||||
_buildNinetyThree1(context),
|
||||
SizedBox(height: 27.v),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 31.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildProgressIndicator(BuildContext context) {
|
||||
return Container(
|
||||
width: 343.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v),
|
||||
decoration: AppDecoration.outlinePrimary
|
||||
.copyWith(borderRadius: BorderRadiusStyle.circleBorder8),
|
||||
child: Container(
|
||||
height: 8.v,
|
||||
width: 279.h,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(4.h),
|
||||
border:
|
||||
Border.all(color: theme.colorScheme.primary, width: 1.h))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildNinetyThree(BuildContext context) {
|
||||
return Column(children: [
|
||||
Text("lbl15".tr, style: CustomTextStyles.titleMediumSegoeUI),
|
||||
SizedBox(height: 2.v),
|
||||
BlocSelector<FavoriteFoodsBloc, FavoriteFoodsState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.enterinformationController,
|
||||
builder: (context, enterinformationController) {
|
||||
return CustomTextFormField(
|
||||
controller: enterinformationController,
|
||||
hintText: "msg5".tr,
|
||||
maxLines: 8);
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildNinetyThree1(BuildContext context) {
|
||||
return Column(children: [
|
||||
Text("msg13".tr, style: CustomTextStyles.titleMediumSegoeUI),
|
||||
SizedBox(height: 2.v),
|
||||
BlocSelector<FavoriteFoodsBloc, FavoriteFoodsState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.enterinformationController1,
|
||||
builder: (context, enterinformationController1) {
|
||||
return CustomTextFormField(
|
||||
controller: enterinformationController1,
|
||||
hintText: "msg5".tr,
|
||||
textInputAction: TextInputAction.done,
|
||||
maxLines: 8);
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [favorite_foods_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class FavoriteFoodsModel extends Equatable {
|
||||
FavoriteFoodsModel() {}
|
||||
|
||||
FavoriteFoodsModel copyWith() {
|
||||
return FavoriteFoodsModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/favorite_sports_screen/models/favorite_sports_model.dart';
|
||||
part 'favorite_sports_event.dart';
|
||||
part 'favorite_sports_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a FavoriteSports according to the event that is dispatched to it.
|
||||
class FavoriteSportsBloc
|
||||
extends Bloc<FavoriteSportsEvent, FavoriteSportsState> {
|
||||
FavoriteSportsBloc(FavoriteSportsState initialState) : super(initialState) {
|
||||
on<FavoriteSportsInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
FavoriteSportsInitialEvent event,
|
||||
Emitter<FavoriteSportsState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
enterinformationController: TextEditingController(),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'favorite_sports_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///FavoriteSports widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class FavoriteSportsEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the FavoriteSports widget is first created.
|
||||
class FavoriteSportsInitialEvent extends FavoriteSportsEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'favorite_sports_bloc.dart';
|
||||
|
||||
/// Represents the state of FavoriteSports in the application.
|
||||
class FavoriteSportsState extends Equatable {
|
||||
FavoriteSportsState({
|
||||
this.enterinformationController,
|
||||
this.favoriteSportsModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? enterinformationController;
|
||||
|
||||
FavoriteSportsModel? favoriteSportsModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
enterinformationController,
|
||||
favoriteSportsModelObj,
|
||||
];
|
||||
FavoriteSportsState copyWith({
|
||||
TextEditingController? enterinformationController,
|
||||
FavoriteSportsModel? favoriteSportsModelObj,
|
||||
}) {
|
||||
return FavoriteSportsState(
|
||||
enterinformationController:
|
||||
enterinformationController ?? this.enterinformationController,
|
||||
favoriteSportsModelObj:
|
||||
favoriteSportsModelObj ?? this.favoriteSportsModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
import 'bloc/favorite_sports_bloc.dart';
|
||||
import 'models/favorite_sports_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FavoriteSportsScreen extends StatelessWidget {
|
||||
const FavoriteSportsScreen({Key? key})
|
||||
: super(
|
||||
key: key,
|
||||
);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<FavoriteSportsBloc>(
|
||||
create: (context) => FavoriteSportsBloc(FavoriteSportsState(
|
||||
favoriteSportsModelObj: FavoriteSportsModel(),
|
||||
))
|
||||
..add(FavoriteSportsInitialEvent()),
|
||||
child: FavoriteSportsScreen(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16.h,
|
||||
vertical: 5.v,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CustomImageView(
|
||||
imagePath: ImageConstant.imgLogoEatvio,
|
||||
height: 50.adaptSize,
|
||||
width: 50.adaptSize,
|
||||
),
|
||||
SizedBox(height: 20.v),
|
||||
_buildProgressIndicatorSection(context),
|
||||
SizedBox(height: 38.v),
|
||||
Text(
|
||||
"msg11".tr,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
),
|
||||
Spacer(
|
||||
flex: 32,
|
||||
),
|
||||
_buildNinetyThreeSection(context),
|
||||
Spacer(
|
||||
flex: 67,
|
||||
),
|
||||
CustomOutlinedButton(
|
||||
text: "lbl2".tr.toUpperCase(),
|
||||
),
|
||||
SizedBox(height: 17.v),
|
||||
Text(
|
||||
"lbl3".tr,
|
||||
style: theme.textTheme.bodyLarge,
|
||||
),
|
||||
SizedBox(height: 4.v),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildProgressIndicatorSection(BuildContext context) {
|
||||
return Container(
|
||||
width: 343.h,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 4.h,
|
||||
vertical: 3.v,
|
||||
),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.circleBorder8,
|
||||
),
|
||||
child: Container(
|
||||
height: 8.v,
|
||||
width: 259.h,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(
|
||||
4.h,
|
||||
),
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.primary,
|
||||
width: 1.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildNinetyThreeSection(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Text(
|
||||
"msg4".tr,
|
||||
style: CustomTextStyles.titleMediumSegoeUI,
|
||||
),
|
||||
SizedBox(height: 2.v),
|
||||
BlocSelector<FavoriteSportsBloc, FavoriteSportsState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.enterinformationController,
|
||||
builder: (context, enterinformationController) {
|
||||
return CustomTextFormField(
|
||||
controller: enterinformationController,
|
||||
hintText: "msg5".tr,
|
||||
textInputAction: TextInputAction.done,
|
||||
maxLines: 8,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [favorite_sports_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class FavoriteSportsModel extends Equatable {
|
||||
FavoriteSportsModel() {}
|
||||
|
||||
FavoriteSportsModel copyWith() {
|
||||
return FavoriteSportsModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
18
lib/presentation/gender_screen/bloc/gender_bloc.dart
Normal file
18
lib/presentation/gender_screen/bloc/gender_bloc.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/gender_screen/models/gender_model.dart';
|
||||
part 'gender_event.dart';
|
||||
part 'gender_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Gender according to the event that is dispatched to it.
|
||||
class GenderBloc extends Bloc<GenderEvent, GenderState> {
|
||||
GenderBloc(GenderState initialState) : super(initialState) {
|
||||
on<GenderInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
GenderInitialEvent event,
|
||||
Emitter<GenderState> emit,
|
||||
) async {}
|
||||
}
|
||||
16
lib/presentation/gender_screen/bloc/gender_event.dart
Normal file
16
lib/presentation/gender_screen/bloc/gender_event.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'gender_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Gender widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class GenderEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Gender widget is first created.
|
||||
class GenderInitialEvent extends GenderEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
20
lib/presentation/gender_screen/bloc/gender_state.dart
Normal file
20
lib/presentation/gender_screen/bloc/gender_state.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'gender_bloc.dart';
|
||||
|
||||
/// Represents the state of Gender in the application.
|
||||
class GenderState extends Equatable {
|
||||
GenderState({this.genderModelObj});
|
||||
|
||||
GenderModel? genderModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
genderModelObj,
|
||||
];
|
||||
GenderState copyWith({GenderModel? genderModelObj}) {
|
||||
return GenderState(
|
||||
genderModelObj: genderModelObj ?? this.genderModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
84
lib/presentation/gender_screen/gender_screen.dart
Normal file
84
lib/presentation/gender_screen/gender_screen.dart
Normal file
@@ -0,0 +1,84 @@
|
||||
import 'bloc/gender_bloc.dart';
|
||||
import 'models/gender_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GenderScreen extends StatelessWidget {
|
||||
const GenderScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<GenderBloc>(
|
||||
create: (context) =>
|
||||
GenderBloc(GenderState(genderModelObj: GenderModel()))
|
||||
..add(GenderInitialEvent()),
|
||||
child: GenderScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return BlocBuilder<GenderBloc, GenderState>(builder: (context, state) {
|
||||
return SafeArea(
|
||||
child: 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),
|
||||
_buildProgressIndicator(context),
|
||||
SizedBox(height: 36.v),
|
||||
Text("lbl13".tr, style: theme.textTheme.headlineSmall),
|
||||
Spacer(flex: 33),
|
||||
Text(""),
|
||||
SizedBox(height: 20.v),
|
||||
Text(""),
|
||||
Spacer(flex: 66),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
});
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 29.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildProgressIndicator(BuildContext context) {
|
||||
return Container(
|
||||
width: 343.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v),
|
||||
decoration: AppDecoration.outlinePrimary
|
||||
.copyWith(borderRadius: BorderRadiusStyle.circleBorder8),
|
||||
child: Container(
|
||||
height: 8.v,
|
||||
width: 40.h,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(4.h),
|
||||
border:
|
||||
Border.all(color: theme.colorScheme.primary, width: 1.h))));
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
16
lib/presentation/gender_screen/models/gender_model.dart
Normal file
16
lib/presentation/gender_screen/models/gender_model.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [gender_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class GenderModel extends Equatable {
|
||||
GenderModel() {}
|
||||
|
||||
GenderModel copyWith() {
|
||||
return GenderModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/language_select_screen/models/language_select_model.dart';
|
||||
part 'language_select_event.dart';
|
||||
part 'language_select_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a LanguageSelect according to the event that is dispatched to it.
|
||||
class LanguageSelectBloc
|
||||
extends Bloc<LanguageSelectEvent, LanguageSelectState> {
|
||||
LanguageSelectBloc(LanguageSelectState initialState) : super(initialState) {
|
||||
on<LanguageSelectInitialEvent>(_onInitialize);
|
||||
on<ChangeDropDownEvent>(_changeDropDown);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
LanguageSelectInitialEvent event,
|
||||
Emitter<LanguageSelectState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
languageSelectModelObj: state.languageSelectModelObj?.copyWith(
|
||||
dropdownItemList: fillDropdownItemList(),
|
||||
)));
|
||||
}
|
||||
|
||||
_changeDropDown(
|
||||
ChangeDropDownEvent event,
|
||||
Emitter<LanguageSelectState> emit,
|
||||
) {
|
||||
emit(state.copyWith(
|
||||
selectedDropDownValue: event.value,
|
||||
));
|
||||
}
|
||||
|
||||
List<SelectionPopupModel> fillDropdownItemList() {
|
||||
return [
|
||||
SelectionPopupModel(
|
||||
id: 1,
|
||||
title: "Item One",
|
||||
isSelected: true,
|
||||
),
|
||||
SelectionPopupModel(
|
||||
id: 2,
|
||||
title: "Item Two",
|
||||
),
|
||||
SelectionPopupModel(
|
||||
id: 3,
|
||||
title: "Item Three",
|
||||
)
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'language_select_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///LanguageSelect widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class LanguageSelectEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the LanguageSelect widget is first created.
|
||||
class LanguageSelectInitialEvent extends LanguageSelectEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
///event for dropdown selection
|
||||
class ChangeDropDownEvent extends LanguageSelectEvent {
|
||||
ChangeDropDownEvent({required this.value});
|
||||
|
||||
SelectionPopupModel value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'language_select_bloc.dart';
|
||||
|
||||
/// Represents the state of LanguageSelect in the application.
|
||||
class LanguageSelectState extends Equatable {
|
||||
LanguageSelectState({
|
||||
this.selectedDropDownValue,
|
||||
this.languageSelectModelObj,
|
||||
});
|
||||
|
||||
SelectionPopupModel? selectedDropDownValue;
|
||||
|
||||
LanguageSelectModel? languageSelectModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
selectedDropDownValue,
|
||||
languageSelectModelObj,
|
||||
];
|
||||
LanguageSelectState copyWith({
|
||||
SelectionPopupModel? selectedDropDownValue,
|
||||
LanguageSelectModel? languageSelectModelObj,
|
||||
}) {
|
||||
return LanguageSelectState(
|
||||
selectedDropDownValue:
|
||||
selectedDropDownValue ?? this.selectedDropDownValue,
|
||||
languageSelectModelObj:
|
||||
languageSelectModelObj ?? this.languageSelectModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
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/custom_outlined_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LanguageSelectScreen extends StatelessWidget {
|
||||
const LanguageSelectScreen({Key? key})
|
||||
: super(
|
||||
key: key,
|
||||
);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<LanguageSelectBloc>(
|
||||
create: (context) => LanguageSelectBloc(LanguageSelectState(
|
||||
languageSelectModelObj: LanguageSelectModel(),
|
||||
))
|
||||
..add(LanguageSelectInitialEvent()),
|
||||
child: LanguageSelectScreen(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
|
||||
return SafeArea(
|
||||
child: 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),
|
||||
_buildProgressIndicatorSection(context),
|
||||
SizedBox(height: 20.v),
|
||||
Container(
|
||||
width: 262.h,
|
||||
margin: EdgeInsets.only(
|
||||
left: 41.h,
|
||||
right: 39.h,
|
||||
),
|
||||
child: Text(
|
||||
"msg17".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,
|
||||
),
|
||||
),
|
||||
hintText: "lbl_english".tr,
|
||||
items: languageSelectModelObj?.dropdownItemList ?? [],
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<LanguageSelectBloc>()
|
||||
.add(ChangeDropDownEvent(value: value));
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
Spacer(
|
||||
flex: 63,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: _buildContinueButtonSection(context),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildProgressIndicatorSection(BuildContext context) {
|
||||
return Container(
|
||||
width: 343.h,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 4.h,
|
||||
vertical: 3.v,
|
||||
),
|
||||
decoration: AppDecoration.outlinePrimary.copyWith(
|
||||
borderRadius: BorderRadiusStyle.circleBorder8,
|
||||
),
|
||||
child: Container(
|
||||
height: 8.v,
|
||||
width: 20.h,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(
|
||||
4.h,
|
||||
),
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.primary,
|
||||
width: 1.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildContinueButtonSection(BuildContext context) {
|
||||
return CustomOutlinedButton(
|
||||
text: "lbl2".tr.toUpperCase(),
|
||||
margin: EdgeInsets.only(
|
||||
left: 16.h,
|
||||
right: 16.h,
|
||||
bottom: 50.v,
|
||||
),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [language_select_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class LanguageSelectModel extends Equatable {
|
||||
LanguageSelectModel({this.dropdownItemList = const []}) {}
|
||||
|
||||
List<SelectionPopupModel> dropdownItemList;
|
||||
|
||||
LanguageSelectModel copyWith({List<SelectionPopupModel>? dropdownItemList}) {
|
||||
return LanguageSelectModel(
|
||||
dropdownItemList: dropdownItemList ?? this.dropdownItemList,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [dropdownItemList];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/medicine_intake_screen/models/medicine_intake_model.dart';
|
||||
part 'medicine_intake_event.dart';
|
||||
part 'medicine_intake_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a MedicineIntake according to the event that is dispatched to it.
|
||||
class MedicineIntakeBloc
|
||||
extends Bloc<MedicineIntakeEvent, MedicineIntakeState> {
|
||||
MedicineIntakeBloc(MedicineIntakeState initialState) : super(initialState) {
|
||||
on<MedicineIntakeInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
MedicineIntakeInitialEvent event,
|
||||
Emitter<MedicineIntakeState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(enterInformationController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'medicine_intake_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///MedicineIntake widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class MedicineIntakeEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the MedicineIntake widget is first created.
|
||||
class MedicineIntakeInitialEvent extends MedicineIntakeEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'medicine_intake_bloc.dart';
|
||||
|
||||
/// Represents the state of MedicineIntake in the application.
|
||||
class MedicineIntakeState extends Equatable {
|
||||
MedicineIntakeState({
|
||||
this.enterInformationController,
|
||||
this.medicineIntakeModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? enterInformationController;
|
||||
|
||||
MedicineIntakeModel? medicineIntakeModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
enterInformationController,
|
||||
medicineIntakeModelObj,
|
||||
];
|
||||
MedicineIntakeState copyWith({
|
||||
TextEditingController? enterInformationController,
|
||||
MedicineIntakeModel? medicineIntakeModelObj,
|
||||
}) {
|
||||
return MedicineIntakeState(
|
||||
enterInformationController:
|
||||
enterInformationController ?? this.enterInformationController,
|
||||
medicineIntakeModelObj:
|
||||
medicineIntakeModelObj ?? this.medicineIntakeModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
import 'bloc/medicine_intake_bloc.dart';
|
||||
import 'models/medicine_intake_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MedicineIntakeScreen extends StatelessWidget {
|
||||
const MedicineIntakeScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<MedicineIntakeBloc>(
|
||||
create: (context) => MedicineIntakeBloc(
|
||||
MedicineIntakeState(medicineIntakeModelObj: MedicineIntakeModel()))
|
||||
..add(MedicineIntakeInitialEvent()),
|
||||
child: MedicineIntakeScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: 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: 0.47,
|
||||
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),
|
||||
child: Text("msg6".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: CustomTextStyles.headlineSmallMulish)),
|
||||
SizedBox(height: 86.v),
|
||||
_buildNinetyThree(context),
|
||||
Spacer(),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 31.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildNinetyThree(BuildContext context) {
|
||||
return Column(children: [
|
||||
Text("msg4".tr, style: CustomTextStyles.titleMediumSegoeUI),
|
||||
SizedBox(height: 2.v),
|
||||
BlocSelector<MedicineIntakeBloc, MedicineIntakeState,
|
||||
TextEditingController?>(
|
||||
selector: (state) => state.enterInformationController,
|
||||
builder: (context, enterInformationController) {
|
||||
return CustomTextFormField(
|
||||
controller: enterInformationController,
|
||||
hintText: "msg5".tr,
|
||||
textInputAction: TextInputAction.done,
|
||||
maxLines: 8);
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [medicine_intake_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class MedicineIntakeModel extends Equatable {
|
||||
MedicineIntakeModel() {}
|
||||
|
||||
MedicineIntakeModel copyWith() {
|
||||
return MedicineIntakeModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
20
lib/presentation/schedule_screen/bloc/schedule_bloc.dart
Normal file
20
lib/presentation/schedule_screen/bloc/schedule_bloc.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/schedule_screen/models/schedule_model.dart';
|
||||
part 'schedule_event.dart';
|
||||
part 'schedule_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Schedule according to the event that is dispatched to it.
|
||||
class ScheduleBloc extends Bloc<ScheduleEvent, ScheduleState> {
|
||||
ScheduleBloc(ScheduleState initialState) : super(initialState) {
|
||||
on<ScheduleInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
ScheduleInitialEvent event,
|
||||
Emitter<ScheduleState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(inputPlaceholderController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
16
lib/presentation/schedule_screen/bloc/schedule_event.dart
Normal file
16
lib/presentation/schedule_screen/bloc/schedule_event.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'schedule_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Schedule widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class ScheduleEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Schedule widget is first created.
|
||||
class ScheduleInitialEvent extends ScheduleEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
31
lib/presentation/schedule_screen/bloc/schedule_state.dart
Normal file
31
lib/presentation/schedule_screen/bloc/schedule_state.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'schedule_bloc.dart';
|
||||
|
||||
/// Represents the state of Schedule in the application.
|
||||
class ScheduleState extends Equatable {
|
||||
ScheduleState({
|
||||
this.inputPlaceholderController,
|
||||
this.scheduleModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? inputPlaceholderController;
|
||||
|
||||
ScheduleModel? scheduleModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
inputPlaceholderController,
|
||||
scheduleModelObj,
|
||||
];
|
||||
ScheduleState copyWith({
|
||||
TextEditingController? inputPlaceholderController,
|
||||
ScheduleModel? scheduleModelObj,
|
||||
}) {
|
||||
return ScheduleState(
|
||||
inputPlaceholderController:
|
||||
inputPlaceholderController ?? this.inputPlaceholderController,
|
||||
scheduleModelObj: scheduleModelObj ?? this.scheduleModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
16
lib/presentation/schedule_screen/models/schedule_model.dart
Normal file
16
lib/presentation/schedule_screen/models/schedule_model.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [schedule_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class ScheduleModel extends Equatable {
|
||||
ScheduleModel() {}
|
||||
|
||||
ScheduleModel copyWith() {
|
||||
return ScheduleModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
105
lib/presentation/schedule_screen/schedule_screen.dart
Normal file
105
lib/presentation/schedule_screen/schedule_screen.dart
Normal file
@@ -0,0 +1,105 @@
|
||||
import 'bloc/schedule_bloc.dart';
|
||||
import 'models/schedule_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ScheduleScreen extends StatelessWidget {
|
||||
const ScheduleScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<ScheduleBloc>(
|
||||
create: (context) =>
|
||||
ScheduleBloc(ScheduleState(scheduleModelObj: ScheduleModel()))
|
||||
..add(ScheduleInitialEvent()),
|
||||
child: ScheduleScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: 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),
|
||||
_buildProgressIndicator(context),
|
||||
SizedBox(height: 38.v),
|
||||
Text("lbl16".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 67.v),
|
||||
_buildNinetyThree(context),
|
||||
Spacer(),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 31.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildProgressIndicator(BuildContext context) {
|
||||
return Container(
|
||||
width: 343.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v),
|
||||
decoration: AppDecoration.outlinePrimary
|
||||
.copyWith(borderRadius: BorderRadiusStyle.circleBorder8),
|
||||
child: Container(
|
||||
height: 8.v,
|
||||
width: 297.h,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(4.h),
|
||||
border:
|
||||
Border.all(color: theme.colorScheme.primary, width: 1.h))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildNinetyThree(BuildContext context) {
|
||||
return Column(children: [
|
||||
Container(
|
||||
width: 324.h,
|
||||
margin: EdgeInsets.symmetric(horizontal: 9.h),
|
||||
child: Text("msg14".tr,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: CustomTextStyles.titleMediumSegoeUI)),
|
||||
SizedBox(height: 12.v),
|
||||
BlocSelector<ScheduleBloc, ScheduleState, TextEditingController?>(
|
||||
selector: (state) => state.inputPlaceholderController,
|
||||
builder: (context, inputPlaceholderController) {
|
||||
return CustomTextFormField(
|
||||
controller: inputPlaceholderController,
|
||||
hintText: "msg5".tr,
|
||||
textInputAction: TextInputAction.done,
|
||||
maxLines: 8);
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
24
lib/presentation/splash_screen/bloc/splash_bloc.dart
Normal file
24
lib/presentation/splash_screen/bloc/splash_bloc.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/splash_screen/models/splash_model.dart';
|
||||
part 'splash_event.dart';
|
||||
part 'splash_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Splash according to the event that is dispatched to it.
|
||||
class SplashBloc extends Bloc<SplashEvent, SplashState> {
|
||||
SplashBloc(SplashState initialState) : super(initialState) {
|
||||
on<SplashInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
SplashInitialEvent event,
|
||||
Emitter<SplashState> emit,
|
||||
) async {
|
||||
Future.delayed(const Duration(milliseconds: 3000), () {
|
||||
NavigatorService.popAndPushNamed(
|
||||
AppRoutes.languageSelectScreen,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
16
lib/presentation/splash_screen/bloc/splash_event.dart
Normal file
16
lib/presentation/splash_screen/bloc/splash_event.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'splash_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Splash widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class SplashEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Splash widget is first created.
|
||||
class SplashInitialEvent extends SplashEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
20
lib/presentation/splash_screen/bloc/splash_state.dart
Normal file
20
lib/presentation/splash_screen/bloc/splash_state.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'splash_bloc.dart';
|
||||
|
||||
/// Represents the state of Splash in the application.
|
||||
class SplashState extends Equatable {
|
||||
SplashState({this.splashModelObj});
|
||||
|
||||
SplashModel? splashModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
splashModelObj,
|
||||
];
|
||||
SplashState copyWith({SplashModel? splashModelObj}) {
|
||||
return SplashState(
|
||||
splashModelObj: splashModelObj ?? this.splashModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
16
lib/presentation/splash_screen/models/splash_model.dart
Normal file
16
lib/presentation/splash_screen/models/splash_model.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [splash_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class SplashModel extends Equatable {
|
||||
SplashModel() {}
|
||||
|
||||
SplashModel copyWith() {
|
||||
return SplashModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
36
lib/presentation/splash_screen/splash_screen.dart
Normal file
36
lib/presentation/splash_screen/splash_screen.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'bloc/splash_bloc.dart';
|
||||
import 'models/splash_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SplashScreen extends StatelessWidget {
|
||||
const SplashScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<SplashBloc>(
|
||||
create: (context) =>
|
||||
SplashBloc(SplashState(splashModelObj: SplashModel()))
|
||||
..add(SplashInitialEvent()),
|
||||
child: SplashScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return BlocBuilder<SplashBloc, SplashState>(builder: (context, state) {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
body: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 16.v),
|
||||
CustomImageView(
|
||||
imagePath: ImageConstant.img2456927096976,
|
||||
height: 137.adaptSize,
|
||||
width: 137.adaptSize)
|
||||
]))));
|
||||
});
|
||||
}
|
||||
}
|
||||
38
lib/presentation/weight_screen/bloc/weight_bloc.dart
Normal file
38
lib/presentation/weight_screen/bloc/weight_bloc.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/weight_screen/models/weight_model.dart';
|
||||
part 'weight_event.dart';
|
||||
part 'weight_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Weight according to the event that is dispatched to it.
|
||||
class WeightBloc extends Bloc<WeightEvent, WeightState> {
|
||||
WeightBloc(WeightState initialState) : super(initialState) {
|
||||
on<WeightInitialEvent>(_onInitialize);
|
||||
on<ChangeDropDownEvent>(_changeDropDown);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
WeightInitialEvent event,
|
||||
Emitter<WeightState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(
|
||||
weightModelObj: state.weightModelObj
|
||||
?.copyWith(dropdownItemList: fillDropdownItemList())));
|
||||
}
|
||||
|
||||
_changeDropDown(
|
||||
ChangeDropDownEvent event,
|
||||
Emitter<WeightState> emit,
|
||||
) {
|
||||
emit(state.copyWith(selectedDropDownValue: event.value));
|
||||
}
|
||||
|
||||
List<SelectionPopupModel> fillDropdownItemList() {
|
||||
return [
|
||||
SelectionPopupModel(id: 1, title: "Item One", isSelected: true),
|
||||
SelectionPopupModel(id: 2, title: "Item Two"),
|
||||
SelectionPopupModel(id: 3, title: "Item Three")
|
||||
];
|
||||
}
|
||||
}
|
||||
28
lib/presentation/weight_screen/bloc/weight_event.dart
Normal file
28
lib/presentation/weight_screen/bloc/weight_event.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'weight_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Weight widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class WeightEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Weight widget is first created.
|
||||
class WeightInitialEvent extends WeightEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
///event for dropdown selection
|
||||
class ChangeDropDownEvent extends WeightEvent {
|
||||
ChangeDropDownEvent({required this.value});
|
||||
|
||||
SelectionPopupModel value;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
value,
|
||||
];
|
||||
}
|
||||
31
lib/presentation/weight_screen/bloc/weight_state.dart
Normal file
31
lib/presentation/weight_screen/bloc/weight_state.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'weight_bloc.dart';
|
||||
|
||||
/// Represents the state of Weight in the application.
|
||||
class WeightState extends Equatable {
|
||||
WeightState({
|
||||
this.selectedDropDownValue,
|
||||
this.weightModelObj,
|
||||
});
|
||||
|
||||
SelectionPopupModel? selectedDropDownValue;
|
||||
|
||||
WeightModel? weightModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
selectedDropDownValue,
|
||||
weightModelObj,
|
||||
];
|
||||
WeightState copyWith({
|
||||
SelectionPopupModel? selectedDropDownValue,
|
||||
WeightModel? weightModelObj,
|
||||
}) {
|
||||
return WeightState(
|
||||
selectedDropDownValue:
|
||||
selectedDropDownValue ?? this.selectedDropDownValue,
|
||||
weightModelObj: weightModelObj ?? this.weightModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
21
lib/presentation/weight_screen/models/weight_model.dart
Normal file
21
lib/presentation/weight_screen/models/weight_model.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
|
||||
|
||||
/// This class defines the variables used in the [weight_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class WeightModel extends Equatable {
|
||||
WeightModel({this.dropdownItemList = const []}) {}
|
||||
|
||||
List<SelectionPopupModel> dropdownItemList;
|
||||
|
||||
WeightModel copyWith({List<SelectionPopupModel>? dropdownItemList}) {
|
||||
return WeightModel(
|
||||
dropdownItemList: dropdownItemList ?? this.dropdownItemList,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [dropdownItemList];
|
||||
}
|
||||
112
lib/presentation/weight_screen/weight_screen.dart
Normal file
112
lib/presentation/weight_screen/weight_screen.dart
Normal file
@@ -0,0 +1,112 @@
|
||||
import 'bloc/weight_bloc.dart';
|
||||
import 'models/weight_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.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:eatvio_app/widgets/custom_drop_down.dart';
|
||||
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class WeightScreen extends StatelessWidget {
|
||||
const WeightScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<WeightBloc>(
|
||||
create: (context) =>
|
||||
WeightBloc(WeightState(weightModelObj: WeightModel()))
|
||||
..add(WeightInitialEvent()),
|
||||
child: WeightScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: 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)),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.h),
|
||||
child: LinearProgressIndicator(
|
||||
value: 0.35,
|
||||
backgroundColor: theme.colorScheme.onPrimary,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
appTheme.blueA400)))),
|
||||
SizedBox(height: 39.v),
|
||||
_buildTwentySix(context),
|
||||
Spacer(),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 29.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildTwentySixWidget(BuildContext context) {
|
||||
return Column(children: [
|
||||
Text("lbl12".tr, style: theme.textTheme.bodyLarge),
|
||||
SizedBox(height: 4.v),
|
||||
BlocSelector<WeightBloc, WeightState, WeightModel?>(
|
||||
selector: (state) => state.weightModelObj,
|
||||
builder: (context, weightModelObj) {
|
||||
return CustomDropDown(
|
||||
icon: Container(
|
||||
margin: EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v),
|
||||
decoration:
|
||||
BoxDecoration(borderRadius: BorderRadius.circular(1.h)),
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imgFavorite,
|
||||
height: 12.adaptSize,
|
||||
width: 12.adaptSize)),
|
||||
hintText: "lbl_70".tr,
|
||||
items: weightModelObj?.dropdownItemList ?? [],
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<WeightBloc>()
|
||||
.add(ChangeDropDownEvent(value: value));
|
||||
});
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildTwentySix(BuildContext context) {
|
||||
return Column(children: [
|
||||
Text("lbl11".tr, style: theme.textTheme.headlineSmall),
|
||||
SizedBox(height: 174.v),
|
||||
_buildTwentySixWidget(context)
|
||||
]);
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user