Skip to content

Add external links and privacy & terms agreement#192

Merged
kumarpalsinh25 merged 5 commits intomainfrom
kumar/add-privacy-and-terms-urls
Dec 18, 2025
Merged

Add external links and privacy & terms agreement#192
kumarpalsinh25 merged 5 commits intomainfrom
kumar/add-privacy-and-terms-urls

Conversation

@kumarpalsinh25
Copy link
Copy Markdown
Collaborator

@kumarpalsinh25 kumarpalsinh25 commented Dec 18, 2025

This commit introduces several new features and improvements:

  • Sign-up Screen: Adds a mandatory checkbox for users to agree to the Privacy Policy and Terms & Conditions before signing up. The screen now includes tappable links to these documents.
  • Settings Screen: Implements new options for users to:
    • Rate the app on the respective app store.
    • View the Privacy Policy.
    • View the Terms & Conditions.
    • Contact support via email.
  • Utilities: Centralizes the handling of external URLs (store, legal documents, email) into CommonUtils for reusability.
  • Constants: Adds a new app_constants.dart file to manage store URLs, legal document URLs, and the contact email address.
  • Localization: Adds new strings for the terms and privacy policy agreement text in the sign-up and settings screens.
  • Android Manifest: Includes an intent query for mailto to ensure email functionality works correctly on Android.

Summary by CodeRabbit

  • New Features

    • Sign-up now requires acceptance of Privacy Policy & Terms.
    • In-app sharing, store rating, privacy, terms, and contact actions available from Settings.
    • Contact support opens email; store links open appropriate app store.
  • Localization

    • Added English strings for agreement text, privacy, terms, and share message.
  • Chores

    • Internal module reorganizations (no user-facing behavior changes).

✏️ Tip: You can customize this high-level summary in your review settings.

This commit introduces several new features and improvements:

- **Sign-up Screen**: Adds a mandatory checkbox for users to agree to the Privacy Policy and Terms & Conditions before signing up. The screen now includes tappable links to these documents.
- **Settings Screen**: Implements new options for users to:
    - Rate the app on the respective app store.
    - View the Privacy Policy.
    - View the Terms & Conditions.
    - Contact support via email.
- **Utilities**: Centralizes the handling of external URLs (store, legal documents, email) into `CommonUtils` for reusability.
- **Constants**: Adds a new `app_constants.dart` file to manage store URLs, legal document URLs, and the contact email address.
- **Localization**: Adds new strings for the terms and privacy policy agreement text in the sign-up and settings screens.
- **Android Manifest**: Includes an intent query for `mailto` to ensure email functionality works correctly on Android.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 18, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds app constants and external-link utilities, wires sharing/contact/store/privacy flows into settings and signup (with agreement checkbox), updates AndroidManifest for mailto queries, adds localization keys, and standardizes several import paths.

Changes

