getTextfieldBorderStyle static method

InputBorder? getTextfieldBorderStyle(
  1. BuildContext context, {
  2. UpStyle? override,
  3. UpStyle? style,
  4. UpInputType? type,
  5. UpColorType? colorType,
  6. bool isFocused = false,
  7. bool isError = false,
})

Implementation

static InputBorder? getTextfieldBorderStyle(
  BuildContext context, {
  UpStyle? override,
  UpStyle? style,
  UpInputType? type,
  UpColorType? colorType,
  bool isFocused = false,
  bool isError = false,
}) {
  switch (type) {
    case UpInputType.underline:
      return UnderlineInputBorder(
        borderSide: BorderSide(
          color: isFocused
              ? UpStyle.getTextfieldFocusedBorderColor(
                  context,
                  colorType: colorType,
                  style: style,
                )
              : isError
                  ? UpStyle.getTextfieldErrorBorderColor(
                      context,
                      colorType: colorType,
                      style: style,
                    )
                  : UpStyle.getTextfieldBorderColor(
                      context,
                      colorType: colorType,
                      style: style,
                    ),
          width: UpStyle.getTextfieldBorderWidth(
            context,
            colorType: colorType,
            style: style,
          ),
        ),
        borderRadius: BorderRadius.all(
          Radius.circular(
            UpStyle.getTextfieldBorderRadius(
              context,
              style: style,
              colorType: colorType,
            ),
          ),
        ),
      );

    case UpInputType.outline:
    default:
      return OutlineInputBorder(
        borderSide: BorderSide(
          color: isFocused
              ? UpStyle.getTextfieldFocusedBorderColor(
                  context,
                  colorType: colorType,
                  style: style,
                )
              : isError
                  ? UpStyle.getTextfieldErrorBorderColor(
                      context,
                      colorType: colorType,
                      style: style,
                    )
                  : UpStyle.getTextfieldBorderColor(
                      context,
                      colorType: colorType,
                      style: style,
                    ),
          width: UpStyle.getTextfieldBorderWidth(
            context,
            colorType: colorType,
            style: style,
          ),
        ),
        borderRadius: BorderRadius.all(
          Radius.circular(
            UpStyle.getTextfieldBorderRadius(
              context,
              style: style,
              colorType: colorType,
            ),
          ),
        ),
      );
  }
}