-
Notifications
You must be signed in to change notification settings - Fork 11
docs: update flutter in app sdk docs #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
WalkthroughIntroduces comprehensive documentation for the Reclaim Flutter SDK including three new files covering advanced features, public API reference, and usage examples. Also significantly restructures existing installation and usage guides with updated code examples, expanded prerequisites, and clearer configuration guidance. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (6)
content/docs/flutter/api-reference.mdx (1)
313-318: Self-referential link in API reference may confuse users.Line 317 links to Advanced Features from within the API Reference section on Theme Classes. This is contextually confusing since readers are already viewing the API reference. Consider either removing the link, or clarifying its purpose (e.g., "For theming examples, see...").
content/docs/flutter/advanced-features.mdx (1)
305-314: Undocumented package dependency in code example.The code example at lines 305-314 imports
flutter_secure_storage, but this package is not mentioned in the prerequisites, installation, or dependencies section. This could lead to runtime errors if developers copy the example without adding the dependency.Add a note above the example clarifying that this requires an external dependency:
### 3. Secure Storage Store sensitive data securely: +To use this pattern, add the `flutter_secure_storage` package to your pubspec.yaml: + +```yaml +dependencies: + flutter_secure_storage: ^latest +``` + +Then import and use it: + ```dartcontent/docs/flutter/usage.mdx (1)
23-26: Environment variables should not be exposed in example code.Lines 23-26 show directly accessing environment variables, but the values would be empty in most developer environments without the
.envsetup. Consider adding a note that clarifies the required setup step first.Add a reference or note before this section:
+### Set Up Credentials +First, ensure you have set up your environment variables as described in the [Installation](/docs/flutter/installation#environment-variables) guide. + -### 2. Set Up Credentialscontent/docs/flutter/examples.mdx (1)
425-436: Commented code in example may confuse developers.The code at lines 430-433 shows commented-out HTTP calls. While this is instructive, consider either providing a complete working example with a mock HTTP client or more clearly explaining why it's commented.
Future<void> _sendProofsToBackend(List<CreateClaimOutput> proofs) async { // Example: Send proofs to your backend final proofsJson = proofs.map((p) => p.toJson()).toList(); - // Make API call to your backend - // await http.post( - // Uri.parse('https://your-api.com/verify-proofs'), - // body: json.encode({'proofs': proofsJson}), - // ); + // Make API call to your backend using the http package: + // final response = await http.post( + // Uri.parse('https://your-api.com/verify-proofs'), + // body: json.encode({'proofs': proofsJson}), + // ); + // if (response.statusCode == 200) { + // print('Proofs verified successfully'); + // } print('Proofs sent to backend for validation'); }content/docs/flutter/installation.mdx (2)
21-26: Prerequisites section lacks version specificity in one area.Lines 21-26 specify Flutter 3.35.0 and Dart 3.9.0, but the prerequisites also reference "Reclaim Developer Tool" without specifying if there are account tier requirements or any limitations. Consider clarifying account setup expectations.
2. **Reclaim Developer Account**: Login to [Reclaim Developer Tool](https://dev.reclaimprotocol.org/) 3. **Application Credentials**: - Create an application at [Reclaim Developer Tool](https://dev.reclaimprotocol.org/new-application) + - Ensure your account has the appropriate tier to create applications - Obtain your Application ID and Application Secret 4. **Provider ID**: Choose a data provider from [Provider Explorer](https://dev.reclaimprotocol.org/explore)
107-109: Command for running with environment variables may not work on all platforms.Line 108 uses
flutter run --dart-define-from-file=./.env, which is the recommended approach. However, this feature was added in Flutter 3.7+. Consider adding a platform compatibility note since line 21 specifies Flutter 3.35.0+ as a requirement (which is well above 3.7, so this should be fine, but clarification helps).Run your app with the environment file: ```bash flutter run --dart-define-from-file=./.env
- Note: This command requires Flutter 3.7.0 or later.
</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 20b0dcb4aea106e47670ecf2ee6d50731d69eb0e and c6a639473acc8f0093f2437e98f75648f30e4aa3. </details> <details> <summary>📒 Files selected for processing (6)</summary> * `content/docs/flutter/advanced-features.mdx` (1 hunks) * `content/docs/flutter/api-reference.mdx` (1 hunks) * `content/docs/flutter/examples.mdx` (1 hunks) * `content/docs/flutter/installation.mdx` (1 hunks) * `content/docs/flutter/meta.json` (1 hunks) * `content/docs/flutter/usage.mdx` (1 hunks) </details> <details> <summary>🔇 Additional comments (1)</summary><blockquote> <details> <summary>content/docs/flutter/usage.mdx (1)</summary><blockquote> `92-104`: **Exception hierarchy documented inline differs from API reference.** Lines 92-104 show the exception catching pattern, but the hierarchy structure shown (lines 247-265) differs slightly from the api-reference.mdx exception hierarchy. Specifically, line 253 shows `InvalidRequestReclaimException` as a child of `ReclaimVerificationCancelledException`, which should be verified against the actual SDK. Can you verify that the exception hierarchy shown in lines 247-265 matches the actual SDK implementation in the api-reference.mdx file (lines 227-292)? </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
| dependencies: | ||
| reclaim_inapp_sdk: ^latest_version | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Dependency version placeholder is vague.
Line 48 uses ^latest_version as a placeholder, which is not standard Pub/pubspec.yaml syntax. Developers may copy this verbatim and encounter errors.
Replace the placeholder with a realistic version constraint:
dependencies:
- reclaim_inapp_sdk: ^latest_version
+ reclaim_inapp_sdk: ^1.0.0Alternatively, link to the actual package on pub.dev for the latest version.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| dependencies: | |
| reclaim_inapp_sdk: ^latest_version | |
| ``` | |
| dependencies: | |
| reclaim_inapp_sdk: ^1.0.0 |
🤖 Prompt for AI Agents
In content/docs/flutter/installation.mdx around lines 47 to 49, the dependency
line uses the nonstandard placeholder `^latest_version`; replace this with a
valid pubspec version constraint (e.g., a concrete semver like `^1.2.3` or a
permissive range such as `any`), or instead provide a link/instruction to fetch
the current version from the package's pub.dev page so users can copy the proper
version string.
Description
Testing (ignore for documentation update)
Type of change
Checklist:
Additional Notes:
Summary by CodeRabbit