updateDecoration method

void updateDecoration(
  1. dynamic context
)

Implementation

void updateDecoration(context) {
  onTextColor ??= Theme.of(context).primaryColor;
  onClearTextColor ??= Theme.of(context).disabledColor;

  decoration = decoration.copyWith(
    labelStyle: decoration.labelStyle != null
        ? decoration.labelStyle!
            .copyWith(color: hasText ? onTextColor : onClearTextColor)
        : TextStyle(color: hasText ? onTextColor : onClearTextColor),
    disabledBorder: decoration.disabledBorder != null
        ? decoration.disabledBorder!.copyWith(
            borderSide: BorderSide(
            color: hasText ? onTextColor! : onClearTextColor!,
            width: hasText ? 2 : 1,
          ))
        : UnderlineInputBorder(
            borderSide: BorderSide(
            color: hasText ? onTextColor! : onClearTextColor!,
            width: hasText ? 2 : 1,
          )),
  );
}