CLTextField.rightLeftIcon constructor
CLTextField.rightLeftIcon({
- Key? key,
- required TextEditingController controller,
- required String labelText,
- required dynamic leftIcon,
- required dynamic rightIcon,
- GestureTapCallback? onTap,
- FocusNode? focusNode,
- Future onChanged(
- String value
- bool isRequired = false,
- bool isRounded = false,
- bool isEnabled = true,
- String? initValue,
- bool isReadOnly = false,
- List<
FormFieldValidator< ? validators,String> > - bool isCompact = false,
Implementation
factory CLTextField.rightLeftIcon({
Key? key,
required TextEditingController controller,
required String labelText,
required dynamic leftIcon,
required dynamic rightIcon,
GestureTapCallback? onTap,
FocusNode? focusNode,
Future Function(String value)? onChanged,
bool isRequired = false,
bool isRounded = false,
bool isEnabled = true,
String? initValue,
bool isReadOnly = false,
List<FormFieldValidator<String>>? validators,
bool isCompact = false,
}) {
Widget? toIconWidget(dynamic ic) {
if (ic is IconData) return Icon(ic);
return ic as Widget;
}
return CLTextField(
key: key,
controller: controller,
labelText: labelText,
prefixIcon: toIconWidget(leftIcon),
suffixIcon: toIconWidget(rightIcon),
onChanged: onChanged,
focusNode: focusNode,
onTap: onTap,
isReadOnly: isReadOnly,
isRounded: isRounded,
isEnabled: isEnabled,
validators: validators,
initValue: initValue,
isCompact: isCompact,
);
}