NyTextField constructor

NyTextField({
  1. Key? key,
  2. required TextEditingController controller,
  3. String? labelText,
  4. bool obscureText = false,
  5. bool autoFocus = false,
  6. TextInputType keyboardType = TextInputType.text,
  7. TextAlign? textAlign,
  8. int? maxLines = 1,
  9. bool? validateOnFocusChange = false,
  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. SmartQuotesType? smartQuotesType,
  46. InputDecoration? decoration,
  47. VoidCallback? onEditingComplete,
  48. Brightness? keyboardAppearance,
  49. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  50. TextSelectionControls? selectionControls,
  51. ValueChanged<String>? onSubmitted,
  52. ScrollController? scrollController,
  53. ScrollPhysics? scrollPhysics,
  54. Iterable<String>? autofillHints = const <String>[],
  55. Clip clipBehavior = Clip.hardEdge,
  56. bool? passwordVisible,
  57. bool? passwordViewable,
  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 = null,
})

Default Text Field

Implementation

NyTextField(
    {Key? key,
    required this.controller,
    this.labelText,
    this.obscureText = false,
    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.autofillHints = const <String>[],
    this.clipBehavior = Clip.hardEdge,
    this.passwordVisible,
    this.passwordViewable,
    this.prefixIcon,
    this.backgroundColor,
    this.borderRadius,
    this.border,
    this.focusedBorder,
    this.enabledBorder,
    this.contentPadding,
    this.labelStyle,
    this.customValidationRule,
    this.type = null})
    : super(key: key) {
  if (Nylo.isEnvDeveloping()) {
    String dummyDataValue = dummyData ?? "";
    if (controller.text.isEmpty && dummyDataValue.isNotEmpty) {
      controller.text = dummyDataValue;
    }
  }
}