feat: insert pin before to connect to specific badge#1783
Open
ctrlVnt wants to merge 12 commits into
Open
Conversation
Contributor
Reviewer's GuideAdds a mandatory 4-digit PIN authentication dialog before badge data transfer and sends the entered PIN as a separate fixed message to the badge, plus introduces a reusable widget for the PIN dialog UI. Sequence diagram for new PIN-gated badge transfer flowsequenceDiagram
actor User
participant BadgeMessageProvider
participant AuthPinDialog
participant ToastUtils
participant Badge
User->>BadgeMessageProvider: initiateTransfer(context)
loop until isAuthenticated
BadgeMessageProvider->>AuthPinDialog: showPinAuthDialog(context)
AuthPinDialog-->>BadgeMessageProvider: enteredPin or null
alt User cancels
BadgeMessageProvider->>ToastUtils: showToast("Transfer canceled by user")
BadgeMessageProvider-->>User: transferAborted
Note over BadgeMessageProvider,User: loop breaks
else PIN entered
BadgeMessageProvider->>Badge: transferData(DataTransferManager(pinData), context)
BadgeMessageProvider->>ToastUtils: showToast("Code verified! Transferring data...")
BadgeMessageProvider-->>User: transferContinues
Note over BadgeMessageProvider,User: loop breaks
end
end
Note over BadgeMessageProvider,Badge: After PIN message, normal data transfer logic runs as before
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
Build StatusBuild successful. APKs to test: https://github.com/fossasia/badgemagic-app/actions/runs/28375755034/artifacts/7953566808. Screenshots |
Contributor
Author
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.







-1_home_screen.png?raw=true)
-2_text_badge.png?raw=true)
-3_emoji_badge.png?raw=true)
-4_inverted_emoji_badge.png?raw=true)
-5_saved_badges.png?raw=true)
-6_saved_badges_clicked.png?raw=true)
-7_draw_badge.png?raw=true)
Fixes #1780
Changes
Important
To test you need this version of firmware: https://github.com/fossasia/badgemagic-firmware/actions/runs/28226361094?pr=163
Note
You can see that toasts are annoying, the #1732 solve this problem
Screenshots / Recordings
screen-20260629-154447-1782740609257.mov
This is the new information dialog:
Checklist:
constants.dartwithout hard coding any value.Summary by Sourcery
Add a PIN entry step before initiating badge data transfer to support badge authentication.
New Features: