Skip to content

Commit

Permalink
Fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneha-s committed Apr 9, 2024
1 parent 03353bc commit 5a0cfe0
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 122 deletions.
2 changes: 1 addition & 1 deletion lib/style/app_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AppPage extends StatelessWidget {
leading == null
? null
: AppBar(
foregroundColor: context.colorScheme.textPrimary,
foregroundColor: context.colorScheme.textPrimary,
scrolledUnderElevation: 0.0,
backgroundColor: backGroundColor,
title: titleWidget ?? _title(context),
Expand Down
128 changes: 66 additions & 62 deletions lib/ui/sign_in/setup_profile/setup_profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,70 +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);
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios_new),
color: context.colorScheme.textPrimary,
onPressed: () {
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),
]),
),
),
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(
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),
]),
),
),
));
}
}
109 changes: 54 additions & 55 deletions lib/ui/space/create_space/create_workspace_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,64 +90,63 @@ class _CreateWorkSpaceScreenState extends State<CreateWorkSpaceScreen>
),
),
BlocBuilder<CreateSpaceBLoc, CreateSpaceState>(
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));
}
if (state.page == 2) {
bloc.add(CreateSpaceButtonTapEvent());
}
}
,
);
}),
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));
}
if (state.page == 2) {
bloc.add(CreateSpaceButtonTapEvent());
}
},
);
}),
],
),
),
));
// floatingActionButton: Padding(
// padding: const EdgeInsets.symmetric(horizontal: 16.0),
// child: BlocBuilder<CreateSpaceBLoc, CreateSpaceState>(
// 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,
// );
// }),
// ));
// floatingActionButton: Padding(
// padding: const EdgeInsets.symmetric(horizontal: 16.0),
// child: BlocBuilder<CreateSpaceBLoc, CreateSpaceState>(
// 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,
// );
// }),
// ));
}
}
2 changes: 1 addition & 1 deletion lib/ui/space/create_space/widget/tab_1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class _SpaceBasicDetailsState extends State<SpaceBasicDetails>
final bloc = BlocProvider.of<CreateSpaceBLoc>(context);
final locale = context.l10n;
return ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
locale.create_space_enter_space_details_text,
Expand Down
6 changes: 5 additions & 1 deletion lib/ui/space/join_space/widget/spaces.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ class Spaces extends StatelessWidget {
);
} else {
if (state.ownSpaces.isEmpty && state.requestedSpaces.isEmpty) {
return Text(context.l10n.empty_space_list_msg,style: AppTextStyle.style14.copyWith(color: context.colorScheme.textSecondary),);
return Text(
context.l10n.empty_space_list_msg,
style: AppTextStyle.style14
.copyWith(color: context.colorScheme.textSecondary),
);
}
return Expanded(
child: ListView(
Expand Down
3 changes: 1 addition & 2 deletions lib/ui/widget/employee_details_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ class FieldEntry extends StatelessWidget {
borderRadius: BorderRadius.circular(24),
borderSide: BorderSide.none),
hintText: hintText,

),
onTapOutside: (pointerDownEvent){
onTapOutside: (pointerDownEvent) {
FocusScope.of(context).unfocus();
},
);
Expand Down

0 comments on commit 5a0cfe0

Please sign in to comment.