mnemonic_backup_flow 0.2.0
mnemonic_backup_flow: ^0.2.0 copied to clipboard
Recovery-phrase reveal, verification and import screens for Flutter wallets, with a PIN gate, screenshot-protection hooks, random-word checks and clipboard clearing.
Changelog #
All notable changes to mnemonic_backup_flow are recorded here. The format follows
Keep a Changelog, and the package follows
Semantic Versioning.
Unreleased #
0.2.0 - 2026-10-17 #
Upgrading from 0.1.0: apps that use showMnemonicBackupFlow need no code change. Apps that push
MnemonicVerifyScreen themselves now pass a screenProtection. With a screenshot plugin that is a
single on/off switch, the safe choice is to hold the plugin around the app's own route stack, wait
for its protect() to complete, and pass ScreenProtection.none() to every screen: a screen's
release happens after it has gone and can switch such a plugin off for the next protected screen.
The README's "Screen protection" section has the details.
Changed #
MnemonicVerifyScreentakesscreenProtectionandprotectionTimeout, shows its choices, which contain a real word of the phrase, only once the protection is active, and hides them while the app is not in the foreground, as the reveal screen does. Breaking for apps that push the verify screen themselves: pass aScreenProtection, as the upgrade note above describes.MnemonicImportScreenhides its field while the app is not in the foreground, keeping what was typed.ScreenProtection.none()makes a screen active from its first frame, with nothing to release, whether or not it is created withconst.- A verify screen with an unusable
challengeCountorchoiceCountfails when it is created, before the protection is switched on, instead of on its first build. - README: a diagram of the three screens and the import screen, above the install line.
Fixed #
showMnemonicBackupFlowhosts the reveal and verify steps in one route with one hold on the protection, switched on before the first step renders and off after the route is gone. In 0.1.0 the verify route was pushed while the reveal route was still animating out, so the reveal screen's release turned a plugin that is a single switch off during verification.- A double tap on the last correct answer called
onVerifiedtwice when the callback did not leave the screen at once. Taps after verification are ignored. - README: states what
verifiedproves (the right word picked at every position asked, retries allowed, not a written-down phrase), that a screen given the app's protection never shows the words beforeprotect()completes however late it answers, and when the release of a screen or of the flow's route, which happens after it has gone, can switch a single-switch plugin off for the protected screen showing next.
0.1.0 - 2026-09-25 #
First release.
Added #
showMnemonicBackupFlow: authenticate, reveal, verify, in that order. Nothing is rendered and no route is pushed until the app's authentication callback returns true.MnemonicRevealScreen: numbered words shown only after the screen protection reports it is active, hidden while the app is inactive or in the background, no text selection, an optional copy button whose clipboard entry is cleared after a delay.MnemonicVerifyScreenandgenerateChallenges: distinct random positions, multiple choice with decoys from the word list, retry after a wrong answer, anonWrongAnswerhook.MnemonicImportScreen: typed or pasted phrase with autocorrect off, whitespace and case normalised, word count, unknown word and checksum errors named separately, clipboard emptied after a paste.MnemonicWords: generation fromRandom.secureentropy for 12, 15, 18, 21 or 24 words, validation throughbip39_mnemonicwith each word trimmed and lower-cased whether given as text or as a list, and atoStringthat never contains the words.ScreenProtection: the hook an app implements with its screenshot plugin, withScreenProtection.none()as an explicit opt-out andScreenProtection.callbacksfor adapters. Each screen's release waits for its protect to settle, orprotectionTimeoutafter the screen goes away; a protect that throws or exceeds the timeout is reported and leaves the screen on an explanatory placeholder, and one that answers late is released again.SensitiveClipboard: copy with timed clearing (the timer starts when the write has landed) that leaves later clipboard contents alone, remembers every text it may have placed until a look proves it gone, treats a clipboard without text as gone except on Android out of the foreground where it is hidden (three looks five seconds apart, then a wipe without looking, and only of text it knows it placed), removes at once onclear()and dispose, retries a failed look or wipe, leaves alone text the platform withholds, bounds every platform call, removes a write that lands late at once, and reports a failure nobody awaits.MnemonicBackupStrings: every user-facing text with English defaults, for translation.