Flutter2FAConfig class

Configuration options for Flutter 2FA v1.0.5.

Constructors

Flutter2FAConfig({bool useSecureStorage = false, bool allowBiometrics = false, int totpInterval = 30, int totpDigits = 6, String totpAlgorithm = 'SHA1', Color? backgroundColor, Color? textColor, Color? appBarColor, TextStyle? appBarTitleStyle, ButtonStyle? primaryButtonStyle, ButtonStyle? secondaryButtonStyle, TextStyle? primaryButtonTextStyle, TextStyle? secondaryButtonTextStyle, PinTheme? defaultPinTheme, PinTheme? focusedPinTheme, PinTheme? errorPinTheme})
Creates a custom Flutter2FAConfig instance.
const

Properties

allowBiometrics bool
Whether to enable biometric authentication (Face ID / Touch ID / fingerprint) for verification.
final
appBarColor Color?
The background color for the AppBar in the 2FA screens.
final
appBarTitleStyle TextStyle?
The text style for the AppBar titles in the 2FA screens.
final
backgroundColor Color?
The background color for the 2FA configuration and verification screens.
final
defaultPinTheme → PinTheme?
The default pin input field theme for Pinput.
final
errorPinTheme → PinTheme?
The pin input field theme for Pinput when validation fails.
final
focusedPinTheme → PinTheme?
The pin input field theme for Pinput when a cell has focus.
final
hashCode int
The hash code for this object.
no setterinherited
primaryButtonStyle ButtonStyle?
The button style for primary actions (e.g., "Complete Activation", "Verify Code").
final
primaryButtonTextStyle TextStyle?
The text style inside primary action buttons.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryButtonStyle ButtonStyle?
The button style for secondary actions (e.g., "Copy All Codes", "Use a Recovery Code").
final
secondaryButtonTextStyle TextStyle?
The text style inside secondary action buttons.
final
textColor Color?
The default text color used in the 2FA UI.
final
totpAlgorithm String
The hashing algorithm used for TOTP code generation ('SHA1', 'SHA256', 'SHA512').
final
totpDigits int
The length of TOTP verification codes (default: 6).
final
totpInterval int
The time step interval for TOTP codes in seconds (default: 30).
final
useSecureStorage bool
Whether to use secure encrypted storage (Keychain/Keystore) to store secrets.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited