Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UI issues #97

Merged
merged 4 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/style/app_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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,
Expand All @@ -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),
Expand Down
1 change: 1 addition & 0 deletions lib/ui/shared/dashboard/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class _DashBoardScreenState extends State<DashBoardScreen> {
Widget build(BuildContext context) {
final locale = AppLocalizations.of(context);
return Scaffold(
backgroundColor: context.colorScheme.surface,
drawer: const AppDrawer(),
body: SafeArea(
child: BlocListener<UserStateControllerBloc, UserControllerStatus>(
Expand Down
49 changes: 1 addition & 48 deletions lib/ui/shared/profile/edit_profile/widget/profile_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
// ),
// )),
],
);
});
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
],
),
Expand Down
126 changes: 68 additions & 58 deletions lib/ui/sign_in/setup_profile/setup_profile_screen.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -52,64 +52,74 @@ class _SetupProfileScreenState extends State<SetupProfileScreen> {
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<SetupProfileBloc, SetupProfileState>(
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<SetupProfileBloc, SetupProfileState>(
builder: (context, state) {
return FieldEntry(
controller: nameController,
hintText: context.l10n.employee_name_tag,
onChanged: (value) => context
.read<SetupProfileBloc>()
.add(NameChangedEvent(name: value)),
errorText: state.nameError
? context.l10n.admin_home_add_member_error_name
: null,
);
}),
FieldTitle(title: context.l10n.employee_email_tag),
BlocBuilder<SetupProfileBloc, SetupProfileState>(
builder: (context, state) {
return FieldEntry(
controller: emailController,
hintText: context.l10n.employee_email_tag,
onChanged: (value) => context
.read<SetupProfileBloc>()
.add(EmailChangedEvent(email: value)),
errorText: state.emailError
? context.l10n.admin_home_add_member_error_email
: null,
);
}),
const Spacer(),
BlocBuilder<SetupProfileBloc, SetupProfileState>(
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<SetupProfileBloc>()
.add(SubmitProfileEvent(uid: widget.user.uid)),
);
}),
const SizedBox(height: 16),
]),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: primaryHorizontalSpacing),
child: BlocListener<SetupProfileBloc, SetupProfileState>(
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<SetupProfileBloc, SetupProfileState>(
builder: (context, state) {
return FieldEntry(
textInputAction: TextInputAction.next,
controller: nameController,
hintText: context.l10n.employee_name_tag,
onChanged: (value) => context
.read<SetupProfileBloc>()
.add(NameChangedEvent(name: value)),
errorText: state.nameError
? context.l10n.admin_home_add_member_error_name
: null,
);
}),
FieldTitle(title: context.l10n.employee_email_tag),
BlocBuilder<SetupProfileBloc, SetupProfileState>(
builder: (context, state) {
return FieldEntry(
textInputAction: TextInputAction.done,
controller: emailController,
hintText: context.l10n.employee_email_tag,
onChanged: (value) => context
.read<SetupProfileBloc>()
.add(EmailChangedEvent(email: value)),
errorText: state.emailError
? context.l10n.admin_home_add_member_error_email
: null,
);
}),
const Spacer(),
BlocBuilder<SetupProfileBloc, SetupProfileState>(
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<SetupProfileBloc>()
.add(SubmitProfileEvent(uid: widget.user.uid)),
);
}),
const SizedBox(height: 16),
]),
),
),
)));
));
}
}
Loading
Loading