CLTextField.password constructor

CLTextField.password({
  1. Key? key,
  2. required TextEditingController controller,
  3. required String labelText,
  4. bool isReadOnly = false,
  5. bool isRequired = false,
  6. bool isRounded = false,
  7. bool isEnabled = true,
  8. dynamic prefix,
  9. dynamic suffix,
  10. List<FormFieldValidator<String>>? validators,
  11. bool isCompact = false,
})

Implementation

factory CLTextField.password({
  Key? key,
  required TextEditingController controller,
  required String labelText,
  bool isReadOnly = false,
  bool isRequired = false,
  bool isRounded = false,
  bool isEnabled = true,
  dynamic prefix,
  dynamic suffix,
  List<FormFieldValidator<String>>? validators,
  bool isCompact = false,
}) {
  Widget? toIconWidget(dynamic ic) {
    if (ic == null) return null;
    if (ic is IconData) return Icon(ic);
    return ic as Widget;
  }

  return CLTextField(
    key: key,
    controller: controller,
    labelText: labelText,
    isObscured: true,
    isReadOnly: isReadOnly,
    isRequired: isRequired,
    isRounded: isRounded,
    isEnabled: isEnabled,
    validators: validators,
    prefixIcon: toIconWidget(prefix),
    suffixIcon: toIconWidget(suffix),
    isCompact: isCompact,
  );
}