MaterialFallbackHandler class
Default Material fallback UI handler for BiometricShield.
Handles fallback authentication flows by presenting Material UI:
- For BiometricFallback.deviceCredential, uses
local_auth - For BiometricFallback.customPin or
customPassword, shows the custom builder in a bottom sheet or dialog
Inject this into BiometricConfig.fallbackHandler to customize fallback presentation.
Example:
final shield = BiometricShield(BiometricConfig(
fallbackHandler: MaterialFallbackHandler(
context: context,
customBuilder: (ctx, callbacks) => MyPinSheet(
onSuccess: callbacks.onSuccess,
onCancel: callbacks.onCancel,
),
theme: BiometricTheme(primaryColor: Colors.blue),
strings: BiometricStrings(
cancelButton: 'Cancel',
),
),
));
- Inheritance
-
- Object
- FallbackHandler
- MaterialFallbackHandler
Constructors
- MaterialFallbackHandler({required BuildContext context, CustomFallbackBuilder? customBuilder, BiometricTheme? theme, BiometricStrings? strings})
Properties
- context → BuildContext
-
The BuildContext for showing bottom sheets and overlays.
final
- customBuilder → CustomFallbackBuilder?
-
Optional builder for custom PIN/password UI.
If null, custom fallbacks cannot be handled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strings → BiometricStrings?
-
String customization (copy, localization, etc).
final
- theme → BiometricTheme?
-
Visual customization (colors, text styles, icons, etc).
final
Methods
-
handleFallback(
{required BiometricFallback type, required String reason}) → Future< FallbackResult> -
Attempt a fallback authentication.
override
-
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