From 5a0cfe019fec36e587d4556cb1578ea481e9aeae Mon Sep 17 00:00:00 2001 From: cp-sneha-s Date: Tue, 9 Apr 2024 10:31:06 +0530 Subject: [PATCH] Fix lint error --- lib/style/app_page.dart | 2 +- .../setup_profile/setup_profile_screen.dart | 128 +++++++++--------- .../create_space/create_workspace_screen.dart | 109 ++++++++------- lib/ui/space/create_space/widget/tab_1.dart | 2 +- lib/ui/space/join_space/widget/spaces.dart | 6 +- lib/ui/widget/employee_details_textfield.dart | 3 +- 6 files changed, 128 insertions(+), 122 deletions(-) diff --git a/lib/style/app_page.dart b/lib/style/app_page.dart index 725321c5..90cf8a1d 100644 --- a/lib/style/app_page.dart +++ b/lib/style/app_page.dart @@ -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), 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 53b870f2..4e7c5d3c 100644 --- a/lib/ui/sign_in/setup_profile/setup_profile_screen.dart +++ b/lib/ui/sign_in/setup_profile/setup_profile_screen.dart @@ -52,70 +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); + 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( - 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), - ]), - ), - ), + 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( + 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/space/create_space/create_workspace_screen.dart b/lib/ui/space/create_space/create_workspace_screen.dart index 08154bb8..d1b1ec83 100644 --- a/lib/ui/space/create_space/create_workspace_screen.dart +++ b/lib/ui/space/create_space/create_workspace_screen.dart @@ -90,64 +90,63 @@ class _CreateWorkSpaceScreenState extends State ), ), 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)); - } - 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( - // 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( + // 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 162feb00..0f1fd504 100644 --- a/lib/ui/space/create_space/widget/tab_1.dart +++ b/lib/ui/space/create_space/widget/tab_1.dart @@ -32,7 +32,7 @@ class _SpaceBasicDetailsState extends State final bloc = BlocProvider.of(context); final locale = context.l10n; return ListView( - // crossAxisAlignment: CrossAxisAlignment.start, + // 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 57e4e163..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,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( diff --git a/lib/ui/widget/employee_details_textfield.dart b/lib/ui/widget/employee_details_textfield.dart index 10eb9e00..dac5731c 100644 --- a/lib/ui/widget/employee_details_textfield.dart +++ b/lib/ui/widget/employee_details_textfield.dart @@ -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(); }, );