NyTextField.password constructor
NyTextField.password({
- Key? key,
- bool? passwordVisible,
- String? labelText = "Password",
- required TextEditingController controller,
- bool obscureText = true,
- bool autoFocus = false,
- TextInputType keyboardType = TextInputType.text,
- TextAlign? textAlign,
- int? maxLines = 1,
- bool? validateOnFocusChange = false,
- dynamic handleValidationError(
- String handleError
- int? minLines,
- bool enableSuggestions = true,
- String? hintText,
- TextStyle? hintStyle,
- FocusNode? focusNode,
- String? validationRules,
- String? dummyData,
- dynamic onChanged(
- String value
- TextStyle? style,
- StrutStyle? strutStyle,
- TextInputAction? textInputAction,
- bool readOnly = false,
- bool? showCursor,
- int? maxLength,
- bool? enabled,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- double? cursorHeight,
- Radius? cursorRadius,
- Color? cursorColor,
- GestureTapCallback? onTap,
- TapRegionCallback? onTapOutside,
- String? validationErrorMessage,
- MouseCursor? mouseCursor,
- TextCapitalization textCapitalization = TextCapitalization.none,
- MaxLengthEnforcement? maxLengthEnforcement,
- double cursorWidth = 2.0,
- AppPrivateCommandCallback? onAppPrivateCommand,
- List<
TextInputFormatter> ? inputFormatters, - bool expands = false,
- TextAlignVertical? textAlignVertical,
- TextDirection? textDirection,
- String obscuringCharacter = '•',
- bool autocorrect = true,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- InputDecoration? decoration,
- VoidCallback? onEditingComplete,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- TextSelectionControls? selectionControls,
- ValueChanged<
String> ? onSubmitted, - ScrollController? scrollController,
- ScrollPhysics? scrollPhysics,
- bool? passwordViewable,
- Iterable<
String> ? autofillHints = const <String>[], - Clip clipBehavior = Clip.hardEdge,
- Widget? prefixIcon,
- Color? backgroundColor,
- BorderRadius? borderRadius,
- InputBorder? border,
- InputBorder? focusedBorder,
- InputBorder? enabledBorder,
- EdgeInsetsGeometry? contentPadding,
- TextStyle? labelStyle,
- bool customValidationRule(
- dynamic value
- Widget? header,
- bool? clearable,
- Widget? clearIcon,
- String? mask,
- String? maskMatch,
- bool? maskedReturnValue,
- DecoratorTextField? decorator,
- String? type = 'password',
Password Text Field
Implementation
NyTextField.password({
super.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.header,
this.footer,
this.clearable,
this.clearIcon,
this.mask,
this.maskMatch,
this.maskedReturnValue,
this.decorator,
this.type = 'password',
}) {
if (Nylo.isEnvDeveloping()) {
String dummyDataValue = dummyData ?? "";
if (controller.text.isEmpty && dummyDataValue.isNotEmpty) {
controller.text = dummyDataValue;
}
}
}