getDropdownBorderStyle static method

InputBorder? getDropdownBorderStyle(
  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? getDropdownBorderStyle(
  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.getDropdownFocusedBorderColor(
                  context,
                  colorType: colorType,
                  style: style,
                )
              : isError
                  ? UpStyle.getDropdownErrorBorderColor(
                      context,
                      colorType: colorType,
                      style: style,
                    )
                  : UpStyle.getDropdownBorderColor(
                      context,
                      colorType: colorType,
                      style: style,
                    ),
          width: UpStyle.getDropdownBorderWidth(
            context,
            colorType: colorType,
            style: style,
          ),
        ),
        borderRadius: BorderRadius.all(
          Radius.circular(
            UpStyle.getDropdownBorderRadius(
              context,
              style: style,
              colorType: colorType,
            ),
          ),
        ),
      );

    case UpInputType.outline:
    default:
      return OutlineInputBorder(
        borderSide: BorderSide(
          color: isFocused
              ? UpStyle.getDropdownFocusedBorderColor(
                  context,
                  colorType: colorType,
                  style: style,
                )
              : isError
                  ? UpStyle.getDropdownErrorBorderColor(
                      context,
                      colorType: colorType,
                      style: style,
                    )
                  : UpStyle.getDropdownBorderColor(
                      context,
                      colorType: colorType,
                      style: style,
                    ),
          width: UpStyle.getDropdownBorderWidth(
            context,
            colorType: colorType,
            style: style,
          ),
        ),
        borderRadius: BorderRadius.all(
          Radius.circular(
            UpStyle.getDropdownBorderRadius(
              context,
              style: style,
              colorType: colorType,
            ),
          ),
        ),
      );
  }
}