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( create: (context) => GenderBloc(GenderState(genderModelObj: GenderModel())) ..add(GenderInitialEvent()), child: GenderScreen()); } @override Widget build(BuildContext context) { mediaQueryData = MediaQuery.of(context); return BlocBuilder(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("your_gender".tr, style: theme.textTheme.headlineSmall), Spacer(flex: 33), Text(""), SizedBox(height: 20.v), Text(""), Spacer(flex: 66), CustomOutlinedButton( text: "continue".tr.toUpperCase(), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, onPressed: () { navigateToDate(context); }), SizedBox(height: 17.v), Text("skip".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(); } /// Navigates to the dateOfBirthScreen when the action is triggered. navigateToDate(BuildContext context) { NavigatorService.pushNamed( AppRoutes.dateOfBirthScreen, ); } }