diff --git a/lib/style/app_page.dart b/lib/style/app_page.dart index 702e8cd9..90cf8a1d 100644 --- a/lib/style/app_page.dart +++ b/lib/style/app_page.dart @@ -10,7 +10,7 @@ class AppPage extends StatelessWidget { final Widget? leading; final Widget? floatingActionButton; final FloatingActionButtonLocation floatingActionButtonLocation; - final Widget? body; + final Widget body; final bool automaticallyImplyLeading; const AppPage({ @@ -20,7 +20,7 @@ class AppPage extends StatelessWidget { required this.backGroundColor, this.actions, this.leading, - this.body, + required this.body, this.floatingActionButtonLocation = FloatingActionButtonLocation.centerFloat, this.automaticallyImplyLeading = true, @@ -36,6 +36,7 @@ class AppPage extends StatelessWidget { leading == null ? null : AppBar( + foregroundColor: context.colorScheme.textPrimary, scrolledUnderElevation: 0.0, backgroundColor: backGroundColor, title: titleWidget ?? _title(context), diff --git a/lib/ui/shared/dashboard/dashboard.dart b/lib/ui/shared/dashboard/dashboard.dart index 5756d5d3..d9a1da12 100644 --- a/lib/ui/shared/dashboard/dashboard.dart +++ b/lib/ui/shared/dashboard/dashboard.dart @@ -28,6 +28,7 @@ class _DashBoardScreenState extends State { Widget build(BuildContext context) { final locale = AppLocalizations.of(context); return Scaffold( + backgroundColor: context.colorScheme.surface, drawer: const AppDrawer(), body: SafeArea( child: BlocListener( diff --git a/lib/ui/shared/profile/edit_profile/widget/profile_form.dart b/lib/ui/shared/profile/edit_profile/widget/profile_form.dart index 2f74cd02..a8b7323c 100644 --- a/lib/ui/shared/profile/edit_profile/widget/profile_form.dart +++ b/lib/ui/shared/profile/edit_profile/widget/profile_form.dart @@ -141,53 +141,6 @@ class GenderSelection extends StatelessWidget { : context.colorScheme.textPrimary), ), ) - // Expanded( - // child: ElevatedButton( - // style: ElevatedButton.styleFrom( - // elevation: 0, - // shadowColor: context.colorScheme.containerNormal, - // surfaceTintColor: context.colorScheme.containerNormal, - // foregroundColor: state.gender == Gender.male - // ? context.colorScheme.textPrimary - // : context.colorScheme.textSecondary, - // backgroundColor: context.colorScheme.containerNormal, - // shape: RoundedRectangleBorder( - // borderRadius: AppTheme.commonBorderRadius, - // )), - // onPressed: () { - // bloc.add(EditProfileChangeGenderEvent(gender: Gender.male)); - // }, - // child: Text( - // localization.gender_male_tag, - // style: AppTextStyle.style16 - // .copyWith(color: context.colorScheme.textPrimary), - // ), - // )), - // const SizedBox( - // width: primaryHorizontalSpacing, - // ), - // Expanded( - // child: ElevatedButton( - // onPressed: () { - // bloc.add(EditProfileChangeGenderEvent(gender: Gender.female)); - // }, - // style: ElevatedButton.styleFrom( - // elevation: 0, - // shadowColor: context.colorScheme.containerNormal, - // surfaceTintColor: context.colorScheme.containerNormal, - // foregroundColor: state.gender == Gender.female - // ? context.colorScheme.textPrimary - // : context.colorScheme.textSecondary, - // backgroundColor: context.colorScheme.containerNormal, - // shape: RoundedRectangleBorder( - // borderRadius: AppTheme.commonBorderRadius, - // )), - // child: Text( - // localization.gender_female_tag, - // style: AppTextStyle.style16 - // .copyWith(color: context.colorScheme.textPrimary), - // ), - // )), ], ); }); @@ -214,7 +167,7 @@ class DateOfBirthButton extends StatelessWidget { alignment: Alignment.centerLeft, backgroundColor: context.colorScheme.containerNormal, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(24), )), onPressed: () async { DateTime? pickedDate = await pickDate( diff --git a/lib/ui/shared/who_is_out_card/widget/absence_employee_view.dart b/lib/ui/shared/who_is_out_card/widget/absence_employee_view.dart index f0867c7e..a3cd6e41 100644 --- a/lib/ui/shared/who_is_out_card/widget/absence_employee_view.dart +++ b/lib/ui/shared/who_is_out_card/widget/absence_employee_view.dart @@ -122,7 +122,7 @@ class WhoIsOutAbsenceEmptyView extends StatelessWidget { Text( locale.who_is_out_card_no_leave_present_message, style: AppTextStyle.style16 - .copyWith(color: context.colorScheme.textPrimary), + .copyWith(color: context.colorScheme.textSecondary), ), ], ), diff --git a/lib/ui/sign_in/setup_profile/setup_profile_screen.dart b/lib/ui/sign_in/setup_profile/setup_profile_screen.dart index f7c8ef2c..4e7c5d3c 100644 --- a/lib/ui/sign_in/setup_profile/setup_profile_screen.dart +++ b/lib/ui/sign_in/setup_profile/setup_profile_screen.dart @@ -1,4 +1,4 @@ -import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:projectunity/data/configs/space_constant.dart'; @@ -52,64 +52,74 @@ class _SetupProfileScreenState extends State { return AppPage( backGroundColor: context.colorScheme.surface, title: context.l10n.setup_profile_title, + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios_new), + color: context.colorScheme.textPrimary, + onPressed: () { + context.goNamed(Routes.login); + }), body: SafeArea( - child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: primaryHorizontalSpacing), - child: BlocListener( - listener: (BuildContext context, SetupProfileState state) { - if (state.error != null) { - showSnackBar(context: context, error: state.error); - context.goNamed(Routes.login); - } - }, - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - FieldTitle(title: context.l10n.employee_name_tag), - BlocBuilder( - builder: (context, state) { - return FieldEntry( - controller: nameController, - hintText: context.l10n.employee_name_tag, - onChanged: (value) => context - .read() - .add(NameChangedEvent(name: value)), - errorText: state.nameError - ? context.l10n.admin_home_add_member_error_name - : null, - ); - }), - FieldTitle(title: context.l10n.employee_email_tag), - BlocBuilder( - builder: (context, state) { - return FieldEntry( - controller: emailController, - hintText: context.l10n.employee_email_tag, - onChanged: (value) => context - .read() - .add(EmailChangedEvent(email: value)), - errorText: state.emailError - ? context.l10n.admin_home_add_member_error_email - : null, - ); - }), - const Spacer(), - BlocBuilder( - builder: (context, state) { - return AppButton( - backgroundColor: state.buttonEnabled - ? context.colorScheme.primary - : context.colorScheme.primary.withOpacity(0.5), - loading: state.isSubmitting, - tag: context.l10n.submit_button_tag, - onTap: () => context - .read() - .add(SubmitProfileEvent(uid: widget.user.uid)), - ); - }), - const SizedBox(height: 16), - ]), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: primaryHorizontalSpacing), + child: BlocListener( + listener: (BuildContext context, SetupProfileState state) { + if (state.error != null) { + showSnackBar(context: context, error: state.error); + context.goNamed(Routes.login); + } + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + FieldTitle(title: context.l10n.employee_name_tag), + BlocBuilder( + builder: (context, state) { + return FieldEntry( + textInputAction: TextInputAction.next, + controller: nameController, + hintText: context.l10n.employee_name_tag, + onChanged: (value) => context + .read() + .add(NameChangedEvent(name: value)), + errorText: state.nameError + ? context.l10n.admin_home_add_member_error_name + : null, + ); + }), + FieldTitle(title: context.l10n.employee_email_tag), + BlocBuilder( + builder: (context, state) { + return FieldEntry( + textInputAction: TextInputAction.done, + controller: emailController, + hintText: context.l10n.employee_email_tag, + onChanged: (value) => context + .read() + .add(EmailChangedEvent(email: value)), + errorText: state.emailError + ? context.l10n.admin_home_add_member_error_email + : null, + ); + }), + const Spacer(), + BlocBuilder( + builder: (context, state) { + return AppButton( + backgroundColor: state.buttonEnabled + ? context.colorScheme.primary + : context.colorScheme.primary.withOpacity(0.5), + loading: state.isSubmitting, + tag: context.l10n.submit_button_tag, + onTap: () => context + .read() + .add(SubmitProfileEvent(uid: widget.user.uid)), + ); + }), + const SizedBox(height: 16), + ]), + ), ), - ))); + )); } } diff --git a/lib/ui/sign_in/sign_in_screen.dart b/lib/ui/sign_in/sign_in_screen.dart index 6c598d63..a34a1b8b 100644 --- a/lib/ui/sign_in/sign_in_screen.dart +++ b/lib/ui/sign_in/sign_in_screen.dart @@ -43,84 +43,86 @@ class SignInScreenState extends State { Widget build(BuildContext context) { return AppPage( backGroundColor: context.colorScheme.surface, - body: Stack( - children: [ - Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - context.colorScheme.surface, - context.colorScheme.primary.withOpacity(0.5) - ], - stops: const [ - 0.5, - 1 - ])), - ), - BlocListener( - listenWhen: (previous, current) => current.error != null, - listener: (context, state) { - if (state.error != null) { - if (state.firebaseAuthUser != null) { - context.goNamed(Routes.setupProfile, - extra: state.firebaseAuthUser); - } else { - showSnackBar(context: context, error: state.error); + body: SafeArea( + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + context.colorScheme.surface, + context.colorScheme.primary.withOpacity(0.5) + ], + stops: const [ + 0.5, + 1 + ])), + ), + BlocListener( + listenWhen: (previous, current) => current.error != null, + listener: (context, state) { + if (state.error != null) { + if (state.firebaseAuthUser != null) { + context.goNamed(Routes.setupProfile, + extra: state.firebaseAuthUser); + } else { + showSnackBar(context: context, error: state.error); + } } - } - }, - child: SafeArea( - child: SmartScrollView( - padding: const EdgeInsets.all(16).copyWith(bottom: 50), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - ImageConst.loginPageVectorImage, - fit: BoxFit.cover, - ), - const SizedBox( - height: 50, - ), - Text( - context.l10n.sign_in_title_text, - textAlign: TextAlign.center, - style: AppTextStyle.style24.copyWith( - color: context.colorScheme.textPrimary, - overflow: TextOverflow.fade, - fontWeight: FontWeight.w700, + }, + child: SafeArea( + child: SmartScrollView( + padding: const EdgeInsets.all(16).copyWith(bottom: 50), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + ImageConst.loginPageVectorImage, + fit: BoxFit.cover, ), - ), - Padding( - padding: const EdgeInsets.only( - left: 20.0, right: 20, top: 20, bottom: 40), - child: Text( - context.l10n.sign_in_description_text, - style: AppTextStyle.style16.copyWith( - color: context.colorScheme.textSecondary), - overflow: TextOverflow.fade, + const SizedBox( + height: 50, + ), + Text( + context.l10n.sign_in_title_text, textAlign: TextAlign.center, + style: AppTextStyle.style24.copyWith( + color: context.colorScheme.textPrimary, + overflow: TextOverflow.fade, + fontWeight: FontWeight.w700, + ), + ), + Padding( + padding: const EdgeInsets.only( + left: 20.0, right: 20, top: 20, bottom: 40), + child: Text( + context.l10n.sign_in_description_text, + style: AppTextStyle.style16.copyWith( + color: context.colorScheme.textSecondary), + overflow: TextOverflow.fade, + textAlign: TextAlign.center, + ), ), - ), - ], + ], + ), + ), + const GoogleSignInButton(), + const SizedBox( + height: 20, ), - ), - const GoogleSignInButton(), - const SizedBox( - height: 20, - ), - if (!kIsWeb && Platform.isIOS) const AppleSignInButton() - ], + if (!kIsWeb && Platform.isIOS) const AppleSignInButton() + ], + ), ), - ), - )), - ], + )), + ], + ), ), ); } diff --git a/lib/ui/space/create_space/create_workspace_screen.dart b/lib/ui/space/create_space/create_workspace_screen.dart index 1e3b1fb5..d1b1ec83 100644 --- a/lib/ui/space/create_space/create_workspace_screen.dart +++ b/lib/ui/space/create_space/create_workspace_screen.dart @@ -60,8 +60,7 @@ class _CreateWorkSpaceScreenState extends State return AppPage( backGroundColor: context.colorScheme.surface, title: locale.create_new_space_title, - body: Material( - color: context.colorScheme.surface, + body: SafeArea( child: Padding( padding: const EdgeInsets.all(16.0), child: Column( @@ -90,25 +89,21 @@ class _CreateWorkSpaceScreenState extends State ], ), ), - ], - ), - ), - ), - floatingActionButton: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: BlocBuilder( - buildWhen: (previous, current) => - previous.buttonState != current.buttonState || - previous.page != current.page || - previous.createSpaceStatus != current.createSpaceStatus, - builder: (context, state) { - return AppButton( - loading: state.createSpaceStatus == Status.loading, - tag: state.page == 2 - ? locale.create_space_tag - : locale.next_tag, - onTap: state.buttonState == ButtonState.enable - ? () { + BlocBuilder( + buildWhen: (previous, current) => + previous.buttonState != current.buttonState || + previous.page != current.page || + previous.createSpaceStatus != current.createSpaceStatus, + builder: (context, state) { + return AppButton( + backgroundColor: state.buttonState == ButtonState.enable + ? context.colorScheme.primary + : context.colorScheme.primary.withOpacity(0.5), + loading: state.createSpaceStatus == Status.loading, + tag: state.page == 2 + ? locale.create_space_tag + : locale.next_tag, + onTap: () { if (state.page < 2) { _tabController.animateTo(state.page + 1); bloc.add(PageChangeEvent(page: state.page + 1)); @@ -116,10 +111,42 @@ class _CreateWorkSpaceScreenState extends State if (state.page == 2) { bloc.add(CreateSpaceButtonTapEvent()); } - } - : null, - ); - }), + }, + ); + }), + ], + ), + ), )); + // floatingActionButton: Padding( + // padding: const EdgeInsets.symmetric(horizontal: 16.0), + // child: BlocBuilder( + // buildWhen: (previous, current) => + // previous.buttonState != current.buttonState || + // previous.page != current.page || + // previous.createSpaceStatus != current.createSpaceStatus, + // builder: (context, state) { + // return AppButton( + // backgroundColor: state.buttonState == ButtonState.enable + // ? context.colorScheme.primary + // : context.colorScheme.primary.withOpacity(0.5), + // loading: state.createSpaceStatus == Status.loading, + // tag: state.page == 2 + // ? locale.create_space_tag + // : locale.next_tag, + // onTap: state.buttonState == ButtonState.enable + // ? () { + // if (state.page < 2) { + // _tabController.animateTo(state.page + 1); + // bloc.add(PageChangeEvent(page: state.page + 1)); + // } + // if (state.page == 2) { + // bloc.add(CreateSpaceButtonTapEvent()); + // } + // } + // : null, + // ); + // }), + // )); } } diff --git a/lib/ui/space/create_space/widget/tab_1.dart b/lib/ui/space/create_space/widget/tab_1.dart index 52c34139..0f1fd504 100644 --- a/lib/ui/space/create_space/widget/tab_1.dart +++ b/lib/ui/space/create_space/widget/tab_1.dart @@ -31,8 +31,8 @@ class _SpaceBasicDetailsState extends State super.build(context); final bloc = BlocProvider.of(context); final locale = context.l10n; - return Column( - crossAxisAlignment: CrossAxisAlignment.start, + return ListView( + // crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( locale.create_space_enter_space_details_text, diff --git a/lib/ui/space/join_space/widget/spaces.dart b/lib/ui/space/join_space/widget/spaces.dart index c6b741f9..baf449f2 100644 --- a/lib/ui/space/join_space/widget/spaces.dart +++ b/lib/ui/space/join_space/widget/spaces.dart @@ -27,7 +27,11 @@ class Spaces extends StatelessWidget { ); } else { if (state.ownSpaces.isEmpty && state.requestedSpaces.isEmpty) { - return Text(context.l10n.empty_space_list_msg); + return Text( + context.l10n.empty_space_list_msg, + style: AppTextStyle.style14 + .copyWith(color: context.colorScheme.textSecondary), + ); } return Expanded( child: ListView( diff --git a/lib/ui/widget/employee_details_textfield.dart b/lib/ui/widget/employee_details_textfield.dart index ee0f528b..dac5731c 100644 --- a/lib/ui/widget/employee_details_textfield.dart +++ b/lib/ui/widget/employee_details_textfield.dart @@ -31,6 +31,7 @@ class FieldEntry extends StatelessWidget { final TextEditingController? controller; final int? maxLength; final String? labelText; + final TextInputAction? textInputAction; const FieldEntry( {super.key, @@ -42,14 +43,15 @@ class FieldEntry extends StatelessWidget { this.keyboardType, this.maxLength, this.inputFormatters, - this.labelText}); + this.labelText, + this.textInputAction}); @override Widget build(BuildContext context) { return TextField( keyboardType: keyboardType, inputFormatters: inputFormatters, - textInputAction: TextInputAction.next, + textInputAction: textInputAction, onChanged: onChanged, maxLines: maxLine, maxLength: maxLength, @@ -72,6 +74,9 @@ class FieldEntry extends StatelessWidget { borderSide: BorderSide.none), hintText: hintText, ), + onTapOutside: (pointerDownEvent) { + FocusScope.of(context).unfocus(); + }, ); } }