Skip to content

Conversation

@JatsuAkaYashvant
Copy link
Member

@JatsuAkaYashvant JatsuAkaYashvant commented Sep 7, 2025

Fixes #426 #423

Describe the changes you have made in this PR -

  • Updated share_plus dependency from ^10.1.4 to ^11.1.0
  • Replaced deprecated Share.share() with SharePlus.instance.share()
  • Maintained existing sharing functionality with proper ShareParams usage
  • AGP is upgraded to 8.7.0
  • Kotlin version is pinned to 1.9.25, it is downgraded because the dependencies were compiled with Kotlin 2.1.0, but our build system expects Kotlin 1.9.0.
  • Gradle wrapper has been upgraded to 8.10.2
  • Fix lintOptionslint and compileSdkVersioncompileSdk

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

Summary by CodeRabbit

  • Refactor

    • Migrated project sharing to the newer sharing API for improved reliability and UI positioning; user sharing behavior remains the same.
  • Chores

    • Upgraded sharing library dependency.
    • Updated Android build tooling and Gradle wrapper to newer versions for improved build compatibility.

@coderabbitai
Copy link

coderabbitai bot commented Sep 7, 2025

Walkthrough

Updated share_plus to v11.1.0 and migrated two Dart sharing call sites to the new SharePlus API (using ShareParams). Also updated Android Gradle plugin, Gradle wrapper, and minor Android build file syntax changes. No public app API signatures changed.

Changes

