Skip to content

Conversation

@zensgit
Copy link
Owner

@zensgit zensgit commented Sep 30, 2025

  • Remove placeholder stubs and fix const eval in qr_code_generator.dart
  • Use SharePlus.instance.share(ShareParams) in InvitationQrCodeDialog
  • Keep QrImageView (qr_flutter) and clean structure

Analyzer: no hard errors. Tests: all green (14/14).

…nce.share with ShareParams; add cross_file import
…nd leftover stub; fix const usage; migrate invite dialog share to SharePlus.instance
@Copilot Copilot AI review requested due to automatic review settings September 30, 2025 08:44
@zensgit zensgit added flutter Flutter UI and widgets tests Tests and CI stability labels Sep 30, 2025
@zensgit zensgit enabled auto-merge (squash) September 30, 2025 08:44
@gemini-code-assist
Copy link

Summary of Changes

Hello @zensgit, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the QR code generation and sharing capabilities within the application. It focuses on removing unnecessary placeholder code related to QR image display and modernizing the sharing mechanism by integrating the SharePlus package, specifically for the invitation dialog. These changes aim to streamline the codebase and enhance the sharing experience.

Highlights

  • QR Widget Cleanup: Removed placeholder stub methods for XFile and QrImageView in qr_code_generator.dart, and corrected a const evaluation issue for CircularProgressIndicator.
  • SharePlus Integration: Updated the InvitationQrCodeDialog to utilize SharePlus.instance.share(ShareParams) for sharing invitation details, replacing the previous Share.share method.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR cleans up the QR widget implementation by removing placeholder stub code and updates the sharing functionality to use SharePlus API. The changes eliminate temporary development stubs and implement proper external dependencies.

  • Removed placeholder stub methods and classes that were used during development
  • Updated sharing functionality to use SharePlus.instance.share(ShareParams) instead of Share.share()
  • Fixed const evaluation issue with CircularProgressIndicator widget

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +453 to 454
await SharePlus.instance.share(ShareParams(text:
'邀请你加入家庭「$familyName\n\n'
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

The ShareParams constructor call spans multiple lines but is missing proper parameter naming. Consider using named parameter 'text:' explicitly and proper formatting for better readability.

Suggested change
await SharePlus.instance.share(ShareParams(text:
'邀请你加入家庭「$familyName\n\n'
await SharePlus.instance.share(ShareParams(
text: '邀请你加入家庭「$familyName\n\n'

Copilot uses AI. Check for mistakes.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request provides some nice cleanups to the qr_code_generator.dart file. It removes placeholder stub code, fixes a minor const evaluation issue, and updates the sharing functionality in the InvitationQrCodeDialog to use the more modern SharePlus.instance.share API. The changes are clear and improve the code quality. I have one suggestion to further improve the readability of the sharing logic.

Comment on lines 452 to 459
onPressed: () async {
await Share.share(
await SharePlus.instance.share(ShareParams(text:
'邀请你加入家庭「$familyName\n\n'
'邀请码:$inviteCode\n'
'点击链接加入:$inviteLink\n\n'
'有效期:$daysLeft 天',
);
));
},

Choose a reason for hiding this comment

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

medium

For better readability, it's a good practice to extract the multi-line string into a separate variable before passing it to the share method. This makes the code cleaner and easier to understand.

                    onPressed: () async {
                      final shareText = '邀请你加入家庭「$familyName\n\n'
                          '邀请码:$inviteCode\n'
                          '点击链接加入:$inviteLink\n\n'
                          '有效期:$daysLeft 天';
                      await SharePlus.instance.share(ShareParams(text: shareText));
                    },

@zensgit zensgit merged commit 54c4866 into main Sep 30, 2025
9 checks passed
@zensgit zensgit deleted the flutter/qr-widget-cleanup-shareplus branch September 30, 2025 08:51
@zensgit zensgit mentioned this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter Flutter UI and widgets tests Tests and CI stability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant