inputDecorationTheme static method

InputDecorationTheme inputDecorationTheme(
  1. Palette colors,
  2. TextTheme textTheme, [
  3. MonetShapes? shapes,
  4. TextDirection textDirection = TextDirection.ltr,
])

Implementation

static InputDecorationTheme inputDecorationTheme(
  Palette colors,
  TextTheme textTheme, [
  MonetShapes? shapes,
  TextDirection textDirection = TextDirection.ltr,
]) {
  shapes ??= _defaultShapes;
  final border = shapes.inputBorder(
    borderSide: BorderSide(width: 2, color: colors.fill),
    textDirection: textDirection,
  );
  final focusedBorder = shapes.inputBorder(
    borderSide: BorderSide(width: 3, color: colors.text),
    textDirection: textDirection,
  );
  return InputDecorationTheme(
    isCollapsed: false,
    isDense: true,
    fillColor: colors.background,
    filled: true,
    border: border,
    focusedBorder: focusedBorder,
    enabledBorder: border,
    hintStyle: textTheme.labelLarge!.copyWith(color: colors.text),
    helperStyle: textTheme.labelLarge!.copyWith(color: colors.text),
    labelStyle: textTheme.labelMedium!
        .copyWith(color: colors.text)
        .copyWith(fontWeight: FontWeight.w700),
    // Can't specify text in hover state: introduce some change in the
    // background, but not so much as to make the text unreadable, as
    // primaryPalette.textHovered would do.
    hoverColor: colors.text.withOpacityNeue(0.2),
  );
}