Add external links and privacy & terms agreement#192
Conversation
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.
|
Caution Review failedThe pull request is closed. WalkthroughAdds 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
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. Comment |
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.
There was a problem hiding this comment.
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
CommonUtilsis solid: theopenUrlmethod has a try-catch block and validates URLs before launching. However, whenlaunchUrl()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
storeUrlgetter returns an empty string for platforms other than Android and iOS. When this is passed toCommonUtils.openStoreUrl(), it will fail theValidationUtils.isValidUrl()check and show a snackbar. While this fallback behavior is acceptable, consider either documenting this behavior or returningnullto 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 callingopenUrl().
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 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/constantsmodule, 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
isCheckProtocolsparameter 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 ofisCheckProtocols: falseare correct. The Android manifest already includes the required<queries>declaration for themailtointent, confirming theopenContactEmailmethod will function properly on Android.
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.
This commit introduces several new features and improvements:
CommonUtilsfor reusability.app_constants.dartfile to manage store URLs, legal document URLs, and the contact email address.mailtoto ensure email functionality works correctly on Android.Summary by CodeRabbit
New Features
Localization
Chores
✏️ Tip: You can customize this high-level summary in your review settings.