-
Notifications
You must be signed in to change notification settings - Fork 0
flutter: Share→SharePlus migration (step 1) #58
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
Conversation
…nce.share/shareXFiles in QR + ShareService; remove local stub
…hare_plus directly
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.
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.
| await Share.shareXFiles([XFile(imagePath)], text: shareText); | ||
| } else { | ||
| // 仅分享文字 | ||
| await Share.share(shareText); |
Copilot
AI
Sep 27, 2025
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.
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.
| await Share.shareXFiles([XFile(imagePath)], text: shareText); | |
| } else { | |
| // 仅分享文字 | |
| await Share.share(shareText); | |
| await SharePlus().shareXFiles([XFile(imagePath)], text: shareText); | |
| } else { | |
| // 仅分享文字 | |
| await SharePlus().share(shareText); |
…g and DeleteFamilyDialog
|
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). |
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
Minimal migration: replace deprecated static Share calls with SharePlus.instance.* in QR generator and ShareService; remove local stub. Analyzer/test expected green.