Skip to content

Conversation

@zensgit
Copy link
Owner

@zensgit zensgit commented Sep 27, 2025

Minimal migration: replace deprecated static Share calls with SharePlus.instance.* in QR generator and ShareService; remove local stub. Analyzer/test expected green.

@zensgit zensgit marked this pull request as ready for review September 27, 2025 13:51
@Copilot Copilot AI review requested due to automatic review settings September 27, 2025 13:51
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 initiates the migration from the deprecated Share package to SharePlus by removing local stub implementations and cleaning up unnecessary const declarations.

  • Removes local Share class stub and _StubXFile stub from services and widgets
  • Cleans up redundant const keywords in widget constructors
  • Consolidates share method call formatting

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
jive-flutter/lib/widgets/qr_code_generator.dart Removes XFile and _StubXFile stubs, cleans up const keywords
jive-flutter/lib/services/share_service.dart Removes Share class stub, reformats shareXFiles call

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

Comment on lines 128 to 131
await Share.shareXFiles([XFile(imagePath)], text: shareText);
} else {
// 仅分享文字
await Share.share(shareText);
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

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

The Share class stub has been removed but the code still references Share.shareXFiles and Share.share. These calls will fail at runtime since no SharePlus.instance replacement has been implemented yet.

Suggested change
await Share.shareXFiles([XFile(imagePath)], text: shareText);
} else {
// 仅分享文字
await Share.share(shareText);
await SharePlus().shareXFiles([XFile(imagePath)], text: shareText);
} else {
// 仅分享文字
await SharePlus().share(shareText);

Copilot uses AI. Check for mistakes.
@zensgit
Copy link
Owner Author

zensgit commented Sep 28, 2025

Summary (step-1):\n- Restore and clean QR widget placeholder; remove local Share stub; keep Share.* static APIs for stability.\n- Fix use_build_context_synchronously in AcceptInvitationDialog and DeleteFamilyDialog (capture Navigator/ScaffoldMessenger before awaits + mounted checks).\n\nValidation:\n- flutter analyze: no hard errors in changed files.\n- flutter test: 10/10 passing locally.\n\nFollow-ups:\n- Step-2: upgrade share_plus and migrate to SharePlus.instance.* APIs.\n- Incremental analyzer cleanup (context warnings, safe const).

@zensgit zensgit enabled auto-merge (squash) September 28, 2025 00:31
Resolved conflicts:
- share_service.dart: Use _doShare wrapper pattern
- accept_invitation_dialog.dart: Align with main's patterns
- qr_code_generator.dart: Add const, remove stub method
@zensgit zensgit merged commit fae8254 into main Oct 8, 2025
@zensgit zensgit deleted the flutter/shareplus-migration-step1 branch October 8, 2025 03:31
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant