diff --git a/apps/mobile/packages/core/lib/src/routing/staff/navigator.dart b/apps/mobile/packages/core/lib/src/routing/staff/navigator.dart index 1f63eb9a..3ba4a8ea 100644 --- a/apps/mobile/packages/core/lib/src/routing/staff/navigator.dart +++ b/apps/mobile/packages/core/lib/src/routing/staff/navigator.dart @@ -298,6 +298,20 @@ extension StaffNavigator on IModularNavigator { pushNamed(StaffPaths.privacySecurity); } + /// Navigates to the Terms of Service page. + /// + /// Display the full terms of service document in a dedicated page view. + void toTermsOfService() { + pushNamed(StaffPaths.termsOfService); + } + + /// Navigates to the Privacy Policy page. + /// + /// Display the full privacy policy document in a dedicated page view. + void toPrivacyPolicy() { + pushNamed(StaffPaths.privacyPolicy); + } + // ========================================================================== // MESSAGING & COMMUNICATION // ========================================================================== diff --git a/apps/mobile/packages/core/lib/src/routing/staff/route_paths.dart b/apps/mobile/packages/core/lib/src/routing/staff/route_paths.dart index 52014858..e7cc0c09 100644 --- a/apps/mobile/packages/core/lib/src/routing/staff/route_paths.dart +++ b/apps/mobile/packages/core/lib/src/routing/staff/route_paths.dart @@ -215,6 +215,16 @@ class StaffPaths { /// and privacy policy. static const String privacySecurity = '/worker-main/privacy-security/'; + /// Terms of Service page. + /// + /// Display the full terms of service document. + static const String termsOfService = '/worker-main/privacy-security/terms/'; + + /// Privacy Policy page. + /// + /// Display the full privacy policy document. + static const String privacyPolicy = '/worker-main/privacy-security/policy/'; + // ========================================================================== // MESSAGING & COMMUNICATION (Placeholders) // ========================================================================== diff --git a/apps/mobile/packages/design_system/lib/src/ui_theme.dart b/apps/mobile/packages/design_system/lib/src/ui_theme.dart index 919a78a0..6638cebe 100644 --- a/apps/mobile/packages/design_system/lib/src/ui_theme.dart +++ b/apps/mobile/packages/design_system/lib/src/ui_theme.dart @@ -71,7 +71,9 @@ class UiTheme { ), maximumSize: const Size(double.infinity, 54), ).copyWith( - side: WidgetStateProperty.resolveWith((Set states) { + side: WidgetStateProperty.resolveWith(( + Set states, + ) { if (states.contains(WidgetState.disabled)) { return const BorderSide( color: UiColors.borderPrimary, @@ -80,7 +82,9 @@ class UiTheme { } return null; }), - overlayColor: WidgetStateProperty.resolveWith((Set states) { + overlayColor: WidgetStateProperty.resolveWith(( + Set states, + ) { if (states.contains(WidgetState.hovered)) return UiColors.buttonPrimaryHover; return null; @@ -239,7 +243,9 @@ class UiTheme { navigationBarTheme: NavigationBarThemeData( backgroundColor: UiColors.white, indicatorColor: UiColors.primaryInverse.withAlpha(51), // 20% of 255 - labelTextStyle: WidgetStateProperty.resolveWith((Set states) { + labelTextStyle: WidgetStateProperty.resolveWith(( + Set states, + ) { if (states.contains(WidgetState.selected)) { return UiTypography.footnote2m.textPrimary; } @@ -249,13 +255,38 @@ class UiTheme { // Switch Theme switchTheme: SwitchThemeData( - trackColor: WidgetStateProperty.resolveWith((Set states) { + trackColor: WidgetStateProperty.resolveWith(( + Set states, + ) { if (states.contains(WidgetState.selected)) { - return UiColors.switchActive; + return UiColors.primary.withAlpha(60); } return UiColors.switchInactive; }), - thumbColor: const WidgetStatePropertyAll(UiColors.white), + thumbColor: WidgetStateProperty.resolveWith(( + Set states, + ) { + if (states.contains(WidgetState.selected)) { + return UiColors.primary; + } + return UiColors.white; + }), + trackOutlineColor: WidgetStateProperty.resolveWith(( + Set states, + ) { + if (states.contains(WidgetState.selected)) { + return UiColors.primary; + } + return UiColors.transparent; + }), + trackOutlineWidth: WidgetStateProperty.resolveWith(( + Set states, + ) { + if (states.contains(WidgetState.selected)) { + return 1.0; + } + return 0.0; + }), ), // Checkbox Theme diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/legal/privacy_policy.txt b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/legal/privacy_policy.txt new file mode 100644 index 00000000..b632873f --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/legal/privacy_policy.txt @@ -0,0 +1,119 @@ +PRIVACY POLICY + +Effective Date: February 18, 2026 + +1. INTRODUCTION + +Krow Workforce ("we," "us," "our," or "the App") is committed to protecting your privacy. This Privacy Policy explains how we collect, use, disclose, and otherwise process your personal information through our mobile application and related services. + +2. INFORMATION WE COLLECT + +2.1 Information You Provide Directly: +- Account information: name, email address, phone number, password +- Profile information: photo, bio, skills, experience, certifications +- Location data: work location preferences and current location (when enabled) +- Payment information: bank account details, tax identification numbers +- Communication data: messages, support inquiries, feedback + +2.2 Information Collected Automatically: +- Device information: device type, operating system, device identifiers +- Usage data: features accessed, actions taken, time and duration of activities +- Log data: IP address, browser type, pages visited, errors encountered +- Location data: approximate location based on IP address (always) +- Precise location: only when Location Sharing is enabled + +2.3 Information from Third Parties: +- Background check services: verification results +- Banking partners: account verification information +- Payment processors: transaction information + +3. HOW WE USE YOUR INFORMATION + +We use your information to: +- Create and maintain your account +- Process payments and verify employment eligibility +- Improve and optimize our services +- Send you important notifications and updates +- Provide customer support +- Prevent fraud and ensure security +- Comply with legal obligations +- Conduct analytics and research +- Match you with appropriate work opportunities +- Communicate promotional offers (with your consent) + +4. LOCATION DATA & PRIVACY SETTINGS + +4.1 Location Sharing: +You can control location sharing through Privacy Settings: +- Disabled (default): Your approximate location is based on IP address only +- Enabled: Precise location data is collected for better job matching + +4.2 Your Control: +You may enable or disable precise location sharing at any time in the Privacy & Security section of your profile. + +5. DATA RETENTION + +We retain your personal information for as long as: +- Your account is active, plus +- An additional period as required by law or for business purposes + +You may request deletion of your account and associated data by contacting support@krow.com. + +6. DATA SECURITY + +We implement appropriate technical and organizational measures to protect your personal information from unauthorized access, alteration, disclosure, or destruction. However, no method of transmission over the internet is 100% secure. + +7. SHARING OF INFORMATION + +We do not sell your personal information. We may share information with: +- Service providers and contractors: who process data on our behalf +- Employers and clients: limited information needed for job matching +- Legal authorities: when required by law +- Business partners: with your explicit consent +- Other users: your name, skills, and ratings (as needed for job matching) + +8. YOUR PRIVACY RIGHTS + +8.1 Access and Correction: +You have the right to access, review, and request correction of your personal information. + +8.2 Data Portability: +You may request a copy of your personal data in a portable format. + +8.3 Deletion: +You may request deletion of your account and personal information, subject to legal obligations. + +8.4 Opt-Out: +You may opt out of marketing communications and certain data processing activities. + +9. CHILDREN'S PRIVACY + +Our App is not intended for individuals under 18 years of age. We do not knowingly collect personal information from children. If we become aware that we have collected information from a child, we will take steps to delete such information immediately. + +10. THIRD-PARTY LINKS + +Our App may contain links to third-party websites. We are not responsible for the privacy practices of these external sites. We encourage you to review their privacy policies. + +11. INTERNATIONAL DATA TRANSFERS + +Your information may be transferred to, stored in, and processed in countries other than your country of residence. These countries may have data protection laws different from your home country. + +12. CHANGES TO THIS POLICY + +We may update this Privacy Policy from time to time. We will notify you of significant changes via email or through the App. Your continued use of the App constitutes your acceptance of the updated Privacy Policy. + +13. CONTACT US + +If you have questions about this Privacy Policy or your personal information, please contact us at: + +Email: privacy@krow.com +Address: Krow Workforce, [Company Address] +Phone: [Support Phone Number] + +14. CALIFORNIA PRIVACY RIGHTS (CCPA) + +If you are a California resident, you have additional rights under the California Consumer Privacy Act (CCPA). Please visit our CCPA Rights page or contact privacy@krow.com for more information. + +15. EUROPEAN PRIVACY RIGHTS (GDPR) + +If you are in the European Union, you have rights under the General Data Protection Regulation (GDPR). These include the right to access, rectification, erasure, and data portability. Contact privacy@krow.com to exercise these rights. diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/legal/terms_of_service.txt b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/legal/terms_of_service.txt new file mode 100644 index 00000000..818cbe06 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/legal/terms_of_service.txt @@ -0,0 +1,61 @@ +TERMS OF SERVICE + +Effective Date: February 18, 2026 + +1. ACCEPTANCE OF TERMS + +By accessing and using the Krow Workforce application ("the App"), you accept and agree to be bound by the terms and provisions of this agreement. If you do not agree to abide by the above, please do not use this service. + +2. USE LICENSE + +Permission is granted to temporarily download one copy of the materials (information or software) on Krow Workforce's App for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not: + +a) Modifying or copying the materials +b) Using the materials for any commercial purpose or for any public display +c) Attempting to reverse engineer, disassemble, or decompile any software contained on the App +d) Removing any copyright or other proprietary notations from the materials +e) Transferring the materials to another person or "mirroring" the materials on any other server + +3. DISCLAIMER + +The materials on Krow Workforce's App are provided on an "as is" basis. Krow Workforce makes no warranties, expressed or implied, and hereby disclaims and negates all other warranties including, without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights. + +4. LIMITATIONS + +In no event shall Krow Workforce or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use the materials on Krow Workforce's App, even if Krow Workforce or a Krow Workforce authorized representative has been notified orally or in writing of the possibility of such damage. + +5. ACCURACY OF MATERIALS + +The materials appearing on Krow Workforce's App could include technical, typographical, or photographic errors. Krow Workforce does not warrant that any of the materials on its App are accurate, complete, or current. Krow Workforce may make changes to the materials contained on its App at any time without notice. + +6. MATERIALS DISCLAIMER + +Krow Workforce has not reviewed all of the sites linked to its App and is not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by Krow Workforce of the site. Use of any such linked website is at the user's own risk. + +7. MODIFICATIONS + +Krow Workforce may revise these terms of service for its App at any time without notice. By using this App, you are agreeing to be bound by the then current version of these terms of service. + +8. GOVERNING LAW + +These terms and conditions are governed by and construed in accordance with the laws of the jurisdiction in which Krow Workforce is located, and you irrevocably submit to the exclusive jurisdiction of the courts in that location. + +9. LIMITATION OF LIABILITY + +In no case shall Krow Workforce, its staff, or other contributors be liable for any indirect, incidental, consequential, special, or punitive damages arising out of or relating to the use of the App. + +10. USER CONTENT + +You grant Krow Workforce a non-exclusive, royalty-free, perpetual, and irrevocable right to use any content you provide to us, including but not limited to text, images, and information, in any media or format and for any purpose consistent with our business. + +11. INDEMNIFICATION + +You agree to indemnify and hold harmless Krow Workforce and its staff from any and all claims, damages, losses, costs, and expenses, including attorney's fees, arising out of or resulting from your use of the App or violation of these terms. + +12. TERMINATION + +Krow Workforce reserves the right to terminate your account and access to the App at any time, in its sole discretion, for any reason or no reason, with or without notice. + +13. CONTACT INFORMATION + +If you have any questions about these Terms of Service, please contact us at support@krow.com. diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/privacy_policy.json b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/privacy_policy.json deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/terms_of_service.json b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/assets/terms_of_service.json deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/data/repositories_impl/privacy_settings_repository_impl.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/data/repositories_impl/privacy_settings_repository_impl.dart index de24e493..e1de16c3 100644 --- a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/data/repositories_impl/privacy_settings_repository_impl.dart +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/data/repositories_impl/privacy_settings_repository_impl.dart @@ -1,3 +1,4 @@ +import 'package:flutter/services.dart'; import 'package:krow_data_connect/krow_data_connect.dart'; import '../../domain/entities/privacy_settings_entity.dart'; @@ -6,7 +7,8 @@ import '../../domain/repositories/privacy_settings_repository_interface.dart'; /// Data layer implementation of privacy settings repository /// /// Handles all backend communication for privacy settings, -/// using DataConnectService for automatic auth and token refresh +/// using DataConnectService for automatic auth and token refresh, +/// and loads legal documents from app assets class PrivacySettingsRepositoryImpl implements PrivacySettingsRepositoryInterface { final DataConnectService _service; @@ -45,9 +47,14 @@ class PrivacySettingsRepositoryImpl Future getTermsOfService() async { return _service.run( () async { - // TODO: Call Data Connect query to fetch terms of service content - // For now, return placeholder - return 'Terms of Service Content'; + try { + return await rootBundle.loadString( + 'packages/staff_privacy_security/assets/legal/terms_of_service.txt', + ); + } catch (e) { + // Fallback if asset not found + return 'Terms of Service - Content unavailable. Please contact support@krow.com'; + } }, ); } @@ -56,9 +63,14 @@ class PrivacySettingsRepositoryImpl Future getPrivacyPolicy() async { return _service.run( () async { - // TODO: Call Data Connect query to fetch privacy policy content - // For now, return placeholder - return 'Privacy Policy Content'; + try { + return await rootBundle.loadString( + 'packages/staff_privacy_security/assets/legal/privacy_policy.txt', + ); + } catch (e) { + // Fallback if asset not found + return 'Privacy Policy - Content unavailable. Please contact privacy@krow.com'; + } }, ); } diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/blocs/legal/privacy_policy_cubit.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/blocs/legal/privacy_policy_cubit.dart new file mode 100644 index 00000000..3fa688a4 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/blocs/legal/privacy_policy_cubit.dart @@ -0,0 +1,55 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; + +import '../../../domain/usecases/get_privacy_policy_usecase.dart'; + +/// State for Privacy Policy cubit +class PrivacyPolicyState { + final String? content; + final bool isLoading; + final String? error; + + const PrivacyPolicyState({ + this.content, + this.isLoading = false, + this.error, + }); + + PrivacyPolicyState copyWith({ + String? content, + bool? isLoading, + String? error, + }) { + return PrivacyPolicyState( + content: content ?? this.content, + isLoading: isLoading ?? this.isLoading, + error: error ?? this.error, + ); + } +} + +/// Cubit for managing Privacy Policy content +class PrivacyPolicyCubit extends Cubit { + final GetPrivacyPolicyUseCase _getPrivacyPolicyUseCase; + + PrivacyPolicyCubit({ + required GetPrivacyPolicyUseCase getPrivacyPolicyUseCase, + }) : _getPrivacyPolicyUseCase = getPrivacyPolicyUseCase, + super(const PrivacyPolicyState()); + + /// Fetch privacy policy content + Future fetchPrivacyPolicy() async { + emit(state.copyWith(isLoading: true, error: null)); + try { + final String content = await _getPrivacyPolicyUseCase(); + emit(state.copyWith( + content: content, + isLoading: false, + )); + } catch (e) { + emit(state.copyWith( + isLoading: false, + error: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/blocs/legal/terms_cubit.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/blocs/legal/terms_cubit.dart new file mode 100644 index 00000000..f85b3d3e --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/blocs/legal/terms_cubit.dart @@ -0,0 +1,55 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; + +import '../../../domain/usecases/get_terms_usecase.dart'; + +/// State for Terms of Service cubit +class TermsState { + final String? content; + final bool isLoading; + final String? error; + + const TermsState({ + this.content, + this.isLoading = false, + this.error, + }); + + TermsState copyWith({ + String? content, + bool? isLoading, + String? error, + }) { + return TermsState( + content: content ?? this.content, + isLoading: isLoading ?? this.isLoading, + error: error ?? this.error, + ); + } +} + +/// Cubit for managing Terms of Service content +class TermsCubit extends Cubit { + final GetTermsUseCase _getTermsUseCase; + + TermsCubit({ + required GetTermsUseCase getTermsUseCase, + }) : _getTermsUseCase = getTermsUseCase, + super(const TermsState()); + + /// Fetch terms of service content + Future fetchTerms() async { + emit(state.copyWith(isLoading: true, error: null)); + try { + final String content = await _getTermsUseCase(); + emit(state.copyWith( + content: content, + isLoading: false, + )); + } catch (e) { + emit(state.copyWith( + isLoading: false, + error: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/pages/legal/privacy_policy_page.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/pages/legal/privacy_policy_page.dart new file mode 100644 index 00000000..9ed11bd7 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/pages/legal/privacy_policy_page.dart @@ -0,0 +1,66 @@ +import 'package:core_localization/core_localization.dart'; +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/legal/privacy_policy_cubit.dart'; + +/// Page displaying the Privacy Policy document +class PrivacyPolicyPage extends StatelessWidget { + const PrivacyPolicyPage({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: UiAppBar( + title: t.staff_privacy_security.privacy_policy.title, + showBackButton: true, + bottom: PreferredSize( + preferredSize: const Size.fromHeight(1), + child: Container(color: UiColors.border, height: 1), + ), + ), + body: BlocProvider( + create: (BuildContext context) => Modular.get()..fetchPrivacyPolicy(), + child: BlocBuilder( + builder: (BuildContext context, PrivacyPolicyState state) { + if (state.isLoading) { + return const Center( + child: CircularProgressIndicator(), + ); + } + + if (state.error != null) { + return Center( + child: Padding( + padding: const EdgeInsets.all(UiConstants.space5), + child: Text( + 'Error loading Privacy Policy: ${state.error}', + textAlign: TextAlign.center, + style: UiTypography.body2r.copyWith( + color: UiColors.textSecondary, + ), + ), + ), + ); + } + + return SingleChildScrollView( + padding: const EdgeInsets.all(UiConstants.space5), + child: Text( + state.content ?? 'No content available', + style: UiTypography.body2r.copyWith( + height: 1.6, + color: UiColors.textPrimary, + ), + ), + ); + }, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/pages/legal/terms_of_service_page.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/pages/legal/terms_of_service_page.dart new file mode 100644 index 00000000..2f72c2f3 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/pages/legal/terms_of_service_page.dart @@ -0,0 +1,66 @@ +import 'package:core_localization/core_localization.dart'; +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/legal/terms_cubit.dart'; + +/// Page displaying the Terms of Service document +class TermsOfServicePage extends StatelessWidget { + const TermsOfServicePage({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: UiAppBar( + title: t.staff_privacy_security.terms_of_service.title, + showBackButton: true, + bottom: PreferredSize( + preferredSize: const Size.fromHeight(1), + child: Container(color: UiColors.border, height: 1), + ), + ), + body: BlocProvider( + create: (BuildContext context) => Modular.get()..fetchTerms(), + child: BlocBuilder( + builder: (BuildContext context, TermsState state) { + if (state.isLoading) { + return const Center( + child: CircularProgressIndicator(), + ); + } + + if (state.error != null) { + return Center( + child: Padding( + padding: const EdgeInsets.all(UiConstants.space5), + child: Text( + 'Error loading Terms of Service: ${state.error}', + textAlign: TextAlign.center, + style: UiTypography.body2r.copyWith( + color: UiColors.textSecondary, + ), + ), + ), + ); + } + + return SingleChildScrollView( + padding: const EdgeInsets.all(UiConstants.space5), + child: Text( + state.content ?? 'No content available', + style: UiTypography.body2r.copyWith( + height: 1.6, + color: UiColors.textPrimary, + ), + ), + ); + }, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/legal/legal_section_widget.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/legal/legal_section_widget.dart index 4c326f82..e1dfc013 100644 --- a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/legal/legal_section_widget.dart +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/legal/legal_section_widget.dart @@ -3,6 +3,7 @@ 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 'package:krow_core/core.dart'; import '../../blocs/privacy_security_bloc.dart'; import '../settings_action_tile_widget.dart'; @@ -24,25 +25,23 @@ class LegalSectionWidget extends StatelessWidget { title: t.staff_privacy_security.legal_section, icon: Icons.shield, ), - + Container( decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(8.0), - border: Border.all( - color: UiColors.border, - ), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: UiColors.border), ), child: Column( children: [ SettingsActionTile( title: t.staff_privacy_security.terms_of_service.title, - onTap: () => _showTermsDialog(context), + onTap: () => _navigateToTerms(context), ), const SettingsDivider(), SettingsActionTile( title: t.staff_privacy_security.privacy_policy.title, - onTap: () => _showPrivacyPolicyDialog(context), + onTap: () => _navigateToPrivacyPolicy(context), ), ], ), @@ -51,75 +50,21 @@ class LegalSectionWidget extends StatelessWidget { ); } - /// Show terms of service in a modal dialog - void _showTermsDialog(BuildContext context) { - BlocProvider.of(context) - .add(const FetchTermsEvent()); + /// Navigate to terms of service page + void _navigateToTerms(BuildContext context) { + BlocProvider.of(context).add(const FetchTermsEvent()); - showDialog( - context: context, - builder: (BuildContext dialogContext) => - BlocBuilder( - builder: (BuildContext context, PrivacySecurityState state) { - return AlertDialog( - title: Text( - t.staff_privacy_security.terms_of_service.title, - style: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.w600, - ), - ), - content: SingleChildScrollView( - child: Text( - state.termsContent ?? 'Loading...', - style: const TextStyle(fontSize: 14), - ), - ), - actions: [ - TextButton( - onPressed: () => Modular.to.pop(), - child: Text(t.common.ok), - ), - ], - ); - }, - ), - ); + // Navigate using typed navigator + Modular.to.toTermsOfService(); } - /// Show privacy policy in a modal dialog - void _showPrivacyPolicyDialog(BuildContext context) { - BlocProvider.of(context) - .add(const FetchPrivacyPolicyEvent()); + /// Navigate to privacy policy page + void _navigateToPrivacyPolicy(BuildContext context) { + BlocProvider.of( + context, + ).add(const FetchPrivacyPolicyEvent()); - showDialog( - context: context, - builder: (BuildContext dialogContext) => - BlocBuilder( - builder: (BuildContext context, PrivacySecurityState state) { - return AlertDialog( - title: Text( - t.staff_privacy_security.privacy_policy.title, - style: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.w600, - ), - ), - content: SingleChildScrollView( - child: Text( - state.privacyPolicyContent ?? 'Loading...', - style: const TextStyle(fontSize: 14), - ), - ), - actions: [ - TextButton( - onPressed: () => Modular.to.pop(), - child: Text(t.common.ok), - ), - ], - ); - }, - ), - ); + // Navigate using typed navigator + Modular.to.toPrivacyPolicy(); } } diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/privacy/privacy_section_widget.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/privacy/privacy_section_widget.dart index cc8f06e4..8209ead0 100644 --- a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/privacy/privacy_section_widget.dart +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/privacy/privacy_section_widget.dart @@ -20,13 +20,13 @@ class PrivacySectionWidget extends StatelessWidget { // Privacy Section Header SettingsSectionHeader( title: t.staff_privacy_security.privacy_section, - icon: Icons.visibility, + icon: UiIcons.eye, ), const SizedBox(height: 12.0), Container( decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(8.0), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), border: Border.all( color: UiColors.border, ), diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/settings_action_tile_widget.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/settings_action_tile_widget.dart index aee4dddc..2e258f64 100644 --- a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/settings_action_tile_widget.dart +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/settings_action_tile_widget.dart @@ -24,7 +24,7 @@ class SettingsActionTile extends StatelessWidget { return InkWell( onTap: onTap, child: Padding( - padding: EdgeInsets.all(UiConstants.space4), + padding: const EdgeInsets.all(UiConstants.space4), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -50,10 +50,10 @@ class SettingsActionTile extends StatelessWidget { ], ), ), - Icon( - Icons.chevron_right, - size: 20, - color: UiColors.muted, + const Icon( + UiIcons.chevronRight, + size: 16, + color: UiColors.iconSecondary, ), ], ), diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/settings_switch_tile_widget.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/settings_switch_tile_widget.dart index 7a03d070..7e4df2a4 100644 --- a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/settings_switch_tile_widget.dart +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/presentation/widgets/settings_switch_tile_widget.dart @@ -26,7 +26,7 @@ class SettingsSwitchTile extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: EdgeInsets.all(UiConstants.space4), + padding: const EdgeInsets.all(UiConstants.space4), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -34,27 +34,12 @@ class SettingsSwitchTile extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - title, - style: UiTypography.body2r.copyWith( - fontWeight: FontWeight.w500, - ), - ), - SizedBox(height: UiConstants.space1), - Text( - subtitle, - style: UiTypography.footnote1r.copyWith( - color: UiColors.muted, - ), - ), + Text(title, style: UiTypography.body2r), + Text(subtitle, style: UiTypography.footnote1r.textSecondary), ], ), ), - Switch( - value: value, - onChanged: onChanged, - activeColor: UiColors.primary, - ), + Switch(value: value, onChanged: onChanged), ], ), ); diff --git a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/staff_privacy_security_module.dart b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/staff_privacy_security_module.dart index eac36681..7b701b2b 100644 --- a/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/staff_privacy_security_module.dart +++ b/apps/mobile/packages/features/staff/profile_sections/settings/privacy_security/lib/src/staff_privacy_security_module.dart @@ -9,7 +9,11 @@ import 'domain/usecases/get_privacy_policy_usecase.dart'; import 'domain/usecases/get_privacy_settings_usecase.dart'; import 'domain/usecases/get_terms_usecase.dart'; import 'domain/usecases/update_location_sharing_usecase.dart'; +import 'presentation/blocs/legal/privacy_policy_cubit.dart'; +import 'presentation/blocs/legal/terms_cubit.dart'; import 'presentation/blocs/privacy_security_bloc.dart'; +import 'presentation/pages/legal/privacy_policy_page.dart'; +import 'presentation/pages/legal/terms_of_service_page.dart'; import 'presentation/pages/privacy_security_page.dart'; /// Module for privacy security feature @@ -58,11 +62,24 @@ class PrivacySecurityModule extends Module { getPrivacyPolicyUseCase: i(), ), ); + + // Legal Cubits + i.addSingleton( + () => TermsCubit( + getTermsUseCase: i(), + ), + ); + + i.addSingleton( + () => PrivacyPolicyCubit( + getPrivacyPolicyUseCase: i(), + ), + ); } @override void routes(RouteManager r) { - // Route is handled by core routing (StaffPaths.privacySecurity) + // Main privacy security page r.child( StaffPaths.childRoute( StaffPaths.privacySecurity, @@ -70,5 +87,23 @@ class PrivacySecurityModule extends Module { ), child: (BuildContext context) => const PrivacySecurityPage(), ); + + // Terms of Service page + r.child( + StaffPaths.childRoute( + StaffPaths.privacySecurity, + StaffPaths.termsOfService, + ), + child: (BuildContext context) => const TermsOfServicePage(), + ); + + // Privacy Policy page + r.child( + StaffPaths.childRoute( + StaffPaths.privacySecurity, + StaffPaths.privacyPolicy, + ), + child: (BuildContext context) => const PrivacyPolicyPage(), + ); } }