flutter_mfa_ui library

Accessible widgets for multi-factor authentication, built on the Flutter widgets layer.

Independent of Material and Cupertino (ADR-0006). Style them with MfaTheme; adapters live in package:flutter_mfa_ui/material.dart and package:flutter_mfa_ui/cupertino.dart.

Add MfaLocalizations.delegate to your app's localizationsDelegates for Hindi and Arabic; without it the widgets use English.

Classes

EnrollmentQrView
Shows an otpauth:// enrolment URI as a QR code, with the setup key for manual entry and a privacy warning (FR-UI-05).
MfaLocalizations
Callers can lookup localized strings with an instance of MfaLocalizations returned by MfaLocalizations.of(context).
MfaPressable
Makes child pressable by pointer, keyboard and switch access (FR-UI-08, WCAG 2.1.1 and 2.4.7).
MfaStatusBadge
A small badge showing an MfaStatus with an icon and text, so the state is never conveyed by colour alone (FR-UI-03, WCAG 1.4.1).
MfaTheme
Provides MfaThemeData to the flutter_mfa widgets below it.
MfaThemeData
Colours, text styles and metrics used by every flutter_mfa widget.
OtpAccountList
A scrolling list of OtpAccountTiles driven by an account stream (FR-UI-04).
OtpAccountTile
One account with its live code (FR-UI-04).
OtpCodeDisplay
Shows a one-time code grouped for reading (123 456, 1234 5678) (FR-UI-02).
OtpCodeField
Entry field for a 6–8 digit one-time code (FR-UI-01).
OtpCountdownRing
A ring showing how long the current TOTP code stays valid, with the seconds left in the middle (FR-UI-02).

Enums

MfaStatus
The MFA state of an account or user, for MfaStatusBadge.

Functions

lookupMfaLocalizations(Locale locale) → MfaLocalizations
mfaStrings(BuildContext context) → MfaLocalizations
The flutter_mfa strings for context, in English when the app has not added MfaLocalizations.delegate or the locale is not supported, so the widgets never fail for missing localizations.