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> >
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,
}) {
Widget? toIconWidget(dynamic ic) {
if (ic is IconData) return Icon(ic, size: 16, color: Colors.grey);
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,
);
}