PasswordField constructor
PasswordField({
- Key? key,
- String text = "",
- required TextEditingController controller,
- String hintText = "",
- bool singleLine = true,
- TextStyle? titleStyle,
- TextStyle? textStyle,
- TextStyle? hintStyle,
- Color? color,
- Color? borderColor,
- double? borderWidth,
- double radius = 10.0,
- TextStyle? errorStyle,
- Color? iconColor,
- bool error = false,
- String? errorText,
- dynamic onChanged()?,
- Color? enabledColor,
- Color? focusedColor,
- String? labelText,
- TextStyle? labelStyle,
- bool isUnderline = true,
- bool expands = false,
- double? width,
- double? height,
- TextInputType textInputType = TextInputType.text,
- Color? bacgroundColor,
- EdgeInsetsGeometry? padding = EdgeInsets.zero,
- EdgeInsetsGeometry? innerPadding,
- bool noInputBorder = false,
- int flex = 1,
Implementation
PasswordField(
{super.key,
this.text = "",
required this.controller,
this.hintText = "",
this.singleLine = true,
TextStyle? titleStyle,
TextStyle? textStyle,
TextStyle? hintStyle,
this.color,
this.borderColor,
this.borderWidth,
this.radius = 10.0,
TextStyle? errorStyle,
Color? iconColor,
this.error = false,
this.errorText,
this.onChanged,
Color? enabledColor,
Color? focusedColor,
this.labelText,
TextStyle? labelStyle,
this.isUnderline = true,
this.expands = false,
this.width,
this.height,
this.textInputType = TextInputType.text,
this.bacgroundColor,
this.padding = EdgeInsets.zero,
EdgeInsetsGeometry? innerPadding,
this.noInputBorder = false,
this.flex = 1})
: innerPadding =
innerPadding ?? const EdgeInsets.symmetric(horizontal: 10),
titleStyle = titleStyle ??
(Rixa.properties.anyMobile
? Get.find<AppFonts>().S(fontWeight: FontWeight.w600)
: Get.find<AppFonts>().S(fontWeight: FontWeight.w600)),
iconColor = iconColor ?? Get.find<AppColors>().iconColor,
textStyle = textStyle ?? Get.find<AppFonts>().S(),
labelStyle = labelStyle ?? Get.find<AppFonts>().S(),
errorStyle = errorStyle ?? Get.find<AppFonts>().xS(color: Colors.red),
hintStyle = hintStyle ??
Get.find<AppFonts>().xS(color: Get.find<AppColors>().hintColor),
enabledColor = enabledColor ?? Get.find<AppColors>().textColor,
focusedColor = focusedColor ?? Colors.cyan,
enabledBorder = !noInputBorder && isUnderline
? UnderlineInputBorder(
borderSide: BorderSide(
color: enabledColor ?? Get.find<AppColors>().textColor),
)
: !noInputBorder && !isUnderline
? OutlineInputBorder(
borderSide: BorderSide(
color: enabledColor ?? Get.find<AppColors>().textColor),
borderRadius: BorderRadius.circular(radius))
: null,
focusedBorder = !noInputBorder && isUnderline
? UnderlineInputBorder(
borderSide: BorderSide(color: focusedColor ?? Colors.cyan),
)
: !noInputBorder && !isUnderline
? OutlineInputBorder(
borderSide: BorderSide(color: focusedColor ?? Colors.cyan),
borderRadius: BorderRadius.circular(radius))
: null,
border = borderColor != null || borderWidth != null
? Border.all(
width: borderWidth ?? 1,
color: borderColor ?? Get.find<AppColors>().textColor)
: null;