maybeApplyInputDecoration method

BoxDecoration maybeApplyInputDecoration(
  1. BuildContext context,
  2. BoxDecoration decoration,
  3. bool focused
)

Implementation

BoxDecoration maybeApplyInputDecoration(BuildContext context, BoxDecoration decoration, bool focused) {
  var inputDecorationTheme = Theme.of(context).inputDecorationTheme;
  var inputBorder = focused ? inputDecorationTheme.focusedBorder : inputDecorationTheme.enabledBorder;

  if (inputBorder is OutlineInputBorder) {
    return decoration.copyWith(
      border: Border.fromBorderSide(inputBorder.borderSide),
      borderRadius: inputBorder.borderRadius
    );
  }

  return decoration;
}