extend method
Map<String, NyTextField Function(NyTextField nyTextField)>
extend({
- InputDecoration decoration(
- dynamic data,
- InputDecoration inputDecoration
- InputDecoration successDecoration(
- dynamic data,
- InputDecoration inputDecoration
- InputDecoration errorDecoration(
- dynamic data,
- InputDecoration inputDecoration
- String? labelText,
- TextStyle? labelStyle,
- TextEditingController? controller,
- bool? obscureText,
- int? maxLines,
- int? minLines,
- TextInputType? keyboardType,
- bool? autoFocus,
- TextAlign? textAlign,
- bool? enableSuggestions,
- FocusNode? focusNode,
- String? hintText,
- TextStyle? hintStyle,
- String? validationRules,
- String? dummyData,
- dynamic onChanged(
- String value
- TextInputAction? textInputAction,
- TextStyle? style,
- StrutStyle? strutStyle,
- TextAlignVertical? textAlignVertical,
- TextDirection? textDirection,
- String? obscuringCharacter,
- bool? autocorrect,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool? expands,
- bool? readOnly,
- bool? showCursor,
- int? maxLength,
- bool? passwordViewable,
- bool? validateOnFocusChange,
- MouseCursor? mouseCursor,
- String? validationErrorMessage,
- TextCapitalization? textCapitalization,
- MaxLengthEnforcement? maxLengthEnforcement,
- AppPrivateCommandCallback? onAppPrivateCommand,
- List<
TextInputFormatter> ? inputFormatters, - bool? enabled,
- double? cursorWidth,
- double? cursorHeight,
- Radius? cursorRadius,
- Color? cursorColor,
- Brightness? keyboardAppearance,
- EdgeInsets? scrollPadding,
- TextSelectionControls? selectionControls,
- DragStartBehavior? dragStartBehavior,
- GestureTapCallback? onTap,
- TapRegionCallback? onTapOutside,
- VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onSubmitted, - ScrollController? scrollController,
- ScrollPhysics? scrollPhysics,
- Iterable<
String> ? autofillHints, - Clip? clipBehavior,
- dynamic handleValidationError(
- String handleError
- bool? passwordVisible,
- String? type,
- Widget? prefixIcon,
- Color? backgroundColor,
- BorderRadius? borderRadius,
- InputBorder? border,
- InputBorder? focusedBorder,
- InputBorder? enabledBorder,
- EdgeInsetsGeometry? contentPadding,
- bool customValidationRule(
- dynamic value
- String? title,
- TextStyle? titleStyle,
- bool? clearable,
- Widget? clearIcon,
- String? mask,
- String? maskMatch,
- bool? maskedReturnValue,
Extend the field style
Implementation
Map<String, NyTextField Function(NyTextField nyTextField)> extend({
InputDecoration Function(dynamic data, InputDecoration inputDecoration)?
decoration,
InputDecoration Function(dynamic data, InputDecoration inputDecoration)?
successDecoration,
InputDecoration Function(dynamic data, InputDecoration inputDecoration)?
errorDecoration,
String? labelText,
TextStyle? labelStyle,
TextEditingController? controller,
bool? obscureText,
int? maxLines,
int? minLines,
TextInputType? keyboardType,
bool? autoFocus,
TextAlign? textAlign,
bool? enableSuggestions,
FocusNode? focusNode,
String? hintText,
TextStyle? hintStyle,
String? validationRules,
String? dummyData,
Function(String value)? onChanged,
TextInputAction? textInputAction,
TextStyle? style,
StrutStyle? strutStyle,
TextAlignVertical? textAlignVertical,
TextDirection? textDirection,
String? obscuringCharacter,
bool? autocorrect,
SmartDashesType? smartDashesType,
SmartQuotesType? smartQuotesType,
bool? expands,
bool? readOnly,
bool? showCursor,
int? maxLength,
bool? passwordViewable,
bool? validateOnFocusChange,
MouseCursor? mouseCursor,
String? validationErrorMessage,
TextCapitalization? textCapitalization,
MaxLengthEnforcement? maxLengthEnforcement,
AppPrivateCommandCallback? onAppPrivateCommand,
List<TextInputFormatter>? inputFormatters,
bool? enabled,
double? cursorWidth,
double? cursorHeight,
Radius? cursorRadius,
Color? cursorColor,
Brightness? keyboardAppearance,
EdgeInsets? scrollPadding,
TextSelectionControls? selectionControls,
DragStartBehavior? dragStartBehavior,
GestureTapCallback? onTap,
TapRegionCallback? onTapOutside,
VoidCallback? onEditingComplete,
ValueChanged<String>? onSubmitted,
ScrollController? scrollController,
ScrollPhysics? scrollPhysics,
Iterable<String>? autofillHints,
Clip? clipBehavior,
Function(String handleError)? handleValidationError,
bool? passwordVisible,
String? type,
Widget? prefixIcon,
Color? backgroundColor,
BorderRadius? borderRadius,
InputBorder? border,
InputBorder? focusedBorder,
InputBorder? enabledBorder,
EdgeInsetsGeometry? contentPadding,
bool Function(dynamic value)? customValidationRule,
String? title,
TextStyle? titleStyle,
bool? clearable,
Widget? clearIcon,
String? mask,
String? maskMatch,
bool? maskedReturnValue,
}) {
return {
this: (NyTextField textField) {
return textField.copyWith(
decorator: DecoratorTextField(
decoration: (data, inputDecoration) {
if (decoration == null) {
if (textField.decorator?.decoration != null) {
return textField.decorator!.decoration!(
data, inputDecoration);
}
return const InputDecoration();
}
InputDecoration inputDecorationBase =
textField.decorator!.decoration!(data, inputDecoration);
return decoration(data, inputDecorationBase);
},
successDecoration: (data, inputDecoration) {
if (successDecoration == null) {
if (textField.decorator?.successDecoration != null) {
return textField.decorator!.successDecoration!(
data, inputDecoration);
}
return const InputDecoration();
}
InputDecoration inputDecorationBase = textField
.decorator!.successDecoration!(data, inputDecoration);
return successDecoration(data, inputDecorationBase);
},
errorDecoration: (data, inputDecoration) {
if (errorDecoration == null) {
if (textField.decorator?.errorDecoration != null) {
return textField.decorator!.errorDecoration!(
data, inputDecoration);
}
return const InputDecoration();
}
InputDecoration inputDecorationBase =
textField.decorator!.errorDecoration!(data, inputDecoration);
return errorDecoration(data, inputDecorationBase);
},
),
labelText: labelText ?? textField.labelText,
labelStyle: labelStyle ?? textField.labelStyle,
controller: controller ?? textField.controller,
obscureText: obscureText ?? textField.obscureText,
maxLines: maxLines ?? textField.maxLines,
minLines: minLines ?? textField.minLines,
keyboardType: keyboardType ?? textField.keyboardType,
autoFocus: autoFocus ?? textField.autoFocus,
textAlign: textAlign ?? textField.textAlign,
enableSuggestions: enableSuggestions ?? textField.enableSuggestions,
focusNode: focusNode ?? textField.focusNode,
hintText: hintText ?? textField.hintText,
hintStyle: hintStyle ?? textField.hintStyle,
validationRules: validationRules ?? textField.validationRules,
dummyData: dummyData ?? textField.dummyData,
onChanged: onChanged ?? textField.onChanged,
textInputAction: textInputAction ?? textField.textInputAction,
style: style ?? textField.style,
strutStyle: strutStyle ?? textField.strutStyle,
textAlignVertical: textAlignVertical ?? textField.textAlignVertical,
textDirection: textDirection ?? textField.textDirection,
obscuringCharacter:
obscuringCharacter ?? textField.obscuringCharacter,
autocorrect: autocorrect ?? textField.autocorrect,
smartDashesType: smartDashesType ?? textField.smartDashesType,
smartQuotesType: smartQuotesType ?? textField.smartQuotesType,
expands: expands ?? textField.expands,
readOnly: readOnly ?? textField.readOnly,
showCursor: showCursor ?? textField.showCursor,
maxLength: maxLength ?? textField.maxLength,
passwordViewable: passwordViewable ?? textField.passwordViewable,
validateOnFocusChange:
validateOnFocusChange ?? textField.validateOnFocusChange,
mouseCursor: mouseCursor ?? textField.mouseCursor,
validationErrorMessage:
validationErrorMessage ?? textField.validationErrorMessage,
textCapitalization:
textCapitalization ?? textField.textCapitalization,
maxLengthEnforcement:
maxLengthEnforcement ?? textField.maxLengthEnforcement,
onAppPrivateCommand:
onAppPrivateCommand ?? textField.onAppPrivateCommand,
inputFormatters: inputFormatters ?? textField.inputFormatters,
enabled: enabled ?? textField.enabled,
cursorWidth: cursorWidth ?? textField.cursorWidth,
cursorHeight: cursorHeight ?? textField.cursorHeight,
cursorRadius: cursorRadius ?? textField.cursorRadius,
cursorColor: cursorColor ?? textField.cursorColor,
keyboardAppearance:
keyboardAppearance ?? textField.keyboardAppearance,
scrollPadding: scrollPadding ?? textField.scrollPadding,
selectionControls: selectionControls ?? textField.selectionControls,
dragStartBehavior: dragStartBehavior ?? textField.dragStartBehavior,
onTap: onTap ?? textField.onTap,
onTapOutside: onTapOutside ?? textField.onTapOutside,
onEditingComplete: onEditingComplete ?? textField.onEditingComplete,
onSubmitted: onSubmitted ?? textField.onSubmitted,
scrollController: scrollController ?? textField.scrollController,
scrollPhysics: scrollPhysics ?? textField.scrollPhysics,
autofillHints: autofillHints ?? textField.autofillHints,
clipBehavior: clipBehavior ?? textField.clipBehavior,
handleValidationError:
handleValidationError ?? textField.handleValidationError,
passwordVisible: passwordVisible ?? textField.passwordVisible,
type: type ?? textField.type,
prefixIcon: prefixIcon ?? textField.prefixIcon,
backgroundColor: backgroundColor ?? textField.backgroundColor,
borderRadius: borderRadius ?? textField.borderRadius,
border: border ?? textField.border,
focusedBorder: focusedBorder ?? textField.focusedBorder,
enabledBorder: enabledBorder ?? textField.enabledBorder,
contentPadding: contentPadding ?? textField.contentPadding,
customValidationRule:
customValidationRule ?? textField.customValidationRule,
clearable: clearable ?? textField.clearable,
clearIcon: clearIcon ?? textField.clearIcon,
mask: mask ?? textField.mask,
maskMatch: maskMatch ?? textField.maskMatch,
maskedReturnValue: maskedReturnValue ?? textField.maskedReturnValue,
);
}
};
}