From 857b541ec5cd551fe8ef79129ef9585917065131 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 23 Jan 2026 17:28:56 -0500 Subject: [PATCH] feat(settings): refactor SettingsRepositoryImpl and update client settings page UI --- .../repositories_impl/settings_repository_impl.dart | 12 ++++++------ .../src/presentation/pages/client_settings_page.dart | 11 ++++------- .../client_settings_page/settings_actions.dart | 6 ++---- .../client_settings_page/settings_quick_links.dart | 1 + 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/apps/mobile/packages/features/client/settings/lib/src/data/repositories_impl/settings_repository_impl.dart b/apps/mobile/packages/features/client/settings/lib/src/data/repositories_impl/settings_repository_impl.dart index 3b0e7b00..948af68c 100644 --- a/apps/mobile/packages/features/client/settings/lib/src/data/repositories_impl/settings_repository_impl.dart +++ b/apps/mobile/packages/features/client/settings/lib/src/data/repositories_impl/settings_repository_impl.dart @@ -1,21 +1,21 @@ import 'package:firebase_auth/firebase_auth.dart'; + import '../../domain/repositories/settings_repository_interface.dart'; /// Implementation of [SettingsRepositoryInterface]. /// /// This implementation delegates authentication operations to [FirebaseAuth]. class SettingsRepositoryImpl implements SettingsRepositoryInterface { - /// The Firebase Auth instance. - final FirebaseAuth _firebaseAuth; +/// Creates a [SettingsRepositoryImpl] with the required [_firebaseAuth]. + const SettingsRepositoryImpl({required this.firebaseAuth}); - /// Creates a [SettingsRepositoryImpl] with the required [_firebaseAuth]. - SettingsRepositoryImpl({required FirebaseAuth firebaseAuth}) - : _firebaseAuth = firebaseAuth; + /// The Firebase Auth instance. + final FirebaseAuth firebaseAuth; @override Future signOut() async { try { - await _firebaseAuth.signOut(); + await firebaseAuth.signOut(); } catch (e) { throw Exception('Error signing out: ${e.toString()}'); } diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/pages/client_settings_page.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/pages/client_settings_page.dart index 2d39eddc..f480c8d7 100644 --- a/apps/mobile/packages/features/client/settings/lib/src/presentation/pages/client_settings_page.dart +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/pages/client_settings_page.dart @@ -1,11 +1,10 @@ -import 'package:design_system/design_system.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_modular/flutter_modular.dart'; + import '../blocs/client_settings_bloc.dart'; import '../widgets/client_settings_page/settings_actions.dart'; import '../widgets/client_settings_page/settings_profile_header.dart'; -import '../widgets/client_settings_page/settings_quick_links.dart'; /// Page for client settings and profile management. /// @@ -20,9 +19,9 @@ class ClientSettingsPage extends StatelessWidget { /// Builds the client settings page UI. Widget build(BuildContext context) { return BlocProvider( - create: (context) => Modular.get(), + create: (BuildContext context) => Modular.get(), child: BlocListener( - listener: (context, state) { + listener: (BuildContext context, ClientSettingsState state) { if (state is ClientSettingsSignOutSuccess) { ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('Signed out successfully')), @@ -36,12 +35,10 @@ class ClientSettingsPage extends StatelessWidget { } }, child: const Scaffold( - backgroundColor: UiColors.background, body: CustomScrollView( - slivers: [ + slivers: [ SettingsProfileHeader(), SettingsActions(), - SettingsQuickLinks(), ], ), ), diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_actions.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_actions.dart index 8a3f697c..99c77655 100644 --- a/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_actions.dart +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_actions.dart @@ -24,10 +24,8 @@ class SettingsActions extends StatelessWidget { delegate: SliverChildListDelegate([ const SizedBox(height: UiConstants.space5), - // Edit profile button - UiButton.primary(text: labels.edit_profile, onPressed: () {}), - - const SizedBox(height: UiConstants.space4), + /// TODO: FEATURE_NOT_YET_IMPLEMENTED + // Edit profile is not yet implemented // Hubs button UiButton.primary( diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_quick_links.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_quick_links.dart index 01f41765..036380e0 100644 --- a/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_quick_links.dart +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_quick_links.dart @@ -39,6 +39,7 @@ class SettingsQuickLinks extends StatelessWidget { title: labels.clock_in_hubs, onTap: () => Modular.to.pushHubs(), ), + _QuickLinkItem( icon: UiIcons.building, title: labels.billing_payments,