Cohort / File(s) Summary
SharePlus API migration
lib/ui/views/projects/components/featured_project_card.dart, lib/ui/views/projects/project_details_view.dart
Replace Share.share(...) calls with SharePlus.instance.share(ShareParams(...)), preserving shared text/URL and sharePositionOrigin logic (use of RenderBox and Offset).
Dependency version bump
pubspec.yaml
Bump share_plus dependency from ^10.1.4 to ^11.1.0.
Android Gradle plugin & Kotlin updates
android/settings.gradle
Update plugin versions: com.android.application 8.2.1 → 8.7.0 and org.jetbrains.kotlin.android 2.1.10 → 1.9.25 (apply false unchanged).
Gradle wrapper
android/gradle/wrapper/gradle-wrapper.properties
Update Gradle distribution URL from gradle-8.5-all.zip to gradle-8.10.2-all.zip.
Android build file syntax
android/app/build.gradle
Replace compileSdkVersion 35 with compileSdk 35 and lintOptions { ... } with lint { ... } (keeps same disabled checks).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
Bump share_plus from 10.1.4 to 11.1.0 (#426) pubspec.yaml updated to ^11.1.0; call sites migrated to new API.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Migrate Share.share(...) to SharePlus.instance.share(ShareParams(...)) in Dart files The linked issue requested a dependency bump; updating call sites is additional migration work beyond the version bump.
Android Gradle plugin, wrapper, and build file edits Not part of the share_plus bump request but included in this PR (build/tooling updates).

Possibly related PRs

Suggested labels

released

Suggested reviewers

  • tachyons

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The PR includes Android toolchain and build-system updates that are not described in issue [#426]: changes to android/app/build.gradle (compileSdk and lint block), android/gradle/wrapper/gradle-wrapper.properties (Gradle 8.5 -> 8.10.2), and android/settings.gradle (AGP and Kotlin plugin version bumps). These modifications are outside the linked issue's stated goal of only bumping the share_plus dependency and therefore constitute out-of-scope changes unless the author documents they are required to support the dependency upgrade. Because they affect build tooling and could introduce unrelated risks, they should be isolated or explicitly justified. Ask the author to either split the Gradle/AGP/Kotlin/Wrapper upgrades into a separate PR for independent review or update this PR description to explain why each tooling change is necessary and include CI/build evidence; maintainers should then review and run a full build before merging. If the tooling changes must remain here, add a short justification in the PR and ensure tests/CI pass to demonstrate they do not introduce unrelated issues.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Migrate share_plus to v11.1.0 and update sharing implementation" is a concise, single-sentence summary that accurately describes the primary change (dependency bump to share_plus v11.1.0 and the corresponding API update) and is directly related to the modifications in pubspec.yaml and the sharing code. It is specific and clear enough for a teammate to understand the main intent at a glance.
Linked Issues Check ✅ Passed The changeset updates pubspec.yaml to bump share_plus to ^11.1.0 and replaces deprecated Share.share(...) calls with SharePlus.instance.share(ShareParams(...)) in the UI files, which directly implements the linked issue [#426] objective to migrate to v11.1.0 and adapt to the breaking API refactor; the shared text and sharePositionOrigin logic are preserved and no public API signatures were changed. Based on the provided summaries, the coding requirements from the linked issue have been met.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

Copy link

@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/ui/views/projects/components/featured_project_card.dart (1)

107-115: Optional: DRY a small share helper.
Both this widget and ProjectDetailsView construct ShareParams similarly; consider a tiny util like shareText(BuildContext ctx, String text).

lib/ui/views/projects/project_details_view.dart (1)

53-61: Tiny safety guard (optional).
If findRenderObject() ever returns null, early-return to avoid a late NPE; behavior on iPad remains the same when attached.

   void onShareButtonPressed() {
-    final RenderBox? box = context.findRenderObject() as RenderBox?;
-    SharePlus.instance.share(
+    final RenderBox? box = context.findRenderObject() as RenderBox?;
+    if (box == null) return;
+    SharePlus.instance.share(
       ShareParams(
         text: _getProjectUrl(),
         sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
       ),
     );
   }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0aff7a and 5952654.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • lib/ui/views/projects/components/featured_project_card.dart (1 hunks)
  • lib/ui/views/projects/project_details_view.dart (1 hunks)
  • pubspec.yaml (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). (3)
  • GitHub Check: Test & Analyze (ubuntu-latest)
  • GitHub Check: Test & Analyze (macos-latest)
  • GitHub Check: Test & Analyze (windows-latest)
🔇 Additional comments (2)
pubspec.yaml (1)

54-54: Bump looks correct and aligns with the new SharePlus API.
No issues with the dependency update itself.

lib/ui/views/projects/project_details_view.dart (1)

56-61: LGTM: correct migration to SharePlus with ShareParams and origin Rect.
Matches the v11 API and satisfies iPad’s origin requirement. (pub.dev)

@coveralls
Copy link

coveralls commented Sep 7, 2025

Pull Request Test Coverage Report for Build 17701312068

Details

  • 0 of 8 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 54.575%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/ui/views/projects/components/featured_project_card.dart 0 4 0.0%
lib/ui/views/projects/project_details_view.dart 0 4 0.0%
Totals Coverage Status
Change from base Build 17355236994: -0.02%
Covered Lines: 4885
Relevant Lines: 8951

💛 - Coveralls

Copy link

@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: 0

🧹 Nitpick comments (3)
lib/ui/views/projects/components/featured_project_card.dart (2)

111-117: Guard against a null RenderBox to avoid a rare crash.

box! can be null in edge cases (e.g., if the context has no render object yet). Provide a safe fallback Rect.

Apply:

-      final box = context.findRenderObject() as RenderBox?;
-      await SharePlus.instance.share(
-        ShareParams(
-          text: projectUrl,
-          sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
-        ),
-      );
+      final box = context.findRenderObject() as RenderBox?;
+      final origin = (box != null)
+          ? (box.localToGlobal(Offset.zero) & box.size)
+          : const Rect.fromLTWH(0, 0, 1, 1);
+      await SharePlus.instance.share(
+        ShareParams(
+          text: projectUrl,
+          sharePositionOrigin: origin,
+        ),
+      );

111-117: Cover changed lines with a lightweight widget test.

Coveralls flagged 0/4 new lines here. Consider a widget test that taps the share button and verifies a fake platform’s share was invoked with a non‑null sharePositionOrigin. I can sketch the test using share_plus_platform_interface with a fake platform if helpful.

android/settings.gradle (1)

21-23: Confirm Kotlin plugin version intent; align plugin IDs.

You’re declaring org.jetbrains.kotlin.android at 1.9.25. If this replaced a newer 2.x, confirm the downgrade was intentional and compatible with AGP 8.7 and your Flutter toolchain. Also consider using the same plugin ID in app/build.gradle (org.jetbrains.kotlin.android instead of kotlin-android) for consistency.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5952654 and fce9ce2.

📒 Files selected for processing (4)
  • android/app/build.gradle (2 hunks)
  • android/gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • android/settings.gradle (1 hunks)
  • lib/ui/views/projects/components/featured_project_card.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). (3)
  • GitHub Check: Test & Analyze (macos-latest)
  • GitHub Check: Test & Analyze (windows-latest)
  • GitHub Check: Test & Analyze (ubuntu-latest)
🔇 Additional comments (4)
android/app/build.gradle (2)

54-54: AGP 8 DSL: compileSdk migration looks good.

compileSdk 35 is the correct syntax with AGP 8.x.


70-72: AGP 8 DSL: lintOptions → lint is correct.

Migration to the lint {} block is appropriate; rule name is preserved.

lib/ui/views/projects/components/featured_project_card.dart (1)

111-117: Migration to SharePlus.instance + ShareParams is correct; iPad origin handled.

Nice move to the new API and providing sharePositionOrigin.

android/gradle/wrapper/gradle-wrapper.properties (1)

6-6: Pin Gradle wrapper checksum and regenerate wrapper JAR (manual verification required)

Add distributionSha256Sum to android/gradle/wrapper/gradle-wrapper.properties and regenerate gradle-wrapper.jar so it matches Gradle 8.10.2 — the execution environment could not compute the SHA (hash tools missing). Run locally and update the PR:

  • Apply diff:
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
+distributionSha256Sum=<fill_with_official_sha256>

or: shasum -a 256 /tmp/gradle-8.10.2-all.zip or openssl dgst -sha256 /tmp/gradle-8.10.2-all.zip

  • Regenerate wrapper JAR and commit:
    ./gradlew wrapper --gradle-version 8.10.2 --distribution-type all
    git add android/gradle/wrapper/gradle-wrapper.properties android/gradle/wrapper/gradle-wrapper.jar && git commit -m "Pin Gradle 8.10.2 checksum and regenerate wrapper jar"

@JatsuAkaYashvant
Copy link
Member Author

@hardik17771, please review. I have also addressed #423

@tachyons tachyons merged commit 3cb3f85 into CircuitVerse:master Sep 14, 2025
11 checks passed
@JatsuAkaYashvant JatsuAkaYashvant changed the title Migrate share_plus to v11.1.0 and update sharing implementation Migrate share_plus to v11.1.0 and upgrade AGP and Gradle version Sep 15, 2025
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.

3 participants