NyTextField.emailAddress constructor

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

Email Address Text Field

Implementation

NyTextField.emailAddress({
  Key? key,
  this.labelText = "Email Address",
  required this.controller,
  this.obscureText = false,
  this.autoFocus = true,
  this.keyboardType = TextInputType.emailAddress,
  this.textAlign,
  this.validateOnFocusChange = false,
  this.maxLines = 1,
  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.passwordViewable,
  this.smartQuotesType,
  this.decoration,
  this.onEditingComplete,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.selectionControls,
  this.onSubmitted,
  this.scrollController,
  this.scrollPhysics,
  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.passwordVisible,
  this.customValidationRule,
  this.type = 'email-address',
}) : super(key: key) {
  if (Nylo.isEnvDeveloping()) {
    String dummyDataValue = dummyData ?? "";
    if (controller.text.isEmpty && dummyDataValue.isNotEmpty) {
      controller.text = dummyDataValue;
    }
  }
}