buildTextWithClearField function

Widget buildTextWithClearField(
  1. TextEditingController textEditingController,
  2. double suffixIconSize,
  3. {FocusNode focusNode,
  4. int maxLines,
  5. String hintText,
  6. int maxLength,
  7. EdgeInsets margin,
  8. TextAlign textAlign = TextAlign.left,
  9. bool enabled = true,
  10. double fontSize = 14,
  11. IconData clearIcon,
  12. Widget icon}
)

Implementation

Widget buildTextWithClearField(TextEditingController textEditingController, double suffixIconSize, {FocusNode focusNode, int maxLines, String hintText, int maxLength, EdgeInsets margin, TextAlign textAlign = TextAlign.left, bool enabled = true, double fontSize = 14, IconData clearIcon, Widget icon}){
  return buildTextField(
    margin: margin,
    enabled: enabled,
    textAlign: textAlign,
    fontSize: fontSize,
    maxLength: maxLength,
    maxLines: maxLines,
    focusNode: focusNode,
    decoration: InputDecoration(
      icon: icon,
      border: InputBorder.none,
      hintText: hintText,
      suffixIcon: TextFieldClearWidget(textEditingController, suffixIconSize, iconData: clearIcon,),
    ),
    controller: textEditingController,
  );
}