FMCvvField constructor

const FMCvvField({
  1. Key? key,
  2. TextEditingController? controller,
  3. FocusNode? focusNode,
  4. InputDecoration? decoration = const InputDecoration(),
  5. TextInputAction? textInputAction,
  6. TextStyle? style,
  7. StrutStyle? strutStyle,
  8. TextDirection? textDirection,
  9. TextAlign textAlign = TextAlign.start,
  10. TextAlignVertical? textAlignVertical,
  11. bool autofocus = false,
  12. bool readOnly = false,
  13. bool? showCursor,
  14. ValueChanged<String>? onChanged,
  15. GestureTapCallback? onTap,
  16. VoidCallback? onEditingComplete,
  17. ValueChanged<String>? onFieldSubmitted,
  18. void onSaved(
    1. String?
    )?,
  19. bool? enabled,
  20. double cursorWidth = 2.0,
  21. double? cursorHeight,
  22. Radius? cursorRadius,
  23. Color? cursorColor,
  24. Brightness? keyboardAppearance,
  25. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  26. TextSelectionControls? selectionControls,
  27. ScrollPhysics? scrollPhysics,
  28. ScrollController? scrollController,
  29. String? restorationId,
  30. MouseCursor? mouseCursor,
})

CVV Field

Type: TextFormField customized.

This is the field that controls the CVV validations which are immutable. Although other properties like decorations and more can be customized to fit needs.

Validations

  • Takes only digits.
  • Allows on a minimum of 3 characters and maximum of 4 characters.
  • Can only be single line field.
  • The keyboard type is always set to numbers.
  • Validation are done automatically on user interaction.

Implementation

const FMCvvField({
  super.key,
  this.controller,
  this.focusNode,
  this.decoration = const InputDecoration(),
  this.textInputAction,
  this.style,
  this.strutStyle,
  this.textDirection,
  this.textAlign = TextAlign.start,
  this.textAlignVertical,
  this.autofocus = false,
  this.readOnly = false,
  this.showCursor,
  this.onChanged,
  this.onTap,
  this.onEditingComplete,
  this.onFieldSubmitted,
  this.onSaved,
  this.enabled,
  this.cursorWidth = 2.0,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorColor,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.selectionControls,
  this.scrollPhysics,
  this.scrollController,
  this.restorationId,
  this.mouseCursor,
});