NyTextField.password constructor

NyTextField.password({
  1. Key? key,
  2. bool? passwordVisible,
  3. String? labelText = "Password",
  4. required TextEditingController controller,
  5. bool obscureText = true,
  6. bool autoFocus = false,
  7. TextInputType keyboardType = TextInputType.text,
  8. TextAlign? textAlign,
  9. int? maxLines = 1,
  10. bool? validateOnFocusChange = false,
  11. dynamic handleValidationError(
    1. String handleError
    )?,
  12. int? minLines,
  13. bool enableSuggestions = true,
  14. String? hintText,
  15. TextStyle? hintStyle,
  16. FocusNode? focusNode,
  17. String? validationRules,
  18. String? dummyData,
  19. dynamic onChanged(
    1. String value
    )?,
  20. TextStyle? style,
  21. StrutStyle? strutStyle,
  22. TextInputAction? textInputAction,
  23. bool readOnly = false,
  24. bool? showCursor,
  25. int? maxLength,
  26. bool? enabled,
  27. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  28. double? cursorHeight,
  29. Radius? cursorRadius,
  30. Color? cursorColor,
  31. GestureTapCallback? onTap,
  32. TapRegionCallback? onTapOutside,
  33. String? validationErrorMessage,
  34. MouseCursor? mouseCursor,
  35. TextCapitalization textCapitalization = TextCapitalization.none,
  36. MaxLengthEnforcement? maxLengthEnforcement,
  37. double cursorWidth = 2.0,
  38. AppPrivateCommandCallback? onAppPrivateCommand,
  39. List<TextInputFormatter>? inputFormatters,
  40. bool expands = false,
  41. TextAlignVertical? textAlignVertical,
  42. TextDirection? textDirection,
  43. String obscuringCharacter = '•',
  44. bool autocorrect = true,
  45. SmartDashesType? smartDashesType,
  46. SmartQuotesType? smartQuotesType,
  47. InputDecoration? decoration,
  48. VoidCallback? onEditingComplete,
  49. Brightness? keyboardAppearance,
  50. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  51. TextSelectionControls? selectionControls,
  52. ValueChanged<String>? onSubmitted,
  53. ScrollController? scrollController,
  54. ScrollPhysics? scrollPhysics,
  55. bool? passwordViewable,
  56. Iterable<String>? autofillHints = const <String>[],
  57. Clip clipBehavior = Clip.hardEdge,
  58. Widget? prefixIcon,
  59. Color? backgroundColor,
  60. BorderRadius? borderRadius,
  61. InputBorder? border,
  62. InputBorder? focusedBorder,
  63. InputBorder? enabledBorder,
  64. EdgeInsetsGeometry? contentPadding,
  65. TextStyle? labelStyle,
  66. bool customValidationRule(
    1. dynamic value
    )?,
  67. String? type = 'password',
})

Password Text Field

Implementation

NyTextField.password({
  Key? key,
  this.passwordVisible,
  this.labelText = "Password",
  required this.controller,
  this.obscureText = true,
  this.autoFocus = false,
  this.keyboardType = TextInputType.text,
  this.textAlign,
  this.maxLines = 1,
  this.validateOnFocusChange = false,
  this.handleValidationError,
  this.minLines,
  this.enableSuggestions = true,
  this.hintText,
  this.hintStyle,
  this.focusNode,
  this.validationRules,
  this.dummyData,
  this.onChanged,
  this.style,
  this.strutStyle,
  this.textInputAction,
  this.readOnly = false,
  this.showCursor,
  this.maxLength,
  this.enabled,
  this.dragStartBehavior = DragStartBehavior.start,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorColor,
  this.onTap,
  this.onTapOutside,
  this.validationErrorMessage,
  this.mouseCursor,
  this.textCapitalization = TextCapitalization.none,
  this.maxLengthEnforcement,
  this.cursorWidth = 2.0,
  this.onAppPrivateCommand,
  this.inputFormatters,
  this.expands = false,
  this.textAlignVertical,
  this.textDirection,
  this.obscuringCharacter = '•',
  this.autocorrect = true,
  this.smartDashesType,
  this.smartQuotesType,
  this.decoration,
  this.onEditingComplete,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.selectionControls,
  this.onSubmitted,
  this.scrollController,
  this.scrollPhysics,
  this.passwordViewable,
  this.autofillHints = const <String>[],
  this.clipBehavior = Clip.hardEdge,
  this.prefixIcon,
  this.backgroundColor,
  this.borderRadius,
  this.border,
  this.focusedBorder,
  this.enabledBorder,
  this.contentPadding,
  this.labelStyle,
  this.customValidationRule,
  this.type = 'password',
}) : super(key: key) {
  if (Nylo.isEnvDeveloping()) {
    String dummyDataValue = dummyData ?? "";
    if (controller.text.isEmpty && dummyDataValue.isNotEmpty) {
      controller.text = dummyDataValue;
    }
  }
}