MFAWidget constructor
- required dynamic onCompleted(
- String code
 
 - dynamic onSubmitted(
- String code
 
 - PinTheme? defaultPinTheme,
 - PinTheme? focusedPinTheme,
 - PinTheme? submittedPinTheme,
 - PinTheme? followingPinTheme,
 - PinTheme? disabledPinTheme,
 - PinTheme? errorPinTheme,
 - List<
int> ? seperatorPositions, - Widget errorBuilder()?,
 - String? errorText,
 - TextStyle? errorTextStyle,
 - String? validator()?,
 - Widget submitButtonBuilder(
- Function onTap
 
 - int length = 6,
 - Key? key,
 
Constructs an MFAWidget.
onCompleted: Callback function triggered when the MFA code is completed. onSubmitted: Callback function triggered when the MFA code is submitted. length: The length of the MFA code. defaultPinTheme: The theme for the default state of the input pins. focusedPinTheme: The theme for the focused state of the input pins. submittedPinTheme: The theme for the submitted state of the input pins. followingPinTheme: The theme for the pins following the submitted pin. disabledPinTheme: The theme for disabled input pins. errorPinTheme: The theme for input pins in error state. seperatorPositions: Positions for separators between input pins. errorText: Text to display when there's an error. validator: Validator function to validate the input. errorBuilder: Builder function to customize the error display. errorTextStyle: Style for the error text. submitButtonBuilder: Builder function to customize the submit button.
Implementation
const MFAWidget({
  required this.onCompleted,
  this.onSubmitted,
  this.defaultPinTheme,
  this.focusedPinTheme,
  this.submittedPinTheme,
  this.followingPinTheme,
  this.disabledPinTheme,
  this.errorPinTheme,
  this.seperatorPositions,
  this.errorBuilder,
  this.errorText,
  this.errorTextStyle,
  this.validator,
  this.submitButtonBuilder,
  this.length = 6,
  super.key,
}) : assert(
        (onSubmitted == null && submitButtonBuilder == null) ||
            (onSubmitted != null && submitButtonBuilder != null),
        'onSubmitted and submitButtonBuilder must be both null or both'
        ' not null',
      );