RixaTextField constructor

RixaTextField({
  1. Key? key,
  2. required String hintText,
  3. required TextEditingController controller,
  4. int maxLines = 1,
  5. int? minLines,
  6. TextStyle? textStyle,
  7. TextStyle? hintStyle,
  8. Color? color,
  9. Color? borderColor,
  10. double? borderWidth,
  11. double radius = 10.0,
  12. dynamic onChanged(
    1. String
    )?,
  13. Color? enabledColor,
  14. Color? focusedColor,
  15. String? labelText,
  16. double? width,
  17. TextStyle? labelStyle,
  18. bool isUnderline = true,
  19. bool expands = false,
  20. TextInputType textInputType = TextInputType.text,
  21. Widget? prefixIcon,
  22. Color? backgroundColor,
  23. EdgeInsetsGeometry? padding = EdgeInsets.zero,
  24. EdgeInsetsGeometry? innerPadding,
  25. bool noInputBorder = false,
})

Implementation

RixaTextField({
  super.key,
  required this.hintText,
  required this.controller,
  this.maxLines = 1,
  this.minLines,
  TextStyle? textStyle,
  TextStyle? hintStyle,
  this.color,
  this.borderColor,
  this.borderWidth,
  this.radius = 10.0,
  this.onChanged,
  Color? enabledColor,
  Color? focusedColor,
  this.labelText,
  this.width,
  TextStyle? labelStyle,
  this.isUnderline = true,
  this.expands = false,
  this.textInputType = TextInputType.text,
  this.prefixIcon,
  this.backgroundColor,
  this.padding = EdgeInsets.zero,
  EdgeInsetsGeometry? innerPadding,
  this.noInputBorder = false,
})  : innerPadding =
          innerPadding ?? const EdgeInsets.symmetric(horizontal: 10),
      textStyle = textStyle ?? Get.find<AppFonts>().S(),
      labelStyle = labelStyle ?? Get.find<AppFonts>().S(),
      hintStyle = hintStyle ??
          Get.find<AppFonts>().S(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;