Cohort / File(s) Summary
App constants & URL utilities
android/app/src/main/AndroidManifest.xml, lib/core/constants/app_constants.dart, lib/common/utils/common_utils.dart
Introduced AppConstants (store URLs, contact email, policy URLs); extended CommonUtils with shareApp, openStoreUrl, openPrivacyPolicyUrl, openTermsAndConditionsUrl, openContactEmail; added isCheckProtocols param to openUrl; added mailto query intent in AndroidManifest.
Signup & Settings UI wiring
lib/features/auth/screens/signup_screen.dart, lib/features/settings/screens/settings_screen.dart
Added privacy/terms acceptance checkbox and tappable links in signup; connected settings actions to CommonUtils methods; changed one iconColor in settings.
Localization
lib/l10n/app_en.arb
Added localization keys for privacy/terms UI, agreement prompt, and share message.
Import path updates (providers & tests)
lib/features/.../providers/* (bullets, events, list, polls, sheet, task, text, users), test/features/text/actions/text_actions_test.dart, test/features/text/providers/text_providers_test.dart, test/features/text/screens/text_block_details_screen_test.dart
Replaced imports from zoe/constants/... to zoe/core/constants/... across multiple provider and test files; no functional changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect CommonUtils.openUrl protocol handling and mailto behavior (isCheckProtocols vs direct mailto).
  • Verify signup checkbox integration doesn't block existing validation/error flows.
  • Confirm store/privacy URLs and contact email values in AppConstants.
  • Quick pass on import path changes to ensure no broken imports in less-affected modules.

Possibly related PRs

Suggested reviewers

  • anisha-e10

Poem

🐇 I hopped through code, a tidy trail,

Links and terms now set to sail,
A tiny checkbox, polite and true,
Share, contact, and store — all linked for you,
Nibbles of constants, organized anew. 🎋

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding external link functionality and privacy/terms agreement requirements across the application.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d763c52 and 7268f98.

📒 Files selected for processing (3)
  • lib/common/utils/common_utils.dart (3 hunks)
  • lib/features/auth/screens/signup_screen.dart (5 hunks)
  • lib/l10n/app_en.arb (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Move Firestore collection and field constants from the `lib/constants` directory to a new `lib/core/constants` directory. Update all import paths across the codebase to reflect this new location.
A "Share App" feature has been implemented. This includes:
- A new `shareApp` utility function in `CommonUtils` to handle the sharing logic.
- A new localized string `shareAppMessage` to construct the shareable text, including app name and store URLs.
- Connecting the "Share Zoe" button in the settings screen to trigger this new functionality.
@kumarpalsinh25 kumarpalsinh25 marked this pull request as ready for review December 18, 2025 07:08
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
lib/features/settings/screens/settings_screen.dart (1)

138-170: Consider showing user feedback when URL launch fails.

The error handling in CommonUtils is solid: the openUrl method has a try-catch block and validates URLs before launching. However, when launchUrl() returns false (e.g., no email client installed or URL cannot be opened), users receive no feedback. Adding a snackbar message for launchUrl failures would improve UX and clarify that the action failed.

lib/core/constants/app_constants.dart (1)

17-21: Document or handle non-mobile platform behavior explicitly.

The storeUrl getter returns an empty string for platforms other than Android and iOS. When this is passed to CommonUtils.openStoreUrl(), it will fail the ValidationUtils.isValidUrl() check and show a snackbar. While this fallback behavior is acceptable, consider either documenting this behavior or returning null to make the intent clearer.

🔎 Alternative approach using nullable return type:
-  static String get storeUrl {
+  static String? get storeUrl {
     if (Platform.isAndroid) return playStoreUrl;
     if (Platform.isIOS) return appStoreUrl;
-    return "";
+    return null;
   }

Then in CommonUtils.openStoreUrl(), you could check for null before calling openUrl().

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0573088 and d763c52.

📒 Files selected for processing (17)
  • android/app/src/main/AndroidManifest.xml (1 hunks)
  • lib/common/utils/common_utils.dart (3 hunks)
  • lib/core/constants/app_constants.dart (1 hunks)
  • lib/features/auth/screens/signup_screen.dart (5 hunks)
  • lib/features/bullets/providers/bullet_providers.dart (1 hunks)
  • lib/features/events/providers/event_providers.dart (1 hunks)
  • lib/features/list/providers/list_providers.dart (1 hunks)
  • lib/features/polls/providers/poll_providers.dart (1 hunks)
  • lib/features/settings/screens/settings_screen.dart (3 hunks)
  • lib/features/sheet/providers/sheet_providers.dart (1 hunks)
  • lib/features/task/providers/task_providers.dart (1 hunks)
  • lib/features/text/providers/text_providers.dart (1 hunks)
  • lib/features/users/providers/user_providers.dart (1 hunks)
  • lib/l10n/app_en.arb (1 hunks)
  • test/features/text/actions/text_actions_test.dart (1 hunks)
  • test/features/text/providers/text_providers_test.dart (1 hunks)
  • test/features/text/screens/text_block_details_screen_test.dart (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: test
  • GitHub Check: macos
  • GitHub Check: linux
  • GitHub Check: android
  • GitHub Check: Test zoe_native plugin
  • GitHub Check: ios
  • GitHub Check: windows
🔇 Additional comments (18)
android/app/src/main/AndroidManifest.xml (1)

70-74: LGTM! Mailto intent query correctly added.

The intent query for mailto support is correctly configured and necessary for Android 11+ package visibility requirements. This enables the app to open email clients when users tap contact support links.

test/features/text/screens/text_block_details_screen_test.dart (1)

14-14: LGTM! Import path updated correctly.

The import path has been correctly updated to reference the core constants module, aligning with the project-wide refactoring.

lib/features/bullets/providers/bullet_providers.dart (1)

11-12: LGTM! Import paths correctly updated.

The Firestore constants imports have been properly migrated to the core module, consistent with the project-wide refactoring.

lib/features/users/providers/user_providers.dart (1)

7-8: LGTM! Import paths correctly updated.

The Firestore constants imports have been properly migrated to the core module.

lib/features/sheet/providers/sheet_providers.dart (1)

7-8: LGTM! Import paths correctly updated.

The Firestore constants imports have been properly migrated to the core module.

lib/features/polls/providers/poll_providers.dart (1)

8-9: LGTM! Import paths correctly updated.

The Firestore constants imports have been properly migrated to the core module.

test/features/text/actions/text_actions_test.dart (1)

6-6: LGTM! Import path correctly updated.

The import path has been correctly updated to reference the core constants module.

lib/features/task/providers/task_providers.dart (1)

8-9: LGTM! Import paths correctly refactored.

The Firestore constants imports have been correctly updated to reference the core module at zoe/core/constants/. This aligns with the project-wide refactoring to organize constants centrally. The refactoring is consistent across all provider files in the codebase.

test/features/text/providers/text_providers_test.dart (1)

5-5: LGTM!

The import path update aligns with the broader migration to centralize constants under core/constants.

lib/features/list/providers/list_providers.dart (1)

7-8: LGTM!

Import paths correctly migrated to the centralized core/constants module, consistent with the broader refactor.

lib/features/events/providers/event_providers.dart (1)

8-9: LGTM!

Import paths updated to align with the centralized constants structure.

lib/features/text/providers/text_providers.dart (1)

7-8: LGTM!

Import paths correctly updated, and the corresponding test file has been updated to match.

lib/features/settings/screens/settings_screen.dart (2)

5-5: LGTM!

Import added for the new CommonUtils utility class.


184-184: LGTM!

Icon color update for the App Name item, likely to avoid visual conflict with the new Terms & Conditions item which uses the previous purple color.

lib/features/auth/screens/signup_screen.dart (1)

49-55: LGTM! Privacy and terms validation is correctly enforced.

The validation logic properly checks the agreement checkbox before allowing sign-up, with clear user feedback via a snackbar message.

lib/common/utils/common_utils.dart (3)

21-37: LGTM! URL protocol handling is well-designed.

The addition of the isCheckProtocols parameter with a sensible default allows for flexible handling of different URL schemes (e.g., mailto:) while maintaining backward compatibility.


115-125: LGTM! URL utility methods are well-structured.

The new utility methods (openStoreUrl, openPrivacyPolicyUrl, openTermsAndConditionsUrl) provide clean, centralized handling of external links with appropriate separation of concerns.


127-130: Android manifest properly configured for mailto intents—code is correct.

The mailto: URL construction and use of isCheckProtocols: false are correct. The Android manifest already includes the required <queries> declaration for the mailto intent, confirming the openContactEmail method will function properly on Android.

Comment thread lib/features/auth/screens/signup_screen.dart
Comment thread lib/l10n/app_en.arb Outdated
The order of arguments passed to the `shareAppMessage` localization string was incorrect. This change reorders the arguments to correctly match the updated placeholder names (`aAppName`, `bAndroidUrl`, `cIosUrl`) in the `app_en.arb` file, ensuring the app name and store URLs are displayed properly in the share message.
Initialize `TapGestureRecognizer` instances for the privacy policy and terms of service links within `initState` and dispose of them in `dispose`. This avoids creating new recognizer instances on every build, improving performance and resource management.
@kumarpalsinh25 kumarpalsinh25 merged commit d9b936e into main Dec 18, 2025
1 check was pending
@kumarpalsinh25 kumarpalsinh25 deleted the kumar/add-privacy-and-terms-urls branch December 18, 2025 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant