password static method

Widget password({
  1. Key? key,
  2. required TextFieldState state,
  3. String? label,
  4. String? hint,
  5. required RxBool obscured,
  6. bool treatErrorAsStatus = true,
  7. TextStyle? style,
})

Constructs a ReactiveTextField tuned best for password-type fields.

Implementation

static Widget password({
  Key? key,
  required TextFieldState state,
  String? label,
  String? hint,
  required RxBool obscured,
  bool treatErrorAsStatus = true,
  TextStyle? style,
}) {
  return Obx(() {
    return ReactiveTextField(
      key: key,
      state: state,
      label: label,
      hint: hint,
      floatingLabelBehavior: FloatingLabelBehavior.always,
      trailing: Center(
        child: SvgIcon(
          obscured.value ? SvgIcons.visibleOff : SvgIcons.visibleOn,
        ),
      ),
      obscure: obscured.value,
      onSuffixPressed: obscured.toggle,
      treatErrorAsStatus: treatErrorAsStatus,
      textCapitalization: TextCapitalization.none,
      style: style,
    );
  });